From: Jim Mattson Date: Thu, 29 Sep 2022 22:52:01 +0000 (-0700) Subject: KVM: x86: Mask off reserved bits in CPUID.8000001AH X-Git-Tag: v5.15.79~150 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc796fd861fa05e94a98e0d0e4e00580e1c21d66;p=platform%2Fkernel%2Flinux-rpi.git KVM: x86: Mask off reserved bits in CPUID.8000001AH commit 079f6889818dd07903fb36c252532ab47ebb6d48 upstream. KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM actually supports. In the case of CPUID.8000001AH, only three bits are currently defined. The 125 reserved bits should be masked off. Fixes: 24c82e576b78 ("KVM: Sanitize cpuid") Signed-off-by: Jim Mattson Message-Id: <20220929225203.2234702-4-jmattson@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 7689397..6ca34db 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -956,6 +956,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) entry->ecx = entry->edx = 0; break; case 0x8000001a: + entry->eax &= GENMASK(2, 0); + entry->ebx = entry->ecx = entry->edx = 0; + break; case 0x8000001e: break; case 0x8000001F: