]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Reinitialize context if host userspace toggles EFER.LME
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Feb 2022 09:56:05 +0000 (04:56 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Feb 2022 13:20:15 +0000 (08:20 -0500)
commitc697fb9bf5ed1c55cdb38523804f8c13a84048dd
treea97f8e14dd4c248e9ab8b645e8d12d8602778e07
parent2823bf5b22af0526182e35bb551028e01d793b8c
KVM: x86: Reinitialize context if host userspace toggles EFER.LME

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: 4aaf930c493e ("KVM: x86: Skip EFER vs. guest CPUID checks for host-initiated writes")
Cc: stable@vger.kernel.org
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.h
arch/x86/kvm/x86.c