From nobody Thu Apr 9 15:44:35 2026 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 5C072481A9C; Fri, 6 Mar 2026 21:09:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831351; cv=none; b=P+zMmlqQSjgzrozaGLTePnNPsW26JFFH22CFQLcCMhewTfAocXaH2DqeOjCut0OWhEeASYF2JsJDarye+A/yEAebU09l6B4kOk9jNJ8p2slKvXk4r7XvGRVaHlDwb0VZK1FpQfE01PeHrfKYIovDPG99NNGJW4kr45+8nSEl5+E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831351; c=relaxed/simple; bh=in1bbterwp8ZETaHG9kMMOIjehLDOJ5KlUVscZMC+Xc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CTymk4WFgl+4Qt80CT/Z737MuFdA8I2/vy6Y8oHFDDe1ww6FkSyePFEQmMDW3iRGyGotPLApK2uPYDWWeYTXpcICq+tV/eRZ6r73c7bsrqZGf0YS59oIY9zlo7ek5YoWg8y48JqtfwX65JLcT7kIpvy9qxAcqTgqehDzlVdaFDg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SwOYsY6a; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SwOYsY6a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01001C2BC9E; Fri, 6 Mar 2026 21:09:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772831351; bh=in1bbterwp8ZETaHG9kMMOIjehLDOJ5KlUVscZMC+Xc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SwOYsY6aTse99kZTaCfTx7xyj2OALKnXCXCuvqOST1UxrvCtFuLce3CeH5FwTEJHd VyTypysUvVwLzZ4261I5wH8FGkSsrPlyrPIjfpOZKw24adeeOMbfStkkAOuWQwmZ98 Ve/azw6lM73mNrQZrqu+/8qsug/UhK204wWn+BRa4ny1oOZRvexSDmISliQvMvfoiu b+2tOOzUtNcwwrg/kZg7jQKfgMSPlfygCXmB3U7fCHFWNQcVQdqhzMD6OVm6nYaIbu anT1YMA3Ny4zXK9hhDHWvMVFBRJRKo0ic5cSZXdAX0fYevsBsi3FhIrC8qG8oLqLoy apKZ/sLsgWu7g== From: Yosry Ahmed To: Sean Christopherson Cc: Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: [PATCH v2 1/6] KVM: SVM: Use maxphyaddr in emulator RAX check for VMRUN/VMLOAD/VMSAVE Date: Fri, 6 Mar 2026 21:08:55 +0000 Message-ID: <20260306210900.1933788-2-yosry@kernel.org> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog In-Reply-To: <20260306210900.1933788-1-yosry@kernel.org> References: <20260306210900.1933788-1-yosry@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Architecturally, VMRUN/VMLOAD/VMSAVE should generate a #GP if the physical address in RAX is not supported. check_svme_pa() hardcodes this to checking that bits 63-48 are not set. This is incorrect on HW supporting 52 bits of physical address space, so use maxphyaddr instead. Note that the host's maxphyaddr is used, not the guest, because the emulator path for VMLOAD/VMSAVE is generally used when virtual VMLOAD/VMSAVE is enabled AND a #NPF is generated. If a #NPF is not generated, the CPU will inject a #GP based on the host's maxphyaddr. So this keeps the behavior consistent. If KVM wants to consistently inject a #GP based on the guest's maxphyaddr, it would need to disabled virtual VMLOAD/VMSAVE and intercept all VMLOAD/VMSAVE instructions to do the check. Also, emulating a smaller maxphyaddr for the guest than the host generally doesn't work well, so it's not worth handling this. Fixes: 01de8b09e606 ("KVM: SVM: Add intercept checks for SVM instructions") Signed-off-by: Yosry Ahmed --- arch/x86/kvm/emulate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 6145dac4a605a..9ea2584dda912 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3887,8 +3887,7 @@ static int check_svme_pa(struct x86_emulate_ctxt *ctx= t) { u64 rax =3D reg_read(ctxt, VCPU_REGS_RAX); =20 - /* Valid physical address? */ - if (rax & 0xffff000000000000ULL) + if (rax & rsvd_bits(kvm_host.maxphyaddr, 63)) return emulate_gp(ctxt, 0); =20 return check_svme(ctxt); --=20 2.53.0.473.g4a7958ca14-goog From nobody Thu Apr 9 15:44:35 2026 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 C0755481FA0; Fri, 6 Mar 2026 21:09:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831351; cv=none; b=XSRR5W1CslxBQfuFCBfKsuo5jLSPEl+6h6JcGnlldh7dpaGp1sw0caBbON6cjIDWInAHduFuI1ryvprF0h1HZGqsmspKyryekv0CMyiN2hAeoWRZMXmcu4eA6sx+8WTHUEkKs4KiNJUQguNk1ezh8RLd2M99n1huEWdoqGxS19s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831351; c=relaxed/simple; bh=zlFgROWLnxVwC4QoyF8FYkdqnZDZOTfxmemo5hzE2nU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M8Y3AOIkgl5T8TJkRzpUETZf3aWTV9mJvAEsRZd8ueWP/WI6Fdch0ZpGU0SeP+k1+s5Fa8+imrtEV9jlfWsHQ3R0nSYsNRAfjuMYQAkvNdtPEdk/aEQceAsp6DqDEQZeWAqjwa/9tPaLfoZf09xCG8FiG4FFdtbrtCkYiye5ymQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=msS/vTXy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="msS/vTXy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65091C4CEF7; Fri, 6 Mar 2026 21:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772831351; bh=zlFgROWLnxVwC4QoyF8FYkdqnZDZOTfxmemo5hzE2nU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=msS/vTXy4vrAatHVDXTNfTlDGkIePu0rWzonK+un3oboazCH4K0BjDCqwDG42rFgg kbRGO+Z6uwHka6urunH6r2Ofu60D7ODtGzmVRhJgqohILp43ZZU3wNBYKR4dtysufQ 5i4oGv2mVcY7kz0l5/uXo7PPdtTafg/fLlQNcquSKza24EtERq2l0WRpPtSu2iedZ/ co25pPLrJLwFX7gmEflhZi7ctL2l+jrLyqIqw13fYSVp3UErBQgH1wzDRjyt42A4p0 r9wZQeTMrh7786NS6e6Hd4SpKqUFbKFCjbHJP8XfJf3INOqsWg6zaeab8bM8dcqOqX oIShVRYo+NWng== From: Yosry Ahmed To: Sean Christopherson Cc: Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: [PATCH v2 2/6] KVM: nSVM: Simplify error handling of nested_svm_copy_vmcb12_to_cache() Date: Fri, 6 Mar 2026 21:08:56 +0000 Message-ID: <20260306210900.1933788-3-yosry@kernel.org> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog In-Reply-To: <20260306210900.1933788-1-yosry@kernel.org> References: <20260306210900.1933788-1-yosry@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" nested_svm_vmrun() currently stores the return value of nested_svm_copy_vmcb12_to_cache() in a local variable 'err', separate from the generally used 'ret' variable. This is done to have a single call to kvm_skip_emulated_instruction(), such that we can store the return value of kvm_skip_emulated_instruction() in 'ret', and then re-check the return value of nested_svm_copy_vmcb12_to_cache() in 'err'. The code is unnecessarily confusing. Instead, call kvm_skip_emulated_instruction() in the failure path of nested_svm_copy_vmcb12_to_cache() if the return value is not -EFAULT, and drop 'err'. Suggested-by: Sean Christopherson Signed-off-by: Yosry Ahmed --- arch/x86/kvm/svm/nested.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index b191c6cab57db..6d4c053778b21 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1079,7 +1079,7 @@ static int nested_svm_copy_vmcb12_to_cache(struct kvm= _vcpu *vcpu, u64 vmcb12_gpa int nested_svm_vmrun(struct kvm_vcpu *vcpu) { struct vcpu_svm *svm =3D to_svm(vcpu); - int ret, err; + int ret; u64 vmcb12_gpa; struct vmcb *vmcb01 =3D svm->vmcb01.ptr; =20 @@ -1104,19 +1104,20 @@ int nested_svm_vmrun(struct kvm_vcpu *vcpu) return -EINVAL; =20 vmcb12_gpa =3D svm->vmcb->save.rax; - err =3D nested_svm_copy_vmcb12_to_cache(vcpu, vmcb12_gpa); - if (err =3D=3D -EFAULT) { + ret =3D nested_svm_copy_vmcb12_to_cache(vcpu, vmcb12_gpa); + + /* + * Advance RIP if #GP or #UD are not injected, but otherwise + * stop if copying and checking vmcb12 failed. + */ + if (ret =3D=3D -EFAULT) { kvm_inject_gp(vcpu, 0); return 1; + } else if (ret) { + return kvm_skip_emulated_instruction(vcpu); } =20 - /* - * Advance RIP if #GP or #UD are not injected, but otherwise stop if - * copying and checking vmcb12 failed. - */ ret =3D kvm_skip_emulated_instruction(vcpu); - if (err) - return ret; =20 /* * Since vmcb01 is not in use, we can use it to store some of the L1 --=20 2.53.0.473.g4a7958ca14-goog From nobody Thu Apr 9 15:44:35 2026 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 75090481FCC; Fri, 6 Mar 2026 21:09:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831352; cv=none; b=fZDh7FXGvIIvtfohjhdmSy2klFI8LgeDuO0A51CQ+tOTtPjGD16v8EphvbxJgAMb1ktApwUDQf0KB20NR9fpgU69RJynG5POWfVlA14qxdT6VQI9hQ0kQCIH9t2H39xLRysJYUJK1TtBSyrGoWWCaLJ+Yt7URHztzf3qwUngqKU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831352; c=relaxed/simple; bh=CzgGTWWUcPgcLTG0JmCUypOX1KdDxGsKqlELDtaWJZE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FlPFVPdvFFB+rXwMvJ1PQoKDjjo5ok7bUIdLpTjoJNZTQkcivgHUoW8iHhoYujuVbQHdZKycDQ7fmaPRCnhVXEyuaKztp8x2iP2NcnOi7+MSFOoKi1Fh/Jme8zofJFegjG1f+AczDr/HJw3qelAq82gJjShwJvNQiKP3gMmptc0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u51syaj+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="u51syaj+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCA92C2BCB2; Fri, 6 Mar 2026 21:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772831352; bh=CzgGTWWUcPgcLTG0JmCUypOX1KdDxGsKqlELDtaWJZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u51syaj+rCMA2ab2LQvD0LoLleEA7d+uWhQm8lWFWiuT4c+KvEbHszr7wJ87l3tri mnjZ6IXMe4D2BbbBkEU47qCQwg7RJTp+nrBqZGLkRTtcs/+GAOEVU+lqFbFiHjZ/L/ 43YPr7c8GN2kzla8SgLfUa6f9Dipwffisc9PTXt+6gETaIapfW6Z9eDP/qTqdlKBjH qSi7vLaZCCl71kWAi6c5aHD3KoXOH40qDmKDQF4DsPsr/iYiW6BCyB9LFnyabt3nRP q4jPsBVaaowuiX32Rowwb5hzDtkwCuVZNS66rArDAvpei/p8cq37Kn57h2Hovmm+eN +ZYfrXj47jhwQ== From: Yosry Ahmed To: Sean Christopherson Cc: Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: [PATCH v2 3/6] KVM: SVM: Treat mapping failures equally in VMLOAD/VMSAVE emulation Date: Fri, 6 Mar 2026 21:08:57 +0000 Message-ID: <20260306210900.1933788-4-yosry@kernel.org> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog In-Reply-To: <20260306210900.1933788-1-yosry@kernel.org> References: <20260306210900.1933788-1-yosry@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently, a #GP is only injected if kvm_vcpu_map() fails with -EINVAL. But it could also fail with -EFAULT if creating a host mapping failed. Inject a #GP in all cases, no reason to treat failure modes differently. Similar to commit 01ddcdc55e09 ("KVM: nSVM: Always inject a #GP if mapping VMCB12 fails on nested VMRUN"), treat all failures equally. Fixes: 8c5fbf1a7231 ("KVM/nSVM: Use the new mapping API for mapping guest m= emory") Signed-off-by: Yosry Ahmed --- arch/x86/kvm/svm/svm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 3407deac90bd6..7ec0b0e8945fe 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -2190,10 +2190,8 @@ static int vmload_vmsave_interception(struct kvm_vcp= u *vcpu, bool vmload) if (nested_svm_check_permissions(vcpu)) return 1; =20 - ret =3D kvm_vcpu_map(vcpu, gpa_to_gfn(svm->vmcb->save.rax), &map); - if (ret) { - if (ret =3D=3D -EINVAL) - kvm_inject_gp(vcpu, 0); + if (kvm_vcpu_map(vcpu, gpa_to_gfn(svm->vmcb->save.rax), &map)) { + kvm_inject_gp(vcpu, 0); return 1; } =20 --=20 2.53.0.473.g4a7958ca14-goog From nobody Thu Apr 9 15:44:35 2026 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 AEDC248A2AE; Fri, 6 Mar 2026 21:09:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831352; cv=none; b=lS17pmHvjcE0uBOgAL3V+m+IYfT0a6xtSRBo5AnLcJWAGvhOTONWjckmoNuRRckIATf8bbNguyPKHZ5+//A8NTvYX+BE/uR/ZNFQBTvsTPi4/eXMOFYTSLrb6129NVIsgJQ0/Oj6tVw0wspPU+amxjvRdkC77sRiJmnIe/azQmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831352; c=relaxed/simple; bh=W1GDvhBjURiDIQSdO6sAf7i/CnmSx/BtLxKrERUXc7Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TZv/bKwqbrx7gVAb7qBYKSa4h/48YPf9u43IPoVFF6VqT0OZO0ZMsS72HBp+jyeg7R2bRlDe8XuWbnavgbgdbvaVihpMZuDMxOuLDdBp3TJ6UWU7YKJpSZiGheJvW659K8y9Gcvg63OqvwHFdXw1NObyww6Qn781b+FKyTbVKUM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dQt1nSsX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dQt1nSsX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D10DC2BC9E; Fri, 6 Mar 2026 21:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772831352; bh=W1GDvhBjURiDIQSdO6sAf7i/CnmSx/BtLxKrERUXc7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dQt1nSsXr0JyiwaryAGSWx9p2npmCf/1gWOYpifa/dfwWIi8HaEQytM6FPnbbYGyq sQ52Y4PTgCAyaLWnkR2lu9ubVvsk5MspUqz+2BKvvov8/GgI+zq4OUS8axNds1iD5P 0gQVKmFSFtj/3s44rHf8i8J2HChVP3TMCcuR8LClDsTaAQ6wMgi4jJoniUEkMfgCq4 1VL9H/Ok0lfv9dJOU0+WGMIPFFOi7/4VjvhO/q8aWPJQW7FD4pIkFGejforGK1DZlI PTFBuAwPGqreOSd7qiZC8/7B2PWemxJVo8x4Tn8ii40B3BEJ2bumBMD1IfU67nS4Wh PKW7lXRZL6BsA== From: Yosry Ahmed To: Sean Christopherson Cc: Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: [PATCH v2 4/6] KVM: nSVM: Fail emulation of VMRUN/VMLOAD/VMSAVE if mapping vmcb12 fails Date: Fri, 6 Mar 2026 21:08:58 +0000 Message-ID: <20260306210900.1933788-5-yosry@kernel.org> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog In-Reply-To: <20260306210900.1933788-1-yosry@kernel.org> References: <20260306210900.1933788-1-yosry@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" KVM currently injects a #GP if mapping vmcb12 fails when emulating VMRUN/VMLOAD/VMSAVE. This is not architectural behavior, as #GP should only be injected if the physical address is not supported or not aligned (which hardware will do before the VMRUN intercept is checked). Instead, handle it as an emulation failure, similar to how nVMX handles failures to read/write guest memory in several emulation paths. When virtual VMLOAD/VMSAVE is enabled, if vmcb12's GPA is not mapped in the NPTs a VMEXIT(#NPF) will be generated, and KVM will install an MMIO SPTE and emulate the instruction if there is no corresponding memslot. x86_emulate_insn() will return EMULATION_FAILED as VMLOAD/VMSAVE are not handled as part of the twobyte_insn cases. Even though this will also result in an emulation failure, it will only result in a straight return to userspace if KVM_CAP_EXIT_ON_EMULATION_FAILURE is set. Otherwise, it would inject #UD and only exit to userspace if not in guest mode. So the behavior is slightly different if virtual VMLOAD/VMSAVE is enabled. Fixes: 3d6368ef580a ("KVM: SVM: Add VMRUN handler") Reported-by: Jim Mattson Signed-off-by: Yosry Ahmed --- arch/x86/kvm/svm/nested.c | 13 ++++++------- arch/x86/kvm/svm/svm.c | 6 ++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 6d4c053778b21..089cdcfd60340 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1107,15 +1107,14 @@ int nested_svm_vmrun(struct kvm_vcpu *vcpu) ret =3D nested_svm_copy_vmcb12_to_cache(vcpu, vmcb12_gpa); =20 /* - * Advance RIP if #GP or #UD are not injected, but otherwise - * stop if copying and checking vmcb12 failed. + * Advance RIP if instruction emulation completes, whether it's a + * successful VMRUN or a failed one with #VMEXIT(INVALID), but not if + * #GP/#UD is injected, or if reading vmcb12 fails. */ - if (ret =3D=3D -EFAULT) { - kvm_inject_gp(vcpu, 0); - return 1; - } else if (ret) { + if (ret =3D=3D -EFAULT) + return kvm_handle_memory_failure(vcpu, X86EMUL_IO_NEEDED, NULL); + else if (ret) return kvm_skip_emulated_instruction(vcpu); - } =20 ret =3D kvm_skip_emulated_instruction(vcpu); =20 diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 7ec0b0e8945fe..35433bd345eff 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -2190,10 +2190,8 @@ static int vmload_vmsave_interception(struct kvm_vcp= u *vcpu, bool vmload) if (nested_svm_check_permissions(vcpu)) return 1; =20 - if (kvm_vcpu_map(vcpu, gpa_to_gfn(svm->vmcb->save.rax), &map)) { - kvm_inject_gp(vcpu, 0); - return 1; - } + if (kvm_vcpu_map(vcpu, gpa_to_gfn(svm->vmcb->save.rax), &map)) + return kvm_handle_memory_failure(vcpu, X86EMUL_IO_NEEDED, NULL); =20 vmcb12 =3D map.hva; =20 --=20 2.53.0.473.g4a7958ca14-goog From nobody Thu Apr 9 15:44:35 2026 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 244D448AE20; Fri, 6 Mar 2026 21:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831353; cv=none; b=rAUvYc8wkPm4lIxKmm1237VXQ5+hxW1sbeYvNG7qPGfSJ+NAtl+P0h+Ieo93GCwWA5nET2holfPV++qQp4qVNgR1ZGQKH19GFFu7ruQEnKBUjclsxH09L4omkCkdRXzNA9KKwWi2G1f5xBm+T1DpIj07Pbv81O043nwthJH3s0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831353; c=relaxed/simple; bh=Av1cyNcaTB4l8UeQo3DpVXvBAlWkTHHvygscY34OLk0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AG41CA1W86Y+1L0XUhQg4IakgQXahOxBelw5gPNClzKR+pVb4zPB0aSZ15F1TYiqvQktSyIMnue+CWmGlwPj8PwJ3yLO3UiThd/4lowIJNszLBLd6TDxX4UfGKitt7U/XFUJ+IL40GxupMTiD9zHVvIbzCN3TePA7Sy8txBKMHs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mDn2NpkC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mDn2NpkC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1434C2BCB1; Fri, 6 Mar 2026 21:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772831352; bh=Av1cyNcaTB4l8UeQo3DpVXvBAlWkTHHvygscY34OLk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mDn2NpkCUND+DWxA5/u3AR6+RqtDHuJDdAteMk+AiVpeVsplIvsnZhTxAIg8qXc8j 4SyDlSNUpNkCqVgRDJbwSoTi03eEr/rnmv4GG8DmNvAoNihJNpH9aLKK3Ji+iNRrrB QYEvOmmK3Uz2kc6Y/LO7m5CZA/kSf9inIACk89IB0qxNRAuiNK9IyQNm62U5AAyfWI HVPQIJCA7FhfpV7tPdlxNYFZntaJXHNOZAeDBqJABTJFF7Zh/+/R9IkBbKWMO8mAo9 TH/w2HYJUk6brY/yx9MX5mBdG8EcB6xrTQHjcbI97US/sCWQXbGQxm5fP0y4IkVSab F1ZTyymg2w7tQ== From: Yosry Ahmed To: Sean Christopherson Cc: Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: [PATCH v2 5/6] KVM: selftests: Rework svm_nested_invalid_vmcb12_gpa Date: Fri, 6 Mar 2026 21:08:59 +0000 Message-ID: <20260306210900.1933788-6-yosry@kernel.org> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog In-Reply-To: <20260306210900.1933788-1-yosry@kernel.org> References: <20260306210900.1933788-1-yosry@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The test currently allegedly makes sure that VMRUN causes a #GP in vmcb12 GPA is valid but unmappable. However, it calls run_guest() with an the test vmcb12 GPA, and the #GP is produced from VMLOAD, not VMRUN. Additionally, the underlying just changed to match architectural behavior, and all of VMRUN/VMLOAD/VMSAVE fail emulation if vmcb12 cannot be mapped. The CPU still injects a #GP if the vmcb12 GPA exceeds maxphyaddr. Rework the test such to use the KVM_ONE_VCPU_TEST[_SUITE] harness, and test all of VMRUN/VMLOAD/VMSAVE with both an invalid GPA (-1ULL) causing a #GP, and a valid but unmappable GPA causing emulation failure. Execute the instructions directly from L1 instead of run_guest() to make sure the #GP or emulation failure is produced by the right instruction. Leave the #VMEXIT with unmappable GPA test case as-is, but wrap it with a test harness as well. Opportunisitically drop gp_triggered, as the test already checks that a #GP was injected through a SYNC, and add an assertion that the max legal GPA is in fact not mapped by userspace (i.e. KVM cannot map it). Signed-off-by: Yosry Ahmed --- .../testing/selftests/kvm/include/kvm_util.h | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 6 + .../kvm/x86/svm_nested_invalid_vmcb12_gpa.c | 153 +++++++++++++----- 3 files changed, 124 insertions(+), 36 deletions(-) diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing= /selftests/kvm/include/kvm_util.h index 8b39cb919f4fc..61fb2cb7df288 100644 --- a/tools/testing/selftests/kvm/include/kvm_util.h +++ b/tools/testing/selftests/kvm/include/kvm_util.h @@ -734,6 +734,7 @@ void *addr_gpa2hva(struct kvm_vm *vm, vm_paddr_t gpa); void *addr_gva2hva(struct kvm_vm *vm, vm_vaddr_t gva); vm_paddr_t addr_hva2gpa(struct kvm_vm *vm, void *hva); void *addr_gpa2alias(struct kvm_vm *vm, vm_paddr_t gpa); +bool addr_gpa_has_hva(struct kvm_vm *vm, vm_paddr_t gpa); =20 #ifndef vcpu_arch_put_guest #define vcpu_arch_put_guest(mem, val) do { (mem) =3D (val); } while (0) diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/sel= ftests/kvm/lib/kvm_util.c index 1959bf556e88e..9cf68a558c08b 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -1710,6 +1710,12 @@ void *addr_gpa2alias(struct kvm_vm *vm, vm_paddr_t g= pa) return (void *) ((uintptr_t) region->host_alias + offset); } =20 +bool addr_gpa_has_hva(struct kvm_vm *vm, vm_paddr_t gpa) +{ + gpa =3D vm_untag_gpa(vm, gpa); + return !!userspace_mem_region_find(vm, gpa, gpa); +} + /* Create an interrupt controller chip for the specified VM. */ void vm_create_irqchip(struct kvm_vm *vm) { diff --git a/tools/testing/selftests/kvm/x86/svm_nested_invalid_vmcb12_gpa.= c b/tools/testing/selftests/kvm/x86/svm_nested_invalid_vmcb12_gpa.c index c6d5f712120d1..3eaee8ad90211 100644 --- a/tools/testing/selftests/kvm/x86/svm_nested_invalid_vmcb12_gpa.c +++ b/tools/testing/selftests/kvm/x86/svm_nested_invalid_vmcb12_gpa.c @@ -6,6 +6,8 @@ #include "vmx.h" #include "svm_util.h" #include "kselftest.h" +#include "kvm_test_harness.h" +#include "test_util.h" =20 =20 #define L2_GUEST_STACK_SIZE 64 @@ -13,86 +15,165 @@ #define SYNC_GP 101 #define SYNC_L2_STARTED 102 =20 -u64 valid_vmcb12_gpa; -int gp_triggered; +static unsigned long l2_guest_stack[L2_GUEST_STACK_SIZE]; =20 static void guest_gp_handler(struct ex_regs *regs) { - GUEST_ASSERT(!gp_triggered); GUEST_SYNC(SYNC_GP); - gp_triggered =3D 1; - regs->rax =3D valid_vmcb12_gpa; } =20 -static void l2_guest_code(void) +static void l2_code(void) { GUEST_SYNC(SYNC_L2_STARTED); vmcall(); } =20 -static void l1_guest_code(struct svm_test_data *svm, u64 invalid_vmcb12_gp= a) +static void l1_vmrun(struct svm_test_data *svm, u64 gpa) { - unsigned long l2_guest_stack[L2_GUEST_STACK_SIZE]; + generic_svm_setup(svm, l2_code, &l2_guest_stack[L2_GUEST_STACK_SIZE]); =20 - generic_svm_setup(svm, l2_guest_code, - &l2_guest_stack[L2_GUEST_STACK_SIZE]); + asm volatile ("vmrun %[gpa]" : : [gpa] "a" (gpa) : "memory"); +} + +static void l1_vmload(struct svm_test_data *svm, u64 gpa) +{ + generic_svm_setup(svm, l2_code, &l2_guest_stack[L2_GUEST_STACK_SIZE]); + + asm volatile ("vmload %[gpa]" : : [gpa] "a" (gpa) : "memory"); +} =20 - valid_vmcb12_gpa =3D svm->vmcb_gpa; +static void l1_vmsave(struct svm_test_data *svm, u64 gpa) +{ + generic_svm_setup(svm, l2_code, &l2_guest_stack[L2_GUEST_STACK_SIZE]); =20 - run_guest(svm->vmcb, invalid_vmcb12_gpa); /* #GP */ + asm volatile ("vmsave %[gpa]" : : [gpa] "a" (gpa) : "memory"); +} =20 - /* GP handler should jump here */ +static void l1_vmexit(struct svm_test_data *svm, u64 gpa) +{ + generic_svm_setup(svm, l2_code, &l2_guest_stack[L2_GUEST_STACK_SIZE]); + + run_guest(svm->vmcb, svm->vmcb_gpa); GUEST_ASSERT(svm->vmcb->control.exit_code =3D=3D SVM_EXIT_VMMCALL); GUEST_DONE(); } =20 -int main(int argc, char *argv[]) +/* + * Find the max legal GPA that is not backed by a memslot (i.e. cannot be = mapped + * by KVM). + */ +static u64 unmappable_gpa(struct kvm_vcpu *vcpu) { - struct kvm_x86_state *state; - vm_vaddr_t nested_gva =3D 0; - struct kvm_vcpu *vcpu; uint32_t maxphyaddr; u64 max_legal_gpa; - struct kvm_vm *vm; - struct ucall uc; - - TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_SVM)); - - vm =3D vm_create_with_one_vcpu(&vcpu, l1_guest_code); - vm_install_exception_handler(vcpu->vm, GP_VECTOR, guest_gp_handler); =20 - /* - * Find the max legal GPA that is not backed by a memslot (i.e. cannot - * be mapped by KVM). - */ maxphyaddr =3D kvm_cpuid_property(vcpu->cpuid, X86_PROPERTY_MAX_PHY_ADDR); max_legal_gpa =3D BIT_ULL(maxphyaddr) - PAGE_SIZE; - vcpu_alloc_svm(vm, &nested_gva); - vcpu_args_set(vcpu, 2, nested_gva, max_legal_gpa); + TEST_ASSERT(!addr_gpa_has_hva(vcpu->vm, max_legal_gpa), + "Expected max_legal_gpa to not be mapped by userspace"); + + return max_legal_gpa; +} + +static void test_invalid_vmcb12(struct kvm_vcpu *vcpu) +{ + vm_vaddr_t nested_gva =3D 0; + struct ucall uc; + =20 - /* VMRUN with max_legal_gpa, KVM injects a #GP */ + vm_install_exception_handler(vcpu->vm, GP_VECTOR, guest_gp_handler); + vcpu_alloc_svm(vcpu->vm, &nested_gva); + vcpu_args_set(vcpu, 2, nested_gva, -1ULL); vcpu_run(vcpu); + TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO); TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC); TEST_ASSERT_EQ(uc.args[1], SYNC_GP); +} + +static void test_unmappable_vmcb12(struct kvm_vcpu *vcpu) +{ + vm_vaddr_t nested_gva =3D 0; + + vcpu_alloc_svm(vcpu->vm, &nested_gva); + vcpu_args_set(vcpu, 2, nested_gva, unmappable_gpa(vcpu)); + vcpu_run(vcpu); + + TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_INTERNAL_ERROR); + TEST_ASSERT_EQ(vcpu->run->emulation_failure.suberror, KVM_INTERNAL_ERROR_= EMULATION); +} + +static void test_unmappable_vmcb12_vmexit(struct kvm_vcpu *vcpu) +{ + struct kvm_x86_state *state; + vm_vaddr_t nested_gva =3D 0; + struct ucall uc; =20 /* - * Enter L2 (with a legit vmcb12 GPA), then overwrite vmcb12 GPA with - * max_legal_gpa. KVM will fail to map vmcb12 on nested VM-Exit and + * Enter L2 (with a legit vmcb12 GPA), then overwrite vmcb12 GPA with an + * unmappable GPA. KVM will fail to map vmcb12 on nested VM-Exit and * cause a shutdown. */ + vcpu_alloc_svm(vcpu->vm, &nested_gva); + vcpu_args_set(vcpu, 2, nested_gva, unmappable_gpa(vcpu)); vcpu_run(vcpu); TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO); TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC); TEST_ASSERT_EQ(uc.args[1], SYNC_L2_STARTED); =20 state =3D vcpu_save_state(vcpu); - state->nested.hdr.svm.vmcb_pa =3D max_legal_gpa; + state->nested.hdr.svm.vmcb_pa =3D unmappable_gpa(vcpu); vcpu_load_state(vcpu, state); vcpu_run(vcpu); TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_SHUTDOWN); =20 kvm_x86_state_cleanup(state); - kvm_vm_free(vm); - return 0; +} + +KVM_ONE_VCPU_TEST_SUITE(vmcb12_gpa); + +KVM_ONE_VCPU_TEST(vmcb12_gpa, vmrun_invalid, l1_vmrun) +{ + test_invalid_vmcb12(vcpu); +} + +KVM_ONE_VCPU_TEST(vmcb12_gpa, vmload_invalid, l1_vmload) +{ + test_invalid_vmcb12(vcpu); +} + +KVM_ONE_VCPU_TEST(vmcb12_gpa, vmsave_invalid, l1_vmsave) +{ + test_invalid_vmcb12(vcpu); +} + +KVM_ONE_VCPU_TEST(vmcb12_gpa, vmrun_unmappable, l1_vmrun) +{ + test_unmappable_vmcb12(vcpu); +} + +KVM_ONE_VCPU_TEST(vmcb12_gpa, vmload_unmappable, l1_vmload) +{ + test_unmappable_vmcb12(vcpu); +} + +KVM_ONE_VCPU_TEST(vmcb12_gpa, vmsave_unmappable, l1_vmsave) +{ + test_unmappable_vmcb12(vcpu); +} + +/* + * Invalid vmcb12_gpa cannot be test for #VMEXIT as KVM_SET_NESTED_STATE w= ill + * reject it. + */ +KVM_ONE_VCPU_TEST(vmcb12_gpa, vmexit_unmappable, l1_vmexit) +{ + test_unmappable_vmcb12_vmexit(vcpu); +} + +int main(int argc, char *argv[]) +{ + TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_SVM)); + + return test_harness_run(argc, argv); } --=20 2.53.0.473.g4a7958ca14-goog From nobody Thu Apr 9 15:44:35 2026 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 74D5548B373; Fri, 6 Mar 2026 21:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831353; cv=none; b=kYuC6v+tKWQ5TaD6AbWYJ2Nxcl5gzWlKeyy5g/kbRaQupIc+SOD/af+owgnIJU5PS9GxCt59XSSCzth7D5MEVI/NDX8QkvzNhP41Ar28Px/FuGMk5cDHBfuSUPLwgSCFMhmZRykQCtasNm7eWxpTqrapodo4Z1QcgfgR8km6KDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772831353; c=relaxed/simple; bh=PQv0YwZqQyXkAMWT1d1pHmZWI0WGoRIBaeSq8Yg083I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SmrGBhOcgq+FDH4cIhzJBMB5zJYi2OEBpRtH+J1P0aHoOx/4ICzGTuGBKq49brW6yaxk+VIFJ9rxhqPGtoM/Iu0Ft9nt/ttWbOAlMDj1uXt12Odb1vD+FHY3V+BhgDf52mYJgHVtRyAjitc9iZf0VXeYrgnAxoYjbmr7VxBz7DA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rxhsvnsj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rxhsvnsj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11C6DC19425; Fri, 6 Mar 2026 21:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772831353; bh=PQv0YwZqQyXkAMWT1d1pHmZWI0WGoRIBaeSq8Yg083I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rxhsvnsjaqg33dt6rqlGrxnbtjjA4ebttt8pEYpK8RzwwjCe13X+u12pN7Ay9d7J0 bO7dHhHtDIrvUibi/mx/6Hn+OGDaG/AkhtGVceDkLyhJH6e/nnuRVDy6+SqpeOBllu gZYuOwiNnOsr+7BbaT781amjAGmS+YyCSXSSFr9AIGSJFk1aCGd0+vyBI2xniMJDCA J2Yn8LDjFMxANyZvSqo0Der7uf4Yj8JnrEOf5DgPcHIO26+uBsE5aq851AEfgAPajr 5D2y8U7iZGtPpZ6bCcqAs42fXfwCoV8THtJ89eCYgbrsu98fSGQ1er3h5GXDu1dfRP Z4mMb9hmnnJAQ== From: Yosry Ahmed To: Sean Christopherson Cc: Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: [PATCH v2 6/6] KVM: selftests: Drop 'invalid' from svm_nested_invalid_vmcb12_gpa's name Date: Fri, 6 Mar 2026 21:09:00 +0000 Message-ID: <20260306210900.1933788-7-yosry@kernel.org> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog In-Reply-To: <20260306210900.1933788-1-yosry@kernel.org> References: <20260306210900.1933788-1-yosry@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The test checks both invalid GPAs as well as unmappable GPAs, so drop 'invalid' from its name. Signed-off-by: Yosry Ahmed --- tools/testing/selftests/kvm/Makefile.kvm | 2 +- ...{svm_nested_invalid_vmcb12_gpa.c =3D> svm_nested_vmcb12_gpa.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tools/testing/selftests/kvm/x86/{svm_nested_invalid_vmcb12_gpa.c = =3D> svm_nested_vmcb12_gpa.c} (100%) diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selft= ests/kvm/Makefile.kvm index ba87cd31872bd..83792d136ac3b 100644 --- a/tools/testing/selftests/kvm/Makefile.kvm +++ b/tools/testing/selftests/kvm/Makefile.kvm @@ -111,9 +111,9 @@ TEST_GEN_PROGS_x86 +=3D x86/vmx_preemption_timer_test TEST_GEN_PROGS_x86 +=3D x86/svm_vmcall_test TEST_GEN_PROGS_x86 +=3D x86/svm_int_ctl_test TEST_GEN_PROGS_x86 +=3D x86/svm_nested_clear_efer_svme -TEST_GEN_PROGS_x86 +=3D x86/svm_nested_invalid_vmcb12_gpa TEST_GEN_PROGS_x86 +=3D x86/svm_nested_shutdown_test TEST_GEN_PROGS_x86 +=3D x86/svm_nested_soft_inject_test +TEST_GEN_PROGS_x86 +=3D x86/svm_nested_vmcb12_gpa TEST_GEN_PROGS_x86 +=3D x86/svm_lbr_nested_state TEST_GEN_PROGS_x86 +=3D x86/tsc_scaling_sync TEST_GEN_PROGS_x86 +=3D x86/sync_regs_test diff --git a/tools/testing/selftests/kvm/x86/svm_nested_invalid_vmcb12_gpa.= c b/tools/testing/selftests/kvm/x86/svm_nested_vmcb12_gpa.c similarity index 100% rename from tools/testing/selftests/kvm/x86/svm_nested_invalid_vmcb12_gpa.c rename to tools/testing/selftests/kvm/x86/svm_nested_vmcb12_gpa.c --=20 2.53.0.473.g4a7958ca14-goog