aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm/nested.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-06-09 11:56:15 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2021-06-17 13:09:34 -0400
commitdc87275f47332be922d4eb299595523cc3a97479 (patch)
tree7294f42481a965f9d47b6609da37b53ff72d3508 /arch/x86/kvm/svm/nested.c
parentKVM: x86: Invoke kvm_smm_changed() immediately after clearing SMM flag (diff)
downloadlinux-dev-dc87275f47332be922d4eb299595523cc3a97479.tar.xz
linux-dev-dc87275f47332be922d4eb299595523cc3a97479.zip
KVM: x86: Move (most) SMM hflags modifications into kvm_smm_changed()
Move the core of SMM hflags modifications into kvm_smm_changed() and use kvm_smm_changed() in enter_smm(). Clear HF_SMM_INSIDE_NMI_MASK for leaving SMM but do not set it for entering SMM. If the vCPU is executing outside of SMM, the flag should unequivocally be cleared, e.g. this technically fixes a benign bug where the flag could be left set after KVM_SET_VCPU_EVENTS, but the reverse is not true as NMI blocking depends on pre-SMM state or userspace input. Note, this adds an extra kvm_mmu_reset_context() to enter_smm(). The extra/early reset isn't strictly necessary, and in a way can never be necessary since the vCPU/MMU context is in a half-baked state until the final context reset at the end of the function. But, enter_smm() is not a hot path, and exploding on an invalid root_hpa is probably better than having a stale SMM flag in the MMU role; it's at least no worse. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210609185619.992058-6-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm/nested.c')
0 files changed, 0 insertions, 0 deletions