Linux-HyperV List
 help / color / mirror / Atom feed
From: Sriram Nambakam <snambakam@linux.microsoft.com>
To: dwmw2@infradead.org
Cc: kvm@vger.kernel.org, linux-hyperv@vger.kernel.org,
	seanjc@google.com, pbonzini@redhat.com
Subject: Re: [RFC PATCH 23/55] WIP: userspace VTL interrupt entry and register intercepts
Date: Tue,  3 Nov 2026 22:55:39 -0800	[thread overview]
Message-ID: <20261104065539.15281-1-snambakam@linux.microsoft.com> (raw)
In-Reply-To: <20261017122501.610248-24-dwmw2@infradead.org>

Hi David,

I hit a Windows VBS boot failure involving hv_divert_dt_write() when OVMF
was executing in SMM.

The helper was diverting firmware descriptor-table writes into the VTL
register-intercept path. The failure trace showed a reflected #GP being
delivered in an SMM context with IDT base and limit both zero, followed
by a triple fault and guest reset.

Excluding SMM from this helper lets those firmware descriptor-table
updates proceed normally, without changing interception for ordinary
VTL0 execution:

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5884,7 +5884,7 @@ static bool hv_divert_dt_write(struct x86_emulate_ctxt *ctxt, u32 hv_reg,
 	struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
 
 	if (!hv_vcpu || vcpu->plane_level || is_guest_mode(vcpu) ||
-	    !(hv_vcpu->reg_intercept_control & ctl_bit))
+	    is_smm(vcpu) || !(hv_vcpu->reg_intercept_control & ctl_bit))
 		return false;
 
 	hv_vcpu->reg_intercept.reg = hv_reg;

The context above includes the is_guest_mode() check added later in the
series by patch 50.

With this and the accompanying integration/QEMU fixes, msinfo32 reports
VBS running. This was an integrated v7.3-based tree, not a test of patch
23 in isolation.

Thanks,
Sriram

  reply	other threads:[~2026-11-04  6:55 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17 12:24 [RFC PATCH 00/55] KVM: x86: Hyper-V VSM (Virtual Trust Levels) on VM planes David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 01/55] KVM: x86/mmu: Move ACC_* masks from spte.h to mmu.h David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 02/55] KVM: x86: Let userspace opt in to multiple planes with KVM_CAP_PLANES David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 03/55] KVM: selftests: Add VM plane infrastructure and tests David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 04/55] KVM: selftests: Add x86 planes lifecycle test David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 05/55] KVM: x86: hyper-v: Add KVM_CAP_HYPERV_FORWARD_HCALL David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 06/55] KVM: selftests: Add Hyper-V hypercall forwarding test David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 07/55] KVM: Add KVM_GET/SET_PLANE_RUN_STATE vCPU ioctls David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 08/55] KVM: selftests: Cover plane run-state ioctls in planes_test David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 09/55] KVM: x86: hyper-v: Let userspace fault a forwarded hypercall David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 10/55] KVM: x86: Allow MP state ioctls on plane vCPU fds David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 11/55] KVM: x86: Filter KVM_ENABLE_CAP " David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 12/55] KVM: x86: initialise Hyper-V state on every plane vCPU David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 13/55] KVM: implement per-plane memory attributes David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 14/55] KVM: x86: hyper-v: bank GUEST_OS_ID and HYPERCALL MSRs per plane David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 15/55] KVM: x86: hyper-v: bank the reference TSC page " David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 16/55] KVM: x86: allow KVM_SET_GUEST_DEBUG on plane vCPU fds David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 17/55] KVM: x86: hyper-v: flush the calling plane's TLB on flush hypercalls David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 18/55] KVM: x86/mmu: free obsolete roots of all planes David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 19/55] KVM: x86: hyperv: don't arm PV EOI for a higher plane's VP assist page David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 20/55] KVM: x86: allow KVM_TRANSLATE on plane vCPU fds David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 21/55] KVM: x86: hyper-v: handle VTL call/return in the kernel David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 22/55] KVM: x86: load each plane twin while updating it after KVM_SET_CPUID David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 23/55] WIP: userspace VTL interrupt entry and register intercepts David Woodhouse
2026-11-04  6:55   ` Sriram Nambakam [this message]
2026-10-17 12:24 ` [RFC PATCH 24/55] WIP: KVM: x86: deliver events to suspended higher planes David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 25/55] WIP: KVM: per-plane memory overlays, richer protection-fault exits David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 26/55] WIP: KVM: x86: VSM event-delivery parity fixes from Windows boot triage David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 27/55] KVM: planes: fan out per-plane requests to twin vCPUs David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 28/55] KVM: x86: inhibit APICv when VM planes are enabled David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 29/55] KVM: x86: hyperv: divert LLDT and LTR into register intercepts David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 30/55] KVM: planes: Unwind published state on KVM_CREATE_PLANE failure David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 31/55] KVM: planes: Kick the running twin's pCPU, not the request target's David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 32/55] KVM: planes: Keep current_vcpu in sync in vcpu_load() David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 33/55] KVM: x86: Report a real write-access walk from KVM_TRANSLATE David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 34/55] KVM: planes: Share XCR0 across plane twins David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 35/55] KVM: x86: Leave TSC matching to the plane 0 vCPUs David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 36/55] KVM: x86: hyperv: Track the reference TSC page per plane David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 37/55] KVM: x86: hyperv: Update the reference TSC page past protections David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 38/55] KVM: x86: hyperv: Publish an added reference TSC page at once David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 39/55] KVM: x86: hyperv: Harden the per-plane reference TSC page updates David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 40/55] KVM: x86: Implement Hyper-V's vCPU suspended state David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 41/55] KVM: x86: hyperv: Refuse a synthetic IPI to a higher VTL David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 42/55] KVM: x86: Gate forced VTL entry on interrupt deliverability David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 43/55] KVM: x86: Derive runtime CPUID bits from the executing plane David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 44/55] KVM: selftests: Test hugepage sizing over mixed protection attributes David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 45/55] KVM: selftests: Test a plane suspending with an undelivered interrupt David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 46/55] KVM: x86: hyperv: Do not skip a moved vCPU when completing a hypercall David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 47/55] KVM: x86: Allow KVM_X86_SETUP_MCE on plane vCPUs David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 48/55] KVM: x86: hyperv: Advertise XMM fast hypercall output David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 49/55] KVM: SVM: Carry instruction state on reflected plane-protection faults David Woodhouse
2026-11-04  6:55   ` Sriram Nambakam
2026-10-17 12:24 ` [RFC PATCH 50/55] KVM: SVM: Trap descriptor-table loads for VTL register intercepts David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 51/55] KVM: SVM: Keep TPR[3:0] across exits without a guest CR8 write David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 52/55] KVM: selftests: Add Hyper-V reference TSC page memory attribute test David Woodhouse
2026-10-17 12:24 ` [RFC PATCH 53/55] KVM: SVM: Hedge the v_tpr_entry comment David Woodhouse
2026-10-17 12:25 ` [RFC PATCH 54/55] KVM: Check every plane's protections before caching a gfn->hva David Woodhouse
2026-10-17 12:25 ` [RFC PATCH 55/55] KVM: planes: Annotate the lockless twin-publication protocol David Woodhouse
2026-11-04  6:55 ` [RFC PATCH 00/55] KVM: x86: Hyper-V VSM (Virtual Trust Levels) on VM planes Sriram Nambakam
2026-11-04  6:55 ` Sriram Nambakam

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=20261104065539.15281-1-snambakam@linux.microsoft.com \
    --to=snambakam@linux.microsoft.com \
    --cc=dwmw2@infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-hyperv@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