Skip to content

Commit d169364

Browse files
Kevin Chengopsiff
authored andcommitted
KVM: SVM: Inject #UD for INVLPGA if EFER.SVME=0
commit d99df02ff427f461102230f9c5b90a6c64ee8e23 upstream. INVLPGA should cause a #UD when EFER.SVME is not set. Add a check to properly inject #UD when EFER.SVME=0. Fixes: ff09238 ("KVM: SVM: Implement INVLPGA") Cc: stable@vger.kernel.org Signed-off-by: Kevin Cheng <chengkev@google.com> Reviewed-by: Yosry Ahmed <yosry.ahmed@linux.dev> Link: https://patch.msgid.link/20260228033328.2285047-3-chengkev@google.com [sean: tag for stable@] Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 3ac9d4241d205f5d0df06358349ca718ebb0fa12) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 76bc7e4 commit d169364

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/x86/kvm/svm/svm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,6 +2533,9 @@ static int invlpga_interception(struct kvm_vcpu *vcpu)
25332533
gva_t gva = kvm_rax_read(vcpu);
25342534
u32 asid = kvm_rcx_read(vcpu);
25352535

2536+
if (nested_svm_check_permissions(vcpu))
2537+
return 1;
2538+
25362539
/* FIXME: Handle an address size prefix. */
25372540
if (!is_long_mode(vcpu))
25382541
gva = (u32)gva;

0 commit comments

Comments
 (0)