From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9985E15CAE for ; Tue, 8 Nov 2022 14:15:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20BC1C433C1; Tue, 8 Nov 2022 14:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667916919; bh=uPNS/ScmtwKXSZKJHzwLxBgXVWobJzLLJ7P26XKec/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rBRHY1elV7mXqgcDWVrRN7SmjWaSKHzqLyKOloXk3mC2XQ9B/LwtNm0W5qhsk0uWr tFi9ibMO+EnFGapprq+KqXFBLtmACnUAYqBUFGW0LQ84JCh2pzjYsHpn5LbhAcLbRy 1tVjmwuH2pPH2h1+hf9nObdmb63scTAJJoLHo1Zo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jim Mattson , Paolo Bonzini Subject: [PATCH 6.0 173/197] KVM: x86: Mask off reserved bits in CPUID.80000001H Date: Tue, 8 Nov 2022 14:40:11 +0100 Message-Id: <20221108133402.794821872@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221108133354.787209461@linuxfoundation.org> References: <20221108133354.787209461@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Jim Mattson commit 0469e56a14bf8cfb80507e51b7aeec0332cdbc13 upstream. KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM actually supports. CPUID.80000001:EBX[27:16] are reserved bits and should be masked off. Fixes: 0771671749b5 ("KVM: Enhance guest cpuid management") Signed-off-by: Jim Mattson Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/cpuid.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -1117,6 +1117,7 @@ static inline int __do_cpuid_func(struct entry->eax = max(entry->eax, 0x80000021); break; case 0x80000001: + entry->ebx &= ~GENMASK(27, 16); cpuid_entry_override(entry, CPUID_8000_0001_EDX); cpuid_entry_override(entry, CPUID_8000_0001_ECX); break;