Skip to content

Commit 5df8ecf

Browse files
committed
x86/virt: Drop unnecessary check on extended CPUID level in cpu_has_svm()
Drop the explicit check on the extended CPUID level in cpu_has_svm(), the kernel's cached CPUID info will leave the entire SVM leaf unset if said leaf is not supported by hardware. Prior to using cached information, the check was needed to avoid false positives due to Intel's rather crazy CPUID behavior of returning the values of the maximum supported leaf if the specified leaf is unsupported. Fixes: 682a810 ("x86/kvm/svm: Simplify cpu_has_svm()") Link: https://lore.kernel.org/r/20230721201859.2307736-13-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 554856b commit 5df8ecf

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

arch/x86/include/asm/virtext.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ static inline int cpu_has_svm(const char **msg)
3939
return 0;
4040
}
4141

42-
if (boot_cpu_data.extended_cpuid_level < SVM_CPUID_FUNC) {
43-
if (msg)
44-
*msg = "can't execute cpuid_8000000a";
45-
return 0;
46-
}
47-
4842
if (!boot_cpu_has(X86_FEATURE_SVM)) {
4943
if (msg)
5044
*msg = "svm not available";

0 commit comments

Comments
 (0)