From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJDuB-0006nM-Gv for qemu-devel@nongnu.org; Wed, 04 Feb 2015 23:19:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJDuA-0005FN-9I for qemu-devel@nongnu.org; Wed, 04 Feb 2015 23:19:03 -0500 Date: Thu, 5 Feb 2015 15:10:56 +1100 From: David Gibson Message-ID: <20150205041056.GM25675@voom.fritz.box> References: <1422523650-2888-1-git-send-email-aik@ozlabs.ru> <1422523650-2888-14-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Z/kiM2A+9acXa48/" Content-Disposition: inline In-Reply-To: <1422523650-2888-14-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH v4 13/18] spapr_pci: Advertise dynamic DMA windows to guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Alex Williamson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Alexander Graf --Z/kiM2A+9acXa48/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 29, 2015 at 08:27:25PM +1100, Alexey Kardashevskiy wrote: > Signed-off-by: Alexey Kardashevskiy Needs a commit message. > --- > hw/ppc/spapr.c | 5 +++++ > hw/ppc/spapr_pci.c | 25 +++++++++++++++++++++++++ > 2 files changed, 30 insertions(+) >=20 > 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(ObjectCla= ss *oc, void *data) > MachineClass *mc =3D MACHINE_CLASS(oc); > static GlobalProperty compat_props[] =3D { > 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 =3D TYPE_SPAPR_PCI_HOST_BRIDGE, > + .property =3D "ddw", > + .value =3D 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[] =3D { > 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(), > }; > =20 > @@ -993,6 +994,12 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, > uint32_t interrupt_map_mask[] =3D { > 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[] =3D { > + 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 =3D SPAPR_PCI_HOST_BRIDGE_GET_CLASS(phb); > =20 > /* Start populating the FDT */ > sprintf(nodename, "pci@%" 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)); > =20 > + /* 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_applic= able, > + sizeof(ddw_applicable))); > + > + if (spc->ddw_reset) { > + uint32_t ddw_extensions[] =3D { > + cpu_to_be32(1), > + cpu_to_be32(RTAS_IBM_RESET_PE_DMA_WINDOW) > + }; > + > + /* When enabled, the guest will remove the default 32bit win= dow */ > + _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 > */ --=20 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 --Z/kiM2A+9acXa48/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJU0u1QAAoJEGw4ysog2bOS3MQP+gOxI2uH9WjMxTzN9H29xm6K 9fjwedpCoZJbL09F84DdfuiTZ5ao/07dCVSqV5moDAlu5ibZhhw7Az23WowYgxfd SXFbXB5TYKJLbPSpnGL+tLzDhjZijAKs8LAgQdZM4gKxG/cO8wfNH3cpzVGT5hii ym2FlIod/2vaIfzuAkHnAGzg+E1F1DiEZlkPEyLLfBbDYlqoQ8JYL5o24+vZc/x0 M1xouSmxslTqgoBeRQWY7mln1XCM2doL7plrGT6uXiI905Bq1U0morYVdkDejzGY d8mjqyoi0q1NSoyXyHcBi5f6Me8zQIkV86JyphbnZwHWe0YJJptVLEtYm+ZSCAk4 vPK4yZHxKRw7B9vR9M3rLSe5pzrELrIcDFxKHFMP7EPE8E24J/zQpwKhOvu5rY5r UdUf8AbosyA7B4ffiR0s7IEnZ510dT4DWix54IAd9UOexTJPd6yZuKHnwuSOtgLT kl4gbNXFedrK9EAq1zFb7f3uSnPcNpOPdJSOHUVYSWZa4CVazKCpPDwmQ3FT063m hVqmDDnGXpnaG0Xc5WJXdCu1lvSqrawKd5n5F4oyLBLR3hjZn3mf1m5zi5rDAX5G AqrDHMRmzq2ojeDyNhleKDWcPYTcmrYmB9lm1j10k3huWF310D258hiz4gvr+jqJ lbDhHTxAamr7H6k6LmXd =h4bO -----END PGP SIGNATURE----- --Z/kiM2A+9acXa48/--