diff mbox series

[RFC,10/19] KVM: SVM: Secure AVIC: Do not inject "Exceptions" for Secure AVIC

Message ID 20250228085115.105648-11-Neeraj.Upadhyay@amd.com (mailing list archive)
State New
Headers show
Series AMD: Add Secure AVIC KVM Support | expand

Commit Message

Neeraj Upadhyay Feb. 28, 2025, 8:51 a.m. UTC
From: Kishon Vijay Abraham I <kvijayab@amd.com>

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@amd.com>
Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
---
 arch/x86/kvm/svm/svm.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

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) &&