Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da1bf373 authored by Jim Mattson's avatar Jim Mattson Committed by Greg Kroah-Hartman
Browse files

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: 24c82e57 ("KVM: Sanitize cpuid")
Signed-off-by: default avatarJim Mattson <jmattson@google.com>
Message-Id: <20220929225203.2234702-4-jmattson@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2fa24d02
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -791,6 +791,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, 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;
	/*Add support for Centaur's CPUID instruction*/