[libvirt] [PATCH 4/5] cpu: Drop unused KVM features

Jiri Denemark jdenemar at redhat.com
Fri Jul 26 15:30:55 UTC 2019


Most of the internally defined KVM CPUID features are not actually used
by libvirt. The QEMU driver may enable or disable them on the command
line, but we don't check for the associated CPU properties or CPUID
bits. They would be useless with QEMU 4.1 anyway since their names were
only remotely similar to the actual feature names.

Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
---
 src/cpu/cpu_x86.c      | 24 ------------------------
 src/cpu/cpu_x86_data.h |  8 --------
 2 files changed, 32 deletions(-)

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index f8a51dedf6..387c365512 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -73,24 +73,8 @@ struct _virCPUx86Feature {
         } \
     }
 
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE,
-                0x40000001, 0x00000001);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_NOP_IO_DELAY,
-                0x40000001, 0x00000002);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_MMU_OP,
-                0x40000001, 0x00000004);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE2,
-                0x40000001, 0x00000008);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_ASYNC_PF,
-                0x40000001, 0x00000010);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_STEAL_TIME,
-                0x40000001, 0x00000020);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_EOI,
-                0x40000001, 0x00000040);
 KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_UNHALT,
                 0x40000001, 0x00000080);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT,
-                0x40000001, 0x01000000);
 
 KVM_FEATURE_DEF(VIR_CPU_x86_HV_RUNTIME,
                 0x40000003, 0x00000001);
@@ -121,15 +105,7 @@ KVM_FEATURE_DEF(VIR_CPU_x86_HV_EVMCS,
 
 static virCPUx86Feature x86_kvm_features[] =
 {
-    KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE),
-    KVM_FEATURE(VIR_CPU_x86_KVM_NOP_IO_DELAY),
-    KVM_FEATURE(VIR_CPU_x86_KVM_MMU_OP),
-    KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE2),
-    KVM_FEATURE(VIR_CPU_x86_KVM_ASYNC_PF),
-    KVM_FEATURE(VIR_CPU_x86_KVM_STEAL_TIME),
-    KVM_FEATURE(VIR_CPU_x86_KVM_PV_EOI),
     KVM_FEATURE(VIR_CPU_x86_KVM_PV_UNHALT),
-    KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT),
     KVM_FEATURE(VIR_CPU_x86_HV_RUNTIME),
     KVM_FEATURE(VIR_CPU_x86_HV_SYNIC),
     KVM_FEATURE(VIR_CPU_x86_HV_STIMER),
diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h
index 85aaab709c..2607dd96b1 100644
--- a/src/cpu/cpu_x86_data.h
+++ b/src/cpu/cpu_x86_data.h
@@ -43,15 +43,7 @@ struct _virCPUx86MSR {
 #define CPUX86_KVM      0x40000000
 #define CPUX86_EXTENDED 0x80000000
 
-#define VIR_CPU_x86_KVM_CLOCKSOURCE  "__kvm_clocksource"
-#define VIR_CPU_x86_KVM_NOP_IO_DELAY "__kvm_no_io_delay"
-#define VIR_CPU_x86_KVM_MMU_OP       "__kvm_mmu_op"
-#define VIR_CPU_x86_KVM_CLOCKSOURCE2 "__kvm_clocksource2"
-#define VIR_CPU_x86_KVM_ASYNC_PF     "__kvm_async_pf"
-#define VIR_CPU_x86_KVM_STEAL_TIME   "__kvm_steal_time"
-#define VIR_CPU_x86_KVM_PV_EOI       "__kvm_pv_eoi"
 #define VIR_CPU_x86_KVM_PV_UNHALT    "__kvm_pv_unhalt"
-#define VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT "__kvm_clocksource_stable"
 
 /*
  * The following HyperV feature names suffixes must exactly match corresponding
-- 
2.22.0




More information about the libvir-list mailing list