target-ppc: Correct page size decoding in ppc_hash64_pteg_search()
commit651060aba79dc9d0cc77ac3921948ea78dba7409
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 5 Jul 2016 02:17:56 +0000 (5 12:17 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 5 Jul 2016 04:31:08 +0000 (5 14:31 +1000)
tree2a839d8056c455db7d1f6a902cfb1108ddc6c07f
parent1f0252e66e76f0b5967419e2a1e53a1f1398bf7b
target-ppc: Correct page size decoding in ppc_hash64_pteg_search()

The architecture specifies that when searching a PTEG for PTEs, entries
with a page size encoding that's not valid for the current segment should
be ignored, continuing the search.

The current implementation does this with ppc_hash64_pte_size_decode()
which is a very incomplete implementation of this check.  We already have
code to do a full and correct page size decode in hpte_page_shift().

This patch moves hpte_page_shift() so it can be used in
ppc_hash64_pteg_search() and adjusts the latter's parameters to include
a full SLBE instead of just a segment page shift.

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