I've been porting the qemu vfio driver to use the common msix infrastructure and hit a couple issues. The first patch addresses the problem that a device may already have MSI-X capability setup and non-adjustable BARs, so msix_init should be able to use the existing capability instead of adding it's own.
I'm surprised we need the second patch, as I'm not sure how things work today without it. We allocate msix_irq_entries within a KVM_CAP_IRQCHIP #ifdef. This should be pulled in from kvm.h, if we have CONFIG_KVM, but that's pulled in from config-target.h, which we don't include. We can add config.h to msix.c, but that only works if the msix object is in Makefile.target instead of Makefile.objs. Feel free to fix this differently, but I think something is wrong there. Thanks, Alex --- Alex Williamson (2): msix: Pull in config.h for CONFIG_KVM msix: Allow msix_init on a device with existing MSI-X capability Makefile.objs | 2 -- Makefile.target | 1 + hw/msix.c | 68 ++++++++++++++++++++++++++++++++----------------------- 3 files changed, 40 insertions(+), 31 deletions(-)