All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Alexander Graf <agraf@suse.de>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [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	[thread overview]
Message-ID: <CAFEAcA8Dc1ewn9YZ=Lo4V-heCv6_bujfW58Au-rJjAr-brjOiw@mail.gmail.com> (raw)
In-Reply-To: <1403869944-31927-32-git-send-email-agraf@suse.de>

On 27 June 2014 13:52, Alexander Graf <agraf@suse.de> wrote:
> From: Alexey Kardashevskiy <aik@ozlabs.ru>
>
> 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

  reply	other threads:[~2014-10-17 17:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 11:51 [Qemu-devel] [PULL 00/32] ppc patch queue 2014-06-27 Alexander Graf
2014-06-27 11:51 ` [Qemu-devel] [PULL 01/32] linux-user: Correct AUXV Cache Line Sizes for PowerPC Alexander Graf
2014-06-27 11:51 ` [Qemu-devel] [PULL 02/32] target-ppc: Add DFP to Emulated Instructions Flag Alexander Graf
2014-06-27 11:51 ` [Qemu-devel] [PULL 03/32] linux-user: Identify Addition Hardware Capabilities for PowerPC Alexander Graf
2014-06-27 11:51 ` [Qemu-devel] [PULL 04/32] linux-user: Support HWCAP2 in PowerPC Alexander Graf
2014-06-27 11:51 ` [Qemu-devel] [PULL 05/32] spapr: Add "qemu, boot-menu" property to /chosen Alexander Graf
2014-06-27 11:51 ` [Qemu-devel] [PULL 06/32] target-ppc: fixed translation of mcrxr instruction Alexander Graf
2014-06-27 11:51 ` [Qemu-devel] [PULL 07/32] PPC: Add support for Apple gdb in gdbstub Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 08/32] spapr: Fix RTAS token numbers Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 09/32] spapr_iommu: Make in-kernel TCE table optional Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 10/32] vfio: Add vfio_container_ioctl() Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 11/32] spapr_pci_vfio: Add spapr-pci-vfio-host-bridge to support vfio Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 12/32] vfio: Enable for SPAPR Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 13/32] target-ppc: Remove unused IMM and d extract helpers Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 14/32] target-ppc: Remove unused gen_qemu_ld8s() Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 15/32] mac99: Add motherboard devices before PCI cards Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 16/32] uninorth: Fix PCI hole size Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 17/32] target-ppc: Add support for POWER8 pvr 0x4D0000 Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 18/32] spapr: Fix code design style (s/SPAPRMachine/sPAPRMachineState) Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 19/32] spapr: Define a 2.1 pseries machine Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 20/32] spapr: Add rtas_st_buffer utility function Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 21/32] spapr: Fix RTAS sysparm DIAGNOSTICS_RUN_MODE Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 22/32] spapr: Add RTAS sysparm UUID Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 23/32] spapr: Add RTAS sysparm SPLPAR Characteristics Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 24/32] xics: Add flags for interrupts Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 25/32] xics: Add xics_find_source() Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 26/32] xics: Disable flags reset on xics reset Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 27/32] spapr: Move interrupt allocator to xics Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 28/32] spapr: Remove @next_irq Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 29/32] xics: Implement xics_ics_free() Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 30/32] vmstate: Add preallocation for migrating arrays (VMS_ALLOC flag) Alexander Graf
2014-06-27 11:52 ` [Qemu-devel] [PULL 31/32] spapr_pci: Use XICS interrupt allocator and do not cache interrupts in PHB Alexander Graf
2014-10-17 17:08   ` Peter Maydell [this message]
2014-06-27 11:52 ` [Qemu-devel] [PULL 32/32] PPC: e500: Only create dt entries for existing serial ports Alexander Graf
2014-06-29 11:38 ` [Qemu-devel] [PULL 00/32] ppc patch queue 2014-06-27 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA8Dc1ewn9YZ=Lo4V-heCv6_bujfW58Au-rJjAr-brjOiw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.