Re: [PATCH v2 0/2] KVM: nVMX: Don't let L2's LMSW modify CR0 bits owned by L1

From: Jim Mattson

Date: Fri Oct 30 2026 - 14:52:34 EST


On Fri, Oct 30, 2026 at 11:51 AM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> On Thu, Oct 29, 2026, Mahmoud Abumandour wrote:
> > When L2's LMSW exits to L0 but not to L1, KVM emulates it with
> > kvm_lmsw(), which ignores vmcs12's CR0 guest/host mask, so L2 can change
> > CR0 bits that L1 owns.
> >
> > v2:
> > - Patch 2: order the CR0 store before FNOP and check L2's whole CR0.
>
> I'll send a v3, I already spent an absurd amount of time figuring all of this
> out. I really hate x86 sometimes.

You should redirect that emotion to KVM APIs!