KVM: x86: Move HF_NMI_MASK and HF_IRET_MASK into "struct vcpu_svm"
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 31 Jan 2023 01:20:03 +0000 (17:20 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 31 Jan 2023 20:56:42 +0000 (12:56 -0800)
commit916b54a7688b0b9a1c48c708b848e4348c3ae2ab
tree0cb5c19bb0c5bf0283a7db3e4a86b92997dc0e67
parentc760e86f27fed4aeb46e206a6476b82d8e2d1762
KVM: x86: Move HF_NMI_MASK and HF_IRET_MASK into "struct vcpu_svm"

Move HF_NMI_MASK and HF_IRET_MASK (a.k.a. "waiting for IRET") out of the
common "hflags" and into dedicated flags in "struct vcpu_svm".  The flags
are used only for the SVM and thus should not be in hflags.

Tracking NMI masking in software isn't SVM specific, e.g. VMX has a
similar flag (soft_vnmi_blocked), but that's much more of a hack as VMX
can't intercept IRET, is useful only for ancient CPUs, i.e. will
hopefully be removed at some point, and again the exact behavior is
vendor specific and shouldn't ever be referenced in common code.
converting VMX

No functional change is intended.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Tested-by: Santosh Shukla <Santosh.Shukla@amd.com>
Link: https://lore.kernel.org/r/20221129193717.513824-5-mlevitsk@redhat.com
[sean: split from HF_GIF_MASK patch]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h