On 07/05/2009 04:04 PM, Michael S. Tsirkin wrote:
Support msi-x with irqchip in kernel: allocate entries when they are used, and update when they are unmasked. /* Declaration from linux/pci_regs.h */ #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ @@ -109,6 +110,18 @@ static int msix_add_config(struct PCIDevice *pdev, unsigned short nentries, static void msix_free_irq_entries(PCIDevice *dev) { int vector; + if (kvm_enabled()&& qemu_kvm_irqchip_in_kernel()) { + int changed = 0; + for (vector = 0; vector< dev->msix_entries_nr; ++vector) { + if (dev->msix_entry_used[vector]) { + kvm_del_routing_entry(kvm_context,&dev->msix_irq_entries[vector]); + changed = 1; + } + } + if (changed) { + kvm_commit_irq_routes(kvm_context); + } + }
Please move this into a helper. Ditto all the code hunks in msix functions. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html