qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH v4 13/18] spapr_pci: Advertise dynamic DMA windows


From: David Gibson
Subject: Re: [Qemu-ppc] [PATCH v4 13/18] spapr_pci: Advertise dynamic DMA windows to guest
Date: Thu, 5 Feb 2015 15:10:56 +1100
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Jan 29, 2015 at 08:27:25PM +1100, Alexey Kardashevskiy wrote:
> Signed-off-by: Alexey Kardashevskiy <address@hidden>

Needs a commit message.

> ---
>  hw/ppc/spapr.c     |  5 +++++
>  hw/ppc/spapr_pci.c | 25 +++++++++++++++++++++++++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index b560459..f9882c1 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1760,6 +1760,11 @@ static void spapr_machine_2_1_class_init(ObjectClass 
> *oc, void *data)
>      MachineClass *mc = MACHINE_CLASS(oc);
>      static GlobalProperty compat_props[] = {
>          HW_COMPAT_2_1,

As noted in earlier comment, this should go to COMPAT_2_2 now that 2.2
is released, shouldn't it?

> +        {
> +            .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,
> +            .property = "ddw",
> +            .value    = stringify(off),
> +        },
>          { /* end of list */ }
>      };

> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index 3ec03be..a94bba1 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -775,6 +775,7 @@ static Property spapr_phb_properties[] = {
>      DEFINE_PROP_UINT64("io_win_addr", sPAPRPHBState, io_win_addr, -1),
>      DEFINE_PROP_UINT64("io_win_size", sPAPRPHBState, io_win_size,
>                         SPAPR_PCI_IO_WIN_SIZE),
> +    DEFINE_PROP_BOOL("ddw", sPAPRPHBState, ddw_enabled, true),

Also, from my reading of the reset code it looked like this setting
would be overwritten by the (available_windows > 1) test.

Come to that.. does the compat stuff belong here with the dt stuff, or
in the earlier patch?

>      DEFINE_PROP_END_OF_LIST(),
>  };
>  
> @@ -993,6 +994,12 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,
>      uint32_t interrupt_map_mask[] = {
>          cpu_to_be32(b_ddddd(-1)|b_fff(0)), 0x0, 0x0, cpu_to_be32(-1)};
>      uint32_t interrupt_map[PCI_SLOT_MAX * PCI_NUM_PINS][7];
> +    uint32_t ddw_applicable[] = {
> +        cpu_to_be32(RTAS_IBM_QUERY_PE_DMA_WINDOW),
> +        cpu_to_be32(RTAS_IBM_CREATE_PE_DMA_WINDOW),
> +        cpu_to_be32(RTAS_IBM_REMOVE_PE_DMA_WINDOW)
> +    };
> +    sPAPRPHBClass *spc = SPAPR_PCI_HOST_BRIDGE_GET_CLASS(phb);
>  
>      /* Start populating the FDT */
>      sprintf(nodename, "address@hidden" PRIx64, phb->buid);
> @@ -1022,6 +1029,24 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,
>      _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pci-config-space-type", 0x1));
>      _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi", XICS_IRQS));
>  
> +    /* Dynamic DMA window */
> +    if (phb->ddw_enabled &&
> +        spc->ddw_query && spc->ddw_create && spc->ddw_remove) {
> +        _FDT(fdt_setprop(fdt, bus_off, "ibm,ddw-applicable", &ddw_applicable,
> +                         sizeof(ddw_applicable)));
> +
> +        if (spc->ddw_reset) {
> +            uint32_t ddw_extensions[] = {
> +                cpu_to_be32(1),
> +                cpu_to_be32(RTAS_IBM_RESET_PE_DMA_WINDOW)
> +            };
> +
> +            /* When enabled, the guest will remove the default 32bit window 
> */
> +            _FDT(fdt_setprop(fdt, bus_off, "ibm,ddw-extensions",
> +                             &ddw_extensions, sizeof(ddw_extensions)));
> +        }
> +    }
> +
>      /* Build the interrupt-map, this must matches what is done
>       * in pci_spapr_map_irq
>       */

-- 
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

Attachment: pgpH2V_tIVcqf.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]