[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221027083831.2985-8-santosh.shukla@amd.com>
Date: Thu, 27 Oct 2022 14:08:30 +0530
From: Santosh Shukla <santosh.shukla@....com>
To: <pbonzini@...hat.com>, <seanjc@...gle.com>
CC: <kvm@...r.kernel.org>, <jmattson@...gle.com>, <joro@...tes.org>,
<linux-kernel@...r.kernel.org>, <mail@...iej.szmigiero.name>,
<mlevitsk@...hat.com>, <thomas.lendacky@....com>,
<vkuznets@...hat.com>
Subject: [PATCHv5 7/8] KVM: nSVM: emulate VMEXIT_INVALID case for nested VNMI
If NMI virtualization enabled and NMI_INTERCEPT is unset then next vm
entry will exit with #INVALID exit reason.
In order to emulate above (VMEXIT(#INVALID)) scenario for nested
environment, extending check for V_NMI_ENABLE, NMI_INTERCEPT bit in func
__nested_vmcb_check_controls.
Signed-off-by: Santosh Shukla <santosh.shukla@....com>
---
arch/x86/kvm/svm/nested.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index d1c22c89427e..e94ec6dee661 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/nested.c
@@ -274,6 +274,11 @@ static bool __nested_vmcb_check_controls(struct kvm_vcpu *vcpu,
if (CC(!nested_svm_check_tlb_ctl(vcpu, control->tlb_ctl)))
return false;
+ if (CC((control->int_ctl & V_NMI_ENABLE) &&
+ !vmcb12_is_intercept(control, INTERCEPT_NMI))) {
+ return false;
+ }
+
return true;
}
--
2.25.1
Powered by blists - more mailing lists