Re: [PATCH v2 06/18] KVM: x86: Move KVM_{GET,SET}_IRQCHIP ioctl helpers to irq.c
From: Sean Christopherson
Date: Thu Jun 12 2025 - 20:52:23 EST
On Thu, Jun 12, 2025, Kai Huang wrote:
> On Wed, 2025-06-11 at 14:35 -0700, Sean Christopherson wrote:
> > Move the ioctl helpers for getting/setting fully in-kernel IRQ chip state
> > to irq.c, partly to trim down x86.c, but mostly in preparation for adding
> > a Kconfig to control support for in-kernel I/O APIC, PIC, and PIT
> > emulation.
> >
> > No functional change intended.
> >
> > Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> > ---
>
> Acked-by: Kai Huang <kai.huang@xxxxxxxxx>
>
> [...]
>
> > --- a/arch/x86/kvm/irq.h
> > +++ b/arch/x86/kvm/irq.h
> > @@ -66,6 +66,9 @@ void kvm_pic_update_irq(struct kvm_pic *s);
> > int kvm_pic_set_irq(struct kvm_kernel_irq_routing_entry *e, struct kvm *kvm,
> > int irq_source_id, int level, bool line_status);
> >
> > +int kvm_vm_ioctl_get_irqchip(struct kvm *kvm, struct kvm_irqchip *chip);
> > +int kvm_vm_ioctl_set_irqchip(struct kvm *kvm, struct kvm_irqchip *chip);
> > +
>
> I think we need to include <uapi/linux/kvm.h> for 'struct kvm_irqchip', just
> like you did for "i8254.h" in previous patch?
It gets pulled in by linux/kvm_host.h. i8254.h didn't have that one (though
amusingly, later on it does get kvm_host.h indirectly via ioapic.h).
> I checked the "irq.h" and it doesn't seem to be obvious that we don't need
> it.