[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 1/3] spapr: introduce a fixed IRQ number spac
From: |
Cédric Le Goater |
Subject: |
Re: [Qemu-devel] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space |
Date: |
Mon, 2 Jul 2018 12:03:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
> --- a/hw/ppc/spapr_vio.c
> +++ b/hw/ppc/spapr_vio.c
> @@ -436,6 +436,9 @@ static void spapr_vio_busdev_reset(DeviceState *qdev)
> }
> }
>
> +/* TODO : poor VIO device indexing ... */
> +static uint32_t vio_index;
I think we could also use (dev->reg & 0xff) as an index for
the VIO devices.
The unit address of the virtual IOA is simply allocated using
an increment of bus->next_reg, next_reg being initialized at
0x71000000.
I did not see any restrictions in the PAPR specs or in QEMU
that would break the above.
C.
> static void spapr_vio_busdev_realize(DeviceState *qdev, Error **errp)
> {
> sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
> @@ -476,10 +479,18 @@ static void spapr_vio_busdev_realize(DeviceState *qdev,
> Error **errp)
> }
>
> if (!dev->irq) {
> - dev->irq = spapr_irq_findone(spapr, &local_err);
> - if (local_err) {
> - error_propagate(errp, local_err);
> - return;
> + if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
> + dev->irq = spapr_irq_findone(spapr, &local_err);
> + if (local_err) {
> + error_propagate(errp, local_err);
> + return;
> + }
> + } else {
> + dev->irq = SPAPR_IRQ_VIO + vio_index++;
> + if (dev->irq == SPAPR_IRQ_PCI_LSI) {
> + error_setg(errp, "Too many VIO devices");
> + return;
> + }
- Re: [Qemu-devel] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space,
Cédric Le Goater <=
- Re: [Qemu-devel] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space, Cédric Le Goater, 2018/07/02
- Re: [Qemu-devel] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space, Cédric Le Goater, 2018/07/03
- Re: [Qemu-devel] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space, Greg Kurz, 2018/07/04
- Re: [Qemu-devel] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space, David Gibson, 2018/07/06
- Re: [Qemu-devel] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space, Cédric Le Goater, 2018/07/06
- Re: [Qemu-devel] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space, Cédric Le Goater, 2018/07/06
- Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space, Cédric Le Goater, 2018/07/06