render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 3ad9cd82d4fe7e87665a0233662712725f5d3d5d Mon Sep 17 00:00:00 2001
Message-Id: <3ad9cd82d4fe7e87665a0233662712725f5d3d5d@dist-git>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Fri, 7 Feb 2020 10:41:44 +0100
Subject: [PATCH] cpu: Drop unused KVM features
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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@redhat.com>
Tested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 9e6172937f8d8f832359dd5eeb4e7c92f9defcbf)

https://bugzilla.redhat.com/show_bug.cgi?id=1794868

Conflicts:
	src/cpu/cpu_x86_data.h
            - all defines are indented as downstream lacks #pragma once

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Message-Id: <763f5d57b6cb930d9edbfbe8edbb7d5797a48150.1581064395.git.jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@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 ecf11926b4..0459a0d1c8 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -77,24 +77,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_TLBFLUSH,
 
 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 9668b13eb9..8a189f854e 100644
--- a/src/cpu/cpu_x86_data.h
+++ b/src/cpu/cpu_x86_data.h
@@ -49,15 +49,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.25.0