Re: [PATCH v4 5/7] KVM: SVM: Inject MCEs when Restricted Injection is active
From: Melody Wang
Date: Tue Apr 28 2026 - 14:19:55 EST
Hi Joerg,
On 4/28/26 3:50 AM, Joerg Rodel wrote:
On Fri, Apr 24, 2026 at 05:42:09PM +0000, Melody Wang wrote:Yes, I think you are right. If MC is not allowed, I should simply return directly instead of noodling through the rest of the function.
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0a1b63c63d1a..420f1ec0dcfb 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -10789,6 +10789,12 @@ static int kvm_check_and_inject_events(struct kvm_vcpu *vcpu,
kvm_update_dr7(vcpu);
}
+ if (vcpu->arch.exception.vector == MC_VECTOR) {
+ r = static_call(kvm_x86_mce_allowed)(vcpu);
+ if (!r)
+ goto out_except;
If this path is taken the warning at the bottom of the function will trigger. I
think the target needs to be out: instead of out_except.
Thanks,
Melody
-Joerg
--
Thanks,
Melody