[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PULL 31/32] spapr_pci: Use XICS interrupt allocator and
From: |
Peter Maydell |
Subject: |
Re: [Qemu-ppc] [PULL 31/32] spapr_pci: Use XICS interrupt allocator and do not cache interrupts in PHB |
Date: |
Fri, 17 Oct 2014 19:08:29 +0200 |
On 27 June 2014 13:52, Alexander Graf <address@hidden> wrote:
> From: Alexey Kardashevskiy <address@hidden>
>
> Currently SPAPR PHB keeps track of all allocated MSI (here and below
> MSI stands for both MSI and MSIX) interrupt because
> XICS used to be unable to reuse interrupts. This is a problem for
> dynamic MSI reconfiguration which happens when guest reloads a driver
> or performs PCI hotplug. Another problem is that the existing
> implementation can enable MSI on 32 devices maximum
> (SPAPR_MSIX_MAX_DEVS=32) and there is no good reason for that.
>
> This makes use of new XICS ability to reuse interrupts.
>
> This reorganizes MSI information storage in sPAPRPHBState. Instead of
> static array of 32 descriptors (one per a PCI function), this patch adds
> a GHashTable when @config_addr is a key and (first_irq, num) pair is
> a value. GHashTable can dynamically grow and shrink so the initial limit
> of 32 devices is gone.
> +static void spapr_pci_pre_save(void *opaque)
> +{
> + sPAPRPHBState *sphb = opaque;
> + GHashTableIter iter;
> + gpointer key, value;
> + int i;
> +
> + if (sphb->msi_devs) {
> + g_free(sphb->msi_devs);
> + sphb->msi_devs = NULL;
> + }
> + sphb->msi_devs_num = g_hash_table_size(sphb->msi);
> + if (!sphb->msi_devs_num) {
> + return;
> + }
> + sphb->msi_devs = g_malloc(sphb->msi_devs_num *
> sizeof(spapr_pci_msi_mig));
> +
> + g_hash_table_iter_init(&iter, sphb->msi);
> + for (i = 0; g_hash_table_iter_next(&iter, &key, &value); ++i) {
> + sphb->msi_devs[i].key = *(uint32_t *) key;
> + sphb->msi_devs[i].value = *(spapr_pci_msi *) value;
> + }
> +}
Hi. I'm afraid this doesn't build under glib 2.12:
/home/petmay01/linaro/qemu-for-merges/hw/ppc/spapr_pci.c: In function
'spapr_pci_pre_save':
/home/petmay01/linaro/qemu-for-merges/hw/ppc/spapr_pci.c:710: error:
'GHashTableIter' undeclared (first use in this function)
/home/petmay01/linaro/qemu-for-merges/hw/ppc/spapr_pci.c:710: error:
(Each undeclared identifier is reported only once
/home/petmay01/linaro/qemu-for-merges/hw/ppc/spapr_pci.c:710: error:
for each function it appears in.)
/home/petmay01/linaro/qemu-for-merges/hw/ppc/spapr_pci.c:710: error:
expected ';' before 'iter'
/home/petmay01/linaro/qemu-for-merges/hw/ppc/spapr_pci.c:724: warning:
implicit declaration of function 'g_hash_table_iter_init'
/home/petmay01/linaro/qemu-for-merges/hw/ppc/spapr_pci.c:724: warning:
nested extern declaration of 'g_hash_table_iter_init'
/home/petmay01/linaro/qemu-for-merges/hw/ppc/spapr_pci.c:724: error:
'iter' undeclared (first use in this function)
/home/petmay01/linaro/qemu-for-merges/hw/ppc/spapr_pci.c:725: warning:
implicit declaration of function 'g_hash_table_iter_next'
/home/petmay01/linaro/qemu-for-merges/hw/ppc/spapr_pci.c:725: warning:
nested extern declaration of 'g_hash_table_iter_next'
g_hash_table_iter_init was only added in glib 2.16;
the old style way to do this is using g_hash_table_foreach()
(and a helper function).
thanks
-- PMM
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-ppc] [PULL 31/32] spapr_pci: Use XICS interrupt allocator and do not cache interrupts in PHB,
Peter Maydell <=