Re: [PATCH 3/4] KVM: x86/mmu: Bug the VM if KVM calcs a CPU role with EFER.LMA=1 && CR4.PAE=0
From: Sean Christopherson
Date: Thu Aug 27 2026 - 14:17:40 EST
On Thu, Aug 27, 2026, Yosry Ahmed wrote:
> > but (a) that's still
> > a (must smaller) game of whack-a-mole and (b) it would actively hide KVM bugs for
> > flows that are supposed to reject the invalid state. And if we WARNed to address
> > (b), we'll be right back where we are today: playing whack-a-mole to prevent the
> > WARN from being triggered.
>
> Either way it's a game of whack-a-mole, unfortunately, whether it's on
> the write side or the read side. What I am hoping is that if we do
> miss one case, we don't crash or corrupt the VM. Ideally, we can just
> ignore EFER.LMA if EFER.LME is not set in these cases?
No, because the context matters. Did we end up with EFER.LMA=1 && EFER.LME=0
because L1 is running L2 with weird settings and wants EFER.LMA to be ignored?
Or did we end up with the impossible state because KVM screwed up? In which case
crashing the guest because KVM runs it with long mode disabled when it expects to
have long mode enabled is the *best* case scenario, and the worst case scenario
is the guest limps along enough to corrupt its memory and persist the badness to
disk or whatever.