From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1828C433FE for ; Mon, 7 Nov 2022 16:48:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232616AbiKGQsh (ORCPT ); Mon, 7 Nov 2022 11:48:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232575AbiKGQsc (ORCPT ); Mon, 7 Nov 2022 11:48:32 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED72CBDD for ; Mon, 7 Nov 2022 08:48:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B5A0611BD for ; Mon, 7 Nov 2022 16:48:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CBD3C433D7; Mon, 7 Nov 2022 16:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667839711; bh=vebeXtMOerqT0IvUFtldK1CpEcOm1zeSX8w707K1OKQ=; h=Subject:To:Cc:From:Date:From; b=zJnLIYDqNKamZTwk4lOVFKCPQwM1sh59Uxj3X2d06hzcM3ntXNDTyNS2MxG83qOcc qbQjmoMErIDtCb9mT6V/kdAqzEYyLafFllbbHhtNPUq3ZbXf31ncMRboPB7LEcm0c5 rOfWDjo9VxE0lOS7+RkP8vCw6aJ7EJzM9Sx075Gw= Subject: FAILED: patch "[PATCH] KVM: x86: Mask off reserved bits in CPUID.8000001FH" failed to apply to 5.10-stable tree To: jmattson@google.com, pbonzini@redhat.com Cc: From: Date: Mon, 07 Nov 2022 17:48:23 +0100 Message-ID: <1667839703108195@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Possible dependencies: 86c4f0d547f6 ("KVM: x86: Mask off reserved bits in CPUID.8000001FH") e39f00f60ebd ("KVM: x86: Use kernel's x86_phys_bits to handle reduced MAXPHYADDR") 4bf48e3c0aaf ("KVM: x86: Use guest MAXPHYADDR from CPUID.0x8000_0008 iff TDP is enabled") d9db0fd6c5c9 ("KVM: SEV: Mask CPUID[0x8000001F].eax according to supported features") 013380782d4d ("KVM: x86: Move reverse CPUID helpers to separate header file") 01de8682b32d ("KVM: x86: Add reverse-CPUID lookup support for scattered SGX features") 4e66c0cb79b7 ("KVM: x86: Add support for reverse CPUID lookup of scattered features") e42033342293 ("KVM: x86: Advertise INVPCID by default") 916391a2d1dc ("KVM: SVM: Add support for SEV-ES capability in KVM") 9d4747d02376 ("KVM: SVM: Remove the call to sev_platform_status() during setup") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 86c4f0d547f6460d0426ebb3ba0614f1134b8cda Mon Sep 17 00:00:00 2001 From: Jim Mattson Date: Thu, 29 Sep 2022 15:52:03 -0700 Subject: [PATCH] KVM: x86: Mask off reserved bits in CPUID.8000001FH KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM actually supports. CPUID.8000001FH:EBX[31:16] are reserved bits and should be masked off. Fixes: 8765d75329a3 ("KVM: X86: Extend CPUID range to include new leaf") Signed-off-by: Jim Mattson Message-Id: <20220929225203.2234702-6-jmattson@google.com> Cc: stable@vger.kernel.org [Clear NumVMPL too. - Paolo] Signed-off-by: Paolo Bonzini diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index a0292ba650df..0810e93cbedc 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -1199,7 +1199,8 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) entry->eax = entry->ebx = entry->ecx = entry->edx = 0; } else { cpuid_entry_override(entry, CPUID_8000_001F_EAX); - + /* Clear NumVMPL since KVM does not support VMPL. */ + entry->ebx &= ~GENMASK(31, 12); /* * Enumerate '0' for "PA bits reduction", the adjusted * MAXPHYADDR is enumerated directly (see 0x80000008).