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, joro@8bytes.org
Subject: Re: [RFC PATCH 00/55] KVM: x86: Hyper-V VSM (Virtual Trust Levels) on VM planes
Date: Tue,  3 Nov 2026 22:55:47 -0800	[thread overview]
Message-ID: <20261104065547.15425-1-snambakam@linux.microsoft.com> (raw)
In-Reply-To: <20261017122501.610248-1-dwmw2@infradead.org>

Hi David,

One fix in the associated QEMU VSM glue: vsm_glue_reset() stops plane 1
but also needs to make plane 0 runnable.

After a VTL switch, the normal-world vCPU can still be marked
userspace-stopped. Stopping only the higher plane during reset leaves
that state behind, rather than restoring the VTL0 execution path for
the fresh boot.

The functional change from my local QEMU commit is:

diff --git a/target/i386/kvm/hv-vsm-qemu.c b/target/i386/kvm/hv-vsm-qemu.c
--- a/target/i386/kvm/hv-vsm-qemu.c
+++ b/target/i386/kvm/hv-vsm-qemu.c
@@ -974,6 +974,7 @@ static void vsm_glue_reset(void *opaque)
     for (uint32_t vp = 0; vp < vsm_glue.nr_vps; vp++) {
         if (vsm_glue.plane1_vcpu_fd[vp] >= 0) {
             vsm_vcpu_set_run_state(&vsm_glue, 1, vp, false);
+            vsm_vcpu_set_run_state(&vsm_glue, 0, vp, true);
         }
     }
     qemu_mutex_unlock(&vsm_glue.lock);

I also added temporary exception-delivery diagnostics to print the SMM
state, CS selector/base, CR0, and IDT base/limit. Those exposed the
SMM/#GP failure described in my reply to kernel patch 23, but aren't
needed for the reset fix above.

Thanks,
Sriram

      parent 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
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 [this message]

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