x86/cpu: use standard-headers/asm-x86.kvm_para.h
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 17 Apr 2018 18:47:50 +0000 (21:47 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 23 May 2018 00:14:41 +0000 (03:14 +0300)
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>
hw/i386/kvm/clock.c
include/sysemu/kvm.h
target/i386/cpu.c
target/i386/cpu.h
target/i386/kvm.c
target/i386/kvm_i386.h

index 7dac319403d32007338a2a98856b6f5d8474b696..0bf1c60a06cee5d8390a46a0aae3e614aece8dd4 100644 (file)
@@ -26,7 +26,7 @@
 #include "qapi/error.h"
 
 #include <linux/kvm.h>
-#include <linux/kvm_para.h>
+#include "standard-headers/asm-x86/kvm_para.h"
 
 #define TYPE_KVM_CLOCK "kvmclock"
 #define KVM_CLOCK(obj) OBJECT_CHECK(KVMClockState, (obj), TYPE_KVM_CLOCK)
index 23669c4d5a230bc76d7071cef495d2f5d67d5575..0b64b8e06786c494fdcf191142ca49f73a21ef68 100644 (file)
@@ -22,7 +22,6 @@
 #ifdef NEED_CPU_H
 # ifdef CONFIG_KVM
 #  include <linux/kvm.h>
-#  include <linux/kvm_para.h>
 #  define CONFIG_KVM_IS_POSSIBLE
 # endif
 #else
index d95310ffd463a8fa6fd904fd99c481639e406a62..94260412e2299b575021ced7a9af5d757b18cf67 100644 (file)
@@ -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"
index 8ac13f6c2ca6eef8c717946dc7f616a41338a9c8..664504610ef4b232cdc22733e1022ac10b5ef255 100644 (file)
@@ -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)
index 0c656a91a41330543ca29c0c22fbbbb82f471c6c..6511329d11ed0bcd91f52922b8e72c0f1db5ac6b 100644 (file)
@@ -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;
     }
 
index 1de9876cd9d74795481343e1b97645a3c856d579..e5df24cad1668141a79e1f78b7daabe3af00d4e0 100644 (file)
 #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);