[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211227081515.2088920-6-chao.gao@intel.com>
Date: Mon, 27 Dec 2021 16:15:11 +0800
From: Chao Gao <chao.gao@...el.com>
To: kvm@...r.kernel.org, pbonzini@...hat.com, kevin.tian@...el.com,
tglx@...utronix.de
Cc: Chao Gao <chao.gao@...el.com>,
Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org
Subject: [PATCH 5/6] KVM: x86: Remove WARN_ON in kvm_arch_check_processor_compat
kvm_arch_check_processor_compat() needn't be called with interrupt
disabled, as it only reads some CRs/MSRs which won't be clobbered
by interrupt handlers or softirq.
What really needed is disabling preemption. No additional check is
added because if CONFIG_DEBUG_PREEMPT is enabled, smp_processor_id()
(right above the WARN_ON()) can help to detect any violation.
Signed-off-by: Chao Gao <chao.gao@...el.com>
---
arch/x86/kvm/x86.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index aa09c8792134..a80e3b0c11a8 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -11384,8 +11384,6 @@ int kvm_arch_check_processor_compat(void)
{
struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());
- WARN_ON(!irqs_disabled());
-
if (__cr4_reserved_bits(cpu_has, c) !=
__cr4_reserved_bits(cpu_has, &boot_cpu_data))
return -EIO;
--
2.25.1
Powered by blists - more mailing lists