From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIo6l-0006dF-E7 for qemu-devel@nongnu.org; Mon, 11 Jan 2016 20:50:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIo6j-0008GK-Vt for qemu-devel@nongnu.org; Mon, 11 Jan 2016 20:50:51 -0500 Date: Tue, 12 Jan 2016 11:26:09 +1100 From: David Gibson Message-ID: <20160112002609.GF22925@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O98KdSgI27dgYlM5" Content-Disposition: inline In-Reply-To: <568F3352.9090306@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 --O98KdSgI27dgYlM5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 can > >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. Real > >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 pages, > >however, I don't want to add support there without double checking if th= ey > >use the same HPTE and SLB encodings (in principle these are implementati= on > >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 *dat= a) > > { > > 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 } } > >+ }, > >+ } > >+ }; >=20 >=20 > 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. > 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. > I just wanted to double check if POWER7 uses the same encoding and it is = not > that simple to trace what came from where... >=20 >=20 >=20 > > > > dc->fw_name =3D "PowerPC,POWER8"; > > dc->desc =3D "POWER8"; > >@@ -8258,6 +8274,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) > > pcc->l1_dcache_size =3D 0x8000; > > pcc->l1_icache_size =3D 0x8000; > > pcc->interrupts_big_endian =3D ppc_cpu_interrupts_big_endian_lpcr; > >+ pcc->sps =3D &POWER8_sps; > > } > > #endif /* defined (TARGET_PPC64) */ > > > > >=20 >=20 --=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 --O98KdSgI27dgYlM5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWlEghAAoJEGw4ysog2bOSvL0P/A5Y+p0EHk3pkJ15hlzy7k46 LbP4XFjbZ88ZOPyjGrfyz7Gztu6SuENE0ciUi1mmFymJCsiz74MOID5+p+D4rjLy m5odjfg69K5uMyeNs/fMPEu+4o++KxnZgBcjv9GSE7vRHYrngsWYAyoT945V+QHy Hx2xwtYmWMVtySbrR4K9XvZ5lwMVAj7i/VFDRjpE9VpTNHJ30TZpQF3bqhdcCYKt QxFCk31AZh3sEcOuBgnw8jQCa0VFsUqrTCoanZ/FCOIUuBy5tLVKTUcxauY9Iq2a 5SVZmwmiBiCijiPv5JDRdhT2QtQfYtZHWRBZ77I1z4EkAKPUWo46zG0begB7Qp19 b7hqHD2TtpPmhWnipf4Jqw6lks2PqAJaPrbLoZHdaViUztFo2C5496OxYM9CCk60 fBQKNJyngI7RWMaYfuOa4k71UNb8ThBvYQOJ3K1pm6r8paZN11YCEmzW5X4DRufr qPbRtrkQo7nlIupZYRvGaqHnhH5ofYdW6pbEEZ19nPsBgf/qUcKRhHCG4Lcg9cZ3 8xzxp8GdLB6pV0T2mc62E4Y+3sn4H6UpPzFrzBTRJi6ojaxzgL6rKvvKkpIvGgNm AlBGD6n2BYPP3eKgEEXSFHPuoJ966d1ljhmLZNuBVPlnspEoFlZr4ohpNMti6SfH kgMPn9gGSJcswGgU5GL8 =5W+G -----END PGP SIGNATURE----- --O98KdSgI27dgYlM5--