From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIqdn-000521-9s for qemu-devel@nongnu.org; Mon, 11 Jan 2016 23:33:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIqdk-0001yR-JD for qemu-devel@nongnu.org; Mon, 11 Jan 2016 23:33:07 -0500 Date: Tue, 12 Jan 2016 15:33:55 +1100 From: David Gibson Message-ID: <20160112043355.GT22925@voom.redhat.com> References: <1450665670-18323-1-git-send-email-david@gibson.dropbear.id.au> <1450665670-18323-3-git-send-email-david@gibson.dropbear.id.au> <568F3352.9090306@ozlabs.ru> <20160112002609.GF22925@voom.redhat.com> <56948169.1000702@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oP9at/Ymg5VWhwKB" Content-Disposition: inline In-Reply-To: <56948169.1000702@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH 2/2] ppc: Allow 64kiB pages for POWER8 in TCG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: lvivier@redhat.com, thuth@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org --oP9at/Ymg5VWhwKB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 12, 2016 at 03:30:33PM +1100, Alexey Kardashevskiy wrote: > On 01/12/2016 11:26 AM, David Gibson wrote: > >On Fri, Jan 08, 2016 at 02:56:02PM +1100, Alexey Kardashevskiy wrote: > >>On 12/21/2015 01:41 PM, David Gibson wrote: > >>>Now that the spapr code has been extended to support 64kiB pages, we c= an > >>>allow guests to use 64kiB pages on an emulated POWER8 by adding it to = the > >>>"segment_page_sizes" structure which is advertised via the device tree. > >>> > >>>For now we just add support for 64kiB pages in 64kiB page segments. R= eal > >>>POWER8 also supports 64kiB pages in 4kiB page segments, but that will > >>>require more work to implement. > >>> > >>>Real POWER7s (and maybe some other CPU models) also support 64kiB page= s, > >>>however, I don't want to add support there without double checking if = they > >>>use the same HPTE and SLB encodings (in principle these are implementa= tion > >>>dependent). > >>> > >>>Signed-off-by: David Gibson > >>>--- > >>> target-ppc/translate_init.c | 17 +++++++++++++++++ > >>> 1 file changed, 17 insertions(+) > >>> > >>>diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c > >>>index e88dc7f..ae5a269 100644 > >>>--- a/target-ppc/translate_init.c > >>>+++ b/target-ppc/translate_init.c > >>>@@ -8200,6 +8200,22 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *d= ata) > >>> { > >>> DeviceClass *dc =3D DEVICE_CLASS(oc); > >>> PowerPCCPUClass *pcc =3D POWERPC_CPU_CLASS(oc); > >>>+ static const struct ppc_segment_page_sizes POWER8_sps =3D { > >>>+ .sps =3D { > >>>+ { .page_shift =3D 12, /* 4K */ > >>>+ .slb_enc =3D 0, > >>>+ .enc =3D { { .page_shift =3D 12, .pte_enc =3D 0 } } > >>>+ }, > >>>+ { .page_shift =3D 16, /* 64K */ > >>>+ .slb_enc =3D 0x110, > >>>+ .enc =3D { { .page_shift =3D 16, .pte_enc =3D 0x1 } } > >>>+ }, > >>>+ { .page_shift =3D 24, /* 16M */ > >>>+ .slb_enc =3D 0x100, > >>>+ .enc =3D { { .page_shift =3D 24, .pte_enc =3D 0 } } > >>>+ }, > >>>+ } > >>>+ }; > >> > >> > >>In order to educate myself - where did 0x110/0x100 come from? > > > >These are the L and LP bit encodings used by actual POWER8 hardware - > >IIRC I took the information from the kernel's mmu_psize_defs table. >=20 >=20 > I found this in p8-book4. Paul suggested there is a public POWER8 user > manual but I cannot neither google it nor find on > http://openpowerfoundation.org/. Ok. >=20 >=20 > >>Is not 0x110 > >>SLB_VSID_64K (which does not use SLB_VSID_L by accident?)? > > > >Yes, it is > > > >>And is 0x100 > >>SLB_VSID_L? > > > >Yes. >=20 > Cool, thanks. >=20 > btw why not to use those definitions then... I think I started trying to, but got into some #include complications that weren't worth the hassling of sorting out at the time. --=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 --oP9at/Ymg5VWhwKB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWlIIzAAoJEGw4ysog2bOSgaUP/Rnha6LrN8Ai6jODoedVXgTa HB7K/wjlHcZgp75qzJTC//Xj+agAyNTajfpHBqgmnp+p70GX43+2SXkHo+p9nXee 1Ma6hP4ypl+IxYjpX9T/UHMejEJ0gWqw9sxzmjUWCAyPI1BaqK6hkJvISCZ+ODMf bfQnK+Q1YL9utIiPs6CslBXreNEEQ23HTyaH3TiPy1lW0kCIJyStQalZpvS8dpXh vLthJRHq30n+YS8MFMQDQHXF/dMIoXy4wvzrrQqEYPCytTVXUEAHsPa5UXYPpiCT KO0hOrMtlRWegZSTpubbd8gAFQ3HcMTdKVWtm1QgESnVnGpNXa37nG0TSQJPXx1/ lKaANxC6xLL8vo4Sw0w9v69k6rmQJx1r3yyoTlhYBxXye4twl/4KwYLkOBAIC+aQ OrNOg1UDe1FOIQharUUYgiaG/3h3tKU2oFLQ8wQC8S7fSgdu3LK2/EZU7in7KTem KJs/IPTeRIUpU4OlQ6CYUyB6Qlli0DVjzXlxMbIRL6eNQ2CbzWu/6snRwsHOO8RW VFBLc31MAUZ/yPTRB+evBVE/f21x9mtQ8pcpQdKE7b77Wz0oEtO2UD3PZkuEDPv5 gvPK3w9oNgnERwcSGw6q+x4toOwKUf4W8MdLumHnC4Tga9ubaOO0yxzv9poGuWHi zJ1l6IFGNDckVD6GsxLY =4oBm -----END PGP SIGNATURE----- --oP9at/Ymg5VWhwKB--