[RFC PATCH 10/19] KVM: SVM: Secure AVIC: Do not inject "Exceptions" for Secure AVIC
From: Neeraj Upadhyay
Date: Fri Feb 28 2025 - 04:09:44 EST
From: Kishon Vijay Abraham I <kvijayab@xxxxxxx>
Secure AVIC does not support injecting "Exceptions" from hypervisor.
Return from svm_inject_exception() for Secure AVIC.
HW takes care of delivering exceptions initiated by guest as well as
re-injecting exceptions initiated by guest (in case there's an intercept
before delivering the exceptions). However exceptions cannot be
explicitly injected from Hypervisor when Secure AVIC is enabled.
Signed-off-by: Kishon Vijay Abraham I <kvijayab@xxxxxxx>
Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@xxxxxxx>
---
arch/x86/kvm/svm/svm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 7cfd6e916c74..58733b63bcd7 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -463,6 +463,9 @@ static void svm_inject_exception(struct kvm_vcpu *vcpu)
struct kvm_queued_exception *ex = &vcpu->arch.exception;
struct vcpu_svm *svm = to_svm(vcpu);
+ if (sev_savic_active(vcpu->kvm))
+ return;
+
kvm_deliver_exception_payload(vcpu, ex);
if (kvm_exception_is_soft(ex->vector) &&
--
2.34.1