target-ppc: Use actual page size encodings from HPTE
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 27 Jan 2016 00:39:15 +0000 (11:39 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Sat, 30 Jan 2016 12:37:38 +0000 (23:37 +1100)
commitbe18b2b53ebbf2eb3f00e7890d0b9ff8b58d22bf
tree6fbc35aefb8ea727717886d9dfda713baacc4e5c
parentcd6a9bb6e977864b1b7ec21b983fa0678b4b82e9
target-ppc: Use actual page size encodings from HPTE

At present the 64-bit hash MMU code uses information from the SLB to
determine the page size of a translation.  We do need that information to
correctly look up the hash table.  However the MMU also allows a
possibly larger page size to be encoded into the HPTE itself, which is used
to populate the TLB.  At present qemu doesn't check that, and so doesn't
support the MPSS "Multiple Page Size per Segment" feature.

This makes a start on allowing this, by adding an hpte_page_shift()
function which looks up the page size of an HPTE.  We use this to validate
page sizes encodings on faults, and populate the qemu TLB with larger
page sizes when appropriate.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
target-ppc/mmu-hash64.c