Parcourir la source

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>
Michael S. Tsirkin il y a 7 ans
Parent
commit
1814eab673
6 fichiers modifiés avec 4 ajouts et 15 suppressions
  1. 1 1
      hw/i386/kvm/clock.c
  2. 0 1
      include/sysemu/kvm.h
  3. 1 3
      target/i386/cpu.c
  4. 0 2
      target/i386/cpu.h
  5. 2 2
      target/i386/kvm.c
  6. 0 6
      target/i386/kvm_i386.h

+ 1 - 1
hw/i386/kvm/clock.c

@@ -26,7 +26,7 @@
 #include "qapi/error.h"
 #include "qapi/error.h"
 
 
 #include <linux/kvm.h>
 #include <linux/kvm.h>
-#include <linux/kvm_para.h>
+#include "standard-headers/asm-x86/kvm_para.h"
 
 
 #define TYPE_KVM_CLOCK "kvmclock"
 #define TYPE_KVM_CLOCK "kvmclock"
 #define KVM_CLOCK(obj) OBJECT_CHECK(KVMClockState, (obj), TYPE_KVM_CLOCK)
 #define KVM_CLOCK(obj) OBJECT_CHECK(KVMClockState, (obj), TYPE_KVM_CLOCK)

+ 0 - 1
include/sysemu/kvm.h

@@ -22,7 +22,6 @@
 #ifdef NEED_CPU_H
 #ifdef NEED_CPU_H
 # ifdef CONFIG_KVM
 # ifdef CONFIG_KVM
 #  include <linux/kvm.h>
 #  include <linux/kvm.h>
-#  include <linux/kvm_para.h>
 #  define CONFIG_KVM_IS_POSSIBLE
 #  define CONFIG_KVM_IS_POSSIBLE
 # endif
 # endif
 #else
 #else

+ 1 - 3
target/i386/cpu.c

@@ -40,9 +40,7 @@
 #include "qom/qom-qobject.h"
 #include "qom/qom-qobject.h"
 #include "sysemu/arch_init.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 "sysemu/sysemu.h"
 #include "hw/qdev-properties.h"
 #include "hw/qdev-properties.h"

+ 0 - 2
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     (1U << 26) /* Speculation Control */
 #define CPUID_7_0_EDX_SPEC_CTRL_SSBD  (1U << 31) /* Speculative Store Bypass Disable */
 #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_8000_0008_EBX_IBPB    (1U << 12) /* Indirect Branch Prediction Barrier */
 
 
 #define CPUID_XSAVE_XSAVEOPT   (1U << 0)
 #define CPUID_XSAVE_XSAVEOPT   (1U << 0)

+ 2 - 2
target/i386/kvm.c

@@ -18,7 +18,7 @@
 #include <sys/utsname.h>
 #include <sys/utsname.h>
 
 
 #include <linux/kvm.h>
 #include <linux/kvm.h>
-#include <linux/kvm_para.h>
+#include "standard-headers/asm-x86/kvm_para.h"
 
 
 #include "qemu-common.h"
 #include "qemu-common.h"
 #include "cpu.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);
             ret &= ~(1U << KVM_FEATURE_PV_UNHALT);
         }
         }
     } else if (function == KVM_CPUID_FEATURES && reg == R_EDX) {
     } else if (function == KVM_CPUID_FEATURES && reg == R_EDX) {
-        ret |= KVM_HINTS_DEDICATED;
+        ret |= 1U << KVM_HINTS_DEDICATED;
         found = 1;
         found = 1;
     }
     }
 
 

+ 0 - 6
target/i386/kvm_i386.h

@@ -30,12 +30,6 @@
 #define kvm_pic_in_kernel()      0
 #define kvm_pic_in_kernel()      0
 #define kvm_ioapic_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 */
 #endif  /* CONFIG_KVM */
 
 
 bool kvm_allows_irq0_override(void);
 bool kvm_allows_irq0_override(void);