Re: [PATCH v4 5/7] KVM: SVM: Inject MCEs when Restricted Injection is active

From: Joerg Rodel

Date: Tue Apr 28 2026 - 08:07:55 EST


On Fri, Apr 24, 2026 at 05:42:09PM +0000, Melody Wang wrote:
> 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.

-Joerg