]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Remove explicit MMU reset in enter_rmode()
authorSean Christopherson <seanjc@google.com>
Tue, 13 Jul 2021 16:32:45 +0000 (09:32 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Aug 2021 15:01:50 +0000 (11:01 -0400)
commitd0cfc9279f4e03a1ef4ed4f3be6f0d861a4dede4
tree8cbb13ab0a5ad32036912b6cb0cff39aee4e4f06
parentf6b434db57e37ae6d15d30d104ee88e250e988b7
KVM: VMX: Remove explicit MMU reset in enter_rmode()

Drop an explicit MMU reset when entering emulated real mode now that the
vCPU INIT/RESET path correctly handles conditional MMU resets, e.g. if
INIT arrives while the vCPU is in 64-bit mode.

Note, while there are multiple other direct calls to vmx_set_cr0(), i.e.
paths that change CR0 without invoking kvm_post_set_cr0(), only the INIT
emulation can reach enter_rmode().  CLTS emulation only toggles CR.TS,
VM-Exit (and late VM-Fail) emulation cannot architecturally transition to
Real Mode, and VM-Enter to Real Mode is possible if and only if
Unrestricted Guest is enabled (exposed to L1).

This effectively reverts commit 11e1224ee644 ("KVM: VMX: Reset mmu
context when entering real mode")

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210713163324.627647-8-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c