Re: [PATCH v3 1/2] x86/kvm/vmx: Move IRQ/NMI dispatch from KVM into x86 core

From: Sean Christopherson

Date: Tue May 12 2026 - 18:42:12 EST


On Fri, May 08, 2026, Peter Zijlstra wrote:
>
> Move the VMX interrupt dispatch magic into the x86 core code. This
> isolates KVM from the FRED/IDT decisions and reduces the amount of
> EXPORT_SYMBOL_FOR_KVM().
>
> Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> Tested-by: Vishal L Verma <vishal.l.verma@xxxxxxxxx>
> ---

Acked-by: Sean Christopherson <seanjc@xxxxxxxxxx>

> @@ -7152,17 +7149,9 @@ static void handle_external_interrupt_ir
> "unexpected VM-Exit interrupt info: 0x%x", intr_info))
> return;
>
> - /*
> - * Invoke the kernel's IRQ handler for the vector. Use the FRED path
> - * when it's available even if FRED isn't fully enabled, e.g. even if
> - * FRED isn't supported in hardware, in order to avoid the indirect
> - * CALL in the non-FRED path.
> - */
> + /* For the IRQ to the core kernel for processing. */

Forward? Or just delete this comment entirely, either way works for me.

> kvm_before_interrupt(vcpu, KVM_HANDLING_IRQ);
> - if (IS_ENABLED(CONFIG_X86_FRED))
> - fred_entry_from_kvm(EVENT_TYPE_EXTINT, vector);
> - else
> - vmx_do_interrupt_irqoff(gate_offset((gate_desc *)host_idt_base + vector));
> + x86_entry_from_kvm(EVENT_TYPE_EXTINT, vector);
> kvm_after_interrupt(vcpu);
>
> vcpu->arch.at_instruction_boundary = true;