mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yosry Ahmed <yosry@kernel.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yosry Ahmed <yosry@kernel.org>
Subject: [PATCH 0/2] KVM: nSVM: Minor post-war fixups
Date: Thu,  5 Mar 2026 20:30:03 +0000	[thread overview]
Message-ID: <20260305203005.1021335-1-yosry@kernel.org> (raw)

A couple of fixups in the aftermath of all nSVM patches, the first one
is just a cleanup suggested offlist by Sean, and the second is a fix for
the test to make sure it's checking #GP on VMRUN not VMLOAD.

In all honestly, I am not sure *why* the test was passing and a #GP was
generated on VMLOAD with a very large but valid GPA. vls=1, so KVM
should not be intercepting VMLOAD (in which case it would inject the
#GP). A #NPF is generated on the VMLOAD, and through tracing I found out
that kvm_mmu_page_fault() returns 1 (RETRY) to npf_interception(). There
shouldn't be a corresponding memslot, so I am not sure if KVM stuffed an
invalid mapping in the NPTs, or if KVM did nothing and the CPU #GP due
to an infinite #NPF loop (although npf_interception() was only called
once). Anyway, figuring that out is irrelevant to the fixup, which makes
sure we're actually getting #GP on VMRUN.

Yosry Ahmed (2):
  KVM: nSVM: Simplify error handling of
    nested_svm_copy_vmcb12_to_cache()
  KVM: selftests: Actually check #GP on VMRUN with invalid vmcb12

 arch/x86/kvm/svm/nested.c                     | 23 +++++++-------
 .../kvm/x86/svm_nested_invalid_vmcb12_gpa.c   | 31 +++++++++----------
 2 files changed, 26 insertions(+), 28 deletions(-)


base-commit: 5128b972fb2801ad9aca54d990a75611ab5283a9
-- 
2.53.0.473.g4a7958ca14-goog


             reply	other threads:[~2026-03-05 20:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 20:30 Yosry Ahmed [this message]
2026-03-05 20:30 ` [PATCH 1/2] KVM: nSVM: Simplify error handling of nested_svm_copy_vmcb12_to_cache() Yosry Ahmed
2026-03-05 20:30 ` [PATCH 2/2] KVM: selftests: Actually check #GP on VMRUN with invalid vmcb12 Yosry Ahmed
2026-03-06 15:57 ` [PATCH 0/2] KVM: nSVM: Minor post-war fixups 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=20260305203005.1021335-1-yosry@kernel.org \
    --to=yosry@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    /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

all inboxes | Powered by JetHome®