From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnGXw-0001k0-MT for qemu-devel@nongnu.org; Thu, 22 Sep 2016 22:49:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnGXv-0002IY-DK for qemu-devel@nongnu.org; Thu, 22 Sep 2016 22:49:04 -0400 Date: Fri, 23 Sep 2016 11:58:49 +1000 From: David Gibson Message-ID: <20160923015849.GQ2085@umbus.fritz.box> References: <1469606618-26915-1-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IjNIXuzrMEaOuFwn" Content-Disposition: inline In-Reply-To: <1469606618-26915-1-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH qemu] spapr_pci: Add numa node id List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Michael Roth --IjNIXuzrMEaOuFwn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 27, 2016 at 06:03:38PM +1000, Alexey Kardashevskiy wrote: > This adds a numa id property to a PHB to allow linking passed PCI device > to CPU/memory. It is up to the management stack to do CPU/memory pinning > to the node with the actual PCI device. >=20 > Signed-off-by: Alexey Kardashevskiy I've applied this to ppc-for-2.8, renaming the property to "numa_node" to match the similar option for pxb. > --- > hw/ppc/spapr_pci.c | 13 +++++++++++++ > include/hw/pci-host/spapr.h | 2 ++ > 2 files changed, 15 insertions(+) >=20 > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c > index 949c44f..af5394a 100644 > --- a/hw/ppc/spapr_pci.c > +++ b/hw/ppc/spapr_pci.c > @@ -47,6 +47,7 @@ > #include "sysemu/device_tree.h" > #include "sysemu/kvm.h" > #include "sysemu/hostmem.h" > +#include "sysemu/numa.h" > =20 > #include "hw/vfio/vfio.h" > =20 > @@ -1544,6 +1545,7 @@ static Property spapr_phb_properties[] =3D { > DEFINE_PROP_BOOL("ddw", sPAPRPHBState, ddw_enabled, true), > DEFINE_PROP_UINT64("pgsz", sPAPRPHBState, page_size_mask, > (1ULL << 12) | (1ULL << 16)), > + DEFINE_PROP_UINT32("node", sPAPRPHBState, numa_node, -1), > DEFINE_PROP_END_OF_LIST(), > }; > =20 > @@ -1805,6 +1807,11 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, > cpu_to_be32(1), > cpu_to_be32(RTAS_IBM_RESET_PE_DMA_WINDOW) > }; > + uint32_t associativity[] =3D {cpu_to_be32(0x4), > + cpu_to_be32(0x0), > + cpu_to_be32(0x0), > + cpu_to_be32(0x0), > + cpu_to_be32(phb->numa_node)}; > sPAPRTCETable *tcet; > PCIBus *bus =3D PCI_HOST_BRIDGE(phb)->bus; > sPAPRFDT s_fdt; > @@ -1837,6 +1844,12 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, > &ddw_extensions, sizeof(ddw_extensions))); > } > =20 > + /* Advertise NUMA via ibm,associativity */ > + if (nb_numa_nodes > 1) { > + _FDT(fdt_setprop(fdt, bus_off, "ibm,associativity", associativit= y, > + sizeof(associativity))); > + } > + > /* Build the interrupt-map, this must matches what is done > * in pci_spapr_map_irq > */ > diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h > index 5adc603..53c4b2d 100644 > --- a/include/hw/pci-host/spapr.h > +++ b/include/hw/pci-host/spapr.h > @@ -75,6 +75,8 @@ struct sPAPRPHBState { > bool ddw_enabled; > uint64_t page_size_mask; > uint64_t dma64_win_addr; > + > + uint32_t numa_node; > }; > =20 > #define SPAPR_PCI_MAX_INDEX 255 --=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 --IjNIXuzrMEaOuFwn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX5IxTAAoJEGw4ysog2bOSSvQQAIwb0XPrYxMe4SMhPkw57OAI kxI9+uL3VQBbgRKNXOqZU29MrWRu/ridtSsKi9f8ZLK3z3ZyiOiS0DgLPBmovYnO 6EdvjRRt6et7QSj7IT+i+qjZ+nGhx/YfzFVz55dI/P0+2pEQASqB3/YKsSXoyYJ/ gX7wKGPJiVexu/Koj3mrqaYMAfML5dp0NWOSlZiQ3oe2x/ZSNjF7FWuMmRKDibAX QDLvNDLjFHTQa5fKNrYiF8pFOGCrC//PoNIMIP0Df4fQo2FbOTfyT3+84WItWtDS QfNuTKVwneGpw9ryQ6oXZBRh8QQ7fTRMN3CC6k7ls1cjaC9rKk4Z9joDVih9OdCu TvbTQuR2wtRrCZ5uOHYl7W7m2pvnxon/kLxsUEhJ6Gctvo7HeH1nxc++MoblNwjB j0MWqs1S4OwIJBpQzS6P/5NfCbQ1pis1PyLCBRBP04nxqZ147bKwji9Bxy2ST1dV lmCIaGImyaY7+U7NbXSapIJwmDc7E1lEq4UpjWRigIUs2PE4HRMPKrnN9UXJ0U4X DfaLcnScZJ6Ob1aHrPQRr0SMsZRWfNiFdHYNMmO6yPbRcYfMPD8SKF4bZgCuS9iB fZAoim47J3CSpEhHcGHRLBB9d7zJkfOzkiifQjMNaIRNgI24iOrlK51+pvMywKPk S/UxXQyTOt1EUNnKKyDc =NCoH -----END PGP SIGNATURE----- --IjNIXuzrMEaOuFwn--