aboutsummaryrefslogtreecommitdiff
path: root/target/i386
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2018-04-17 21:47:50 +0300
committerMichael S. Tsirkin <mst@redhat.com>2018-05-23 03:14:41 +0300
commit1814eab67398029a927847dfd29198a26aeaf7d8 (patch)
tree20a6c257aaf66c3ffed38a37b53e95bc81132fa2 /target/i386
parentd49bd359d186a83fbb66a23dafd2d6664b79aa6a (diff)
downloadqemu-1814eab67398029a927847dfd29198a26aeaf7d8.zip
qemu-1814eab67398029a927847dfd29198a26aeaf7d8.tar.gz
qemu-1814eab67398029a927847dfd29198a26aeaf7d8.tar.bz2
x86/cpu: use standard-headers/asm-x86.kvm_para.h
Switch to the header we imported from Linux, this allows us to drop a hack in kvm_i386.h. More code will be dropped in the next patch. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'target/i386')
-rw-r--r--target/i386/cpu.c4
-rw-r--r--target/i386/cpu.h2
-rw-r--r--target/i386/kvm.c4
-rw-r--r--target/i386/kvm_i386.h6
4 files changed, 3 insertions, 13 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index d95310f..9426041 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -40,9 +40,7 @@
#include "qom/qom-qobject.h"
#include "sysemu/arch_init.h"
-#if defined(CONFIG_KVM)
-#include <linux/kvm_para.h>
-#endif
+#include "standard-headers/asm-x86/kvm_para.h"
#include "sysemu/sysemu.h"
#include "hw/qdev-properties.h"
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 8ac13f6..6645046 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -688,8 +688,6 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
#define CPUID_7_0_EDX_SPEC_CTRL (1U << 26) /* Speculation Control */
#define CPUID_7_0_EDX_SPEC_CTRL_SSBD (1U << 31) /* Speculative Store Bypass Disable */
-#define KVM_HINTS_DEDICATED (1U << 0)
-
#define CPUID_8000_0008_EBX_IBPB (1U << 12) /* Indirect Branch Prediction Barrier */
#define CPUID_XSAVE_XSAVEOPT (1U << 0)
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 0c656a9..6511329 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -18,7 +18,7 @@
#include <sys/utsname.h>
#include <linux/kvm.h>
-#include <linux/kvm_para.h>
+#include "standard-headers/asm-x86/kvm_para.h"
#include "qemu-common.h"
#include "cpu.h"
@@ -387,7 +387,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
ret &= ~(1U << KVM_FEATURE_PV_UNHALT);
}
} else if (function == KVM_CPUID_FEATURES && reg == R_EDX) {
- ret |= KVM_HINTS_DEDICATED;
+ ret |= 1U << KVM_HINTS_DEDICATED;
found = 1;
}
diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h
index 1de9876..e5df24c 100644
--- a/target/i386/kvm_i386.h
+++ b/target/i386/kvm_i386.h
@@ -30,12 +30,6 @@
#define kvm_pic_in_kernel() 0
#define kvm_ioapic_in_kernel() 0
-/* These constants must never be used at runtime if kvm_enabled() is false.
- * They exist so we don't need #ifdefs around KVM-specific code that already
- * checks kvm_enabled() properly.
- */
-#define KVM_CPUID_FEATURES 0
-
#endif /* CONFIG_KVM */
bool kvm_allows_irq0_override(void);