public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Yosry Ahmed <yosry@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Jim Mattson <jmattson@google.com>,
	kvm@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 0/9] KVM: SVM: Fixes for VMCB12 checks and mapping
Date: Fri, 3 Apr 2026 12:05:22 -0700	[thread overview]
Message-ID: <adAPcmksaq8Oq7V-@google.com> (raw)
In-Reply-To: <20260316202732.3164936-1-yosry@kernel.org>

On Mon, Mar 16, 2026, Yosry Ahmed wrote:
> Jim pointed out that VMRUN/VMLOAD/VMSAVE injecting a #GP when the vmcb12
> GPA is valid but not mappable is not architectural [1]. The series
> handles them as emulation failures and (mostly) exits to userspace
> instead. It also fixes the checks performed on the vmcb12 GPA (i.e. RAX)
> in a few places.
> 
> Note that there's a few other bugs that this series leaves alone, mostly
> to keep it focused on fixing the non-architectrual #GPs, this includes:
> - KVM synthesizing #VMEXIT(VMLOAD/VMSAVE) to L1 when intercepting #GP
>   from L2 on VMLOAD/VMSAVE, even if L1 does not intercept VMLOAD/VMSAVE
>   (e.g. VLS enabled).
> - KVM not respecting priority of #GP vs. #UD when EFER.SVME is disabled
>   by the guest.
> 
> However, the series documents these bugs with FIXMEs so that they can
> hopefully be fixed up later.
> 
> v3 -> v4:
> - Fix the RAX check in the emulator instead of dropping it [Paolo].
> - Add refactoring of SVM instructions on #GP intercept to facilitate
>   following fixes.
> - Use kvm_register_read() to handle 32-bit correctly and avoid false
>   negatives.
> - Do #UD and #GP checks before synthesizing #VMEXIT to L1 when KVM
>   intercepts #GP on SVM instruction in L2.
> - Update changelogs.
> 
> v3: https://lore.kernel.org/kvm/20260306210900.1933788-1-yosry@kernel.org/
> 
> [1]https://lore.kernel.org/kvm/CALMp9eSMtzDJn7tGtbj=zLYpcU7Tc7XjcWBRZH7Aa5YihSmN7g@mail.gmail.com/
> 
> Yosry Ahmed (9):
>   KVM: SVM: Properly check RAX in the emulator for SVM instructions
>   KVM: SVM: Refactor SVM instruction handling on #GP intercept
>   KVM: SVM: Properly check RAX on #GP intercept of SVM instructions
>   KVM: SVM: Move RAX legality check to SVM insn interception handlers
>   KVM: SVM: Check EFER.SVME and CPL on #GP intercept of SVM instructions
>   KVM: SVM: Treat mapping failures equally in VMLOAD/VMSAVE emulation
>   KVM: nSVM: Fail emulation of VMRUN/VMLOAD/VMSAVE if mapping vmcb12
>     fails
>   KVM: selftests: Rework svm_nested_invalid_vmcb12_gpa
>   KVM: selftests: Drop 'invalid' from svm_nested_invalid_vmcb12_gpa's
>     name

Some nits and suggestsions, but I can clean them up when applying.  I'm leaning
strongly toward applying this for 7.1 even though it's super late in the cycle,
as there's very little risk (e.g. compared to the gPTA or host/guest PMU series),
and getting the VCPU_REGS_RAX landed would make my life easier for 7.2.

  parent reply	other threads:[~2026-04-03 19:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 20:27 [PATCH v4 0/9] KVM: SVM: Fixes for VMCB12 checks and mapping Yosry Ahmed
2026-03-16 20:27 ` [PATCH v4 1/9] KVM: SVM: Properly check RAX in the emulator for SVM instructions Yosry Ahmed
2026-03-16 20:56   ` Yosry Ahmed
2026-03-16 20:27 ` [PATCH v4 2/9] KVM: SVM: Refactor SVM instruction handling on #GP intercept Yosry Ahmed
2026-04-03 18:18   ` Sean Christopherson
2026-04-03 21:45     ` Yosry Ahmed
2026-03-16 20:27 ` [PATCH v4 3/9] KVM: SVM: Properly check RAX on #GP intercept of SVM instructions Yosry Ahmed
2026-04-03 17:39   ` Sean Christopherson
2026-04-03 19:00     ` Sean Christopherson
2026-04-03 21:43       ` Yosry Ahmed
2026-04-03 22:16         ` Sean Christopherson
2026-03-16 20:27 ` [PATCH v4 4/9] KVM: SVM: Move RAX legality check to SVM insn interception handlers Yosry Ahmed
2026-03-16 20:27 ` [PATCH v4 5/9] KVM: SVM: Check EFER.SVME and CPL on #GP intercept of SVM instructions Yosry Ahmed
2026-03-16 20:27 ` [PATCH v4 6/9] KVM: SVM: Treat mapping failures equally in VMLOAD/VMSAVE emulation Yosry Ahmed
2026-03-16 20:27 ` [PATCH v4 7/9] KVM: nSVM: Fail emulation of VMRUN/VMLOAD/VMSAVE if mapping vmcb12 fails Yosry Ahmed
2026-03-16 20:27 ` [PATCH v4 8/9] KVM: selftests: Rework svm_nested_invalid_vmcb12_gpa Yosry Ahmed
2026-03-16 20:27 ` [PATCH v4 9/9] KVM: selftests: Drop 'invalid' from svm_nested_invalid_vmcb12_gpa's name Yosry Ahmed
2026-04-03 19:05 ` Sean Christopherson [this message]
2026-04-03 21:45   ` [PATCH v4 0/9] KVM: SVM: Fixes for VMCB12 checks and mapping Yosry Ahmed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adAPcmksaq8Oq7V-@google.com \
    --to=seanjc@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=yosry@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox