Re: [PATCH 01/12] KVM: x86: host-initiated EFER.LME write affects the MMU

From: Sean Christopherson
Date: Thu Feb 10 2022 - 17:50:07 EST


On Wed, Feb 09, 2022, Paolo Bonzini wrote:
> While the guest runs, EFER.LME cannot change unless CR0.PG is clear, and therefore
> EFER.NX is the only bit that can affect the MMU role. However, set_efer accepts
> a host-initiated change to EFER.LME even with CR0.PG=1. In that case, the
> MMU has to be reset.
>
> Fixes: 11988499e62b ("KVM: x86: Skip EFER vs. guest CPUID checks for host-initiated writes")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> ---

Ugh, but KVM_SET_SREGS handles this... It's basically KVM's equivalent of VMX putting
EFER in the VMCS, but then also allowing EFER in the load/store lists.

Reviewed-by: Sean Christopherson <seanjc@xxxxxxxxxx>