[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH 3/3] spapr_pci: fix "ibm, pe-total-#msi" value
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PATCH 3/3] spapr_pci: fix "ibm, pe-total-#msi" value |
Date: |
Tue, 11 Sep 2018 11:50:32 +1000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Mon, Sep 10, 2018 at 01:02:22PM +0200, Cédric Le Goater wrote:
> The "ibm,pe-total-#msi" property of the sPAPR PHB defines the number
> of allocatable MSI interrupts. This is currently set to XICS_IRQS_SPAPR
> which covers the full IRQ number space of the machine. This is wrong.
>
> Fix the definition by using the 'nr_msis' attribute of the sPAPRIrq
> class and remove XICS_IRQS_SPAPR which is now unused.
>
> Signed-off-by: Cédric Le Goater <address@hidden>
Oh.. right.. I think it makes more sense to just merge this into the
first patch.
> ---
> include/hw/ppc/xics.h | 2 --
> hw/ppc/spapr_irq.c | 2 +-
> hw/ppc/spapr_pci.c | 5 +++--
> 3 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
> index 9c2916c9b23a..9958443d1984 100644
> --- a/include/hw/ppc/xics.h
> +++ b/include/hw/ppc/xics.h
> @@ -181,8 +181,6 @@ typedef struct XICSFabricClass {
> ICPState *(*icp_get)(XICSFabric *xi, int server);
> } XICSFabricClass;
>
> -#define XICS_IRQS_SPAPR 1024
> -
> void spapr_dt_xics(int nr_servers, void *fdt, uint32_t phandle);
>
> ICPState *xics_icp_get(XICSFabric *xi, int server);
> diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
> index b14d7bce00ea..e77b94cc685e 100644
> --- a/hw/ppc/spapr_irq.c
> +++ b/hw/ppc/spapr_irq.c
> @@ -290,7 +290,7 @@ int spapr_irq_find(sPAPRMachineState *spapr, int num,
> bool align, Error **errp)
> return first + ics->offset;
> }
>
> -#define SPAPR_IRQ_XICS_LEGACY_NR_IRQS XICS_IRQS_SPAPR
> +#define SPAPR_IRQ_XICS_LEGACY_NR_IRQS 0x400
>
> sPAPRIrq spapr_irq_xics_legacy = {
> .nr_irqs = SPAPR_IRQ_XICS_LEGACY_NR_IRQS,
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index 6bcb4f419b6b..bb736177e76c 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -2121,6 +2121,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,
> sPAPRTCETable *tcet;
> PCIBus *bus = PCI_HOST_BRIDGE(phb)->bus;
> sPAPRFDT s_fdt;
> + sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(qdev_get_machine());
>
> /* Start populating the FDT */
> nodename = g_strdup_printf("address@hidden" PRIx64, phb->buid);
> @@ -2138,8 +2139,8 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,
> _FDT(fdt_setprop(fdt, bus_off, "ranges", &ranges, sizeof_ranges));
> _FDT(fdt_setprop(fdt, bus_off, "reg", &bus_reg, sizeof(bus_reg)));
> _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pci-config-space-type", 0x1));
> - /* TODO: fine tune the total count of allocatable MSIs per PHB */
> - _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi",
> XICS_IRQS_SPAPR));
> + _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi",
> + smc->irq->nr_msis));
>
> /* Dynamic DMA window */
> if (phb->ddw_enabled) {
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [Qemu-ppc] [PATCH 0/3] spapr: introduce a new sPAPRIrq backend, Cédric Le Goater, 2018/09/10
- [Qemu-ppc] [PATCH 2/3] spapr: increase the size of the IRQ number space, Cédric Le Goater, 2018/09/10
- [Qemu-ppc] [PATCH 3/3] spapr_pci: fix "ibm,pe-total-#msi" value, Cédric Le Goater, 2018/09/10
- Re: [Qemu-ppc] [PATCH 3/3] spapr_pci: fix "ibm, pe-total-#msi" value,
David Gibson <=
- Re: [Qemu-ppc] [PATCH 0/3] spapr: introduce a new sPAPRIrq backend, Greg Kurz, 2018/09/10