A regression was introduced by commit 53df75a59bcf ('ppc: Fix 64K pages support in full emulation'). ppc_hash64_hpte_page_shift_noslb() should be used to compute the page size.
Signed-off-by: Cédric Le Goater <c...@kaod.org> --- target-ppc/mmu-hash64.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/target-ppc/mmu-hash64.c b/target-ppc/mmu-hash64.c index 7d056c1e3b4a..fdaff9e874ba 100644 --- a/target-ppc/mmu-hash64.c +++ b/target-ppc/mmu-hash64.c @@ -450,28 +450,6 @@ void ppc_hash64_stop_access(PowerPCCPU *cpu, uint64_t token) } } -/* Returns the effective page shift or 0. MPSS isn't supported yet so - * this will always be the slb_pshift or 0 - */ -static uint32_t ppc_hash64_pte_size_decode(uint64_t pte1, uint32_t slb_pshift) -{ - switch (slb_pshift) { - case 12: - return 12; - case 16: - if ((pte1 & 0xf000) == 0x1000) { - return 16; - } - return 0; - case 24: - if ((pte1 & 0xff000) == 0) { - return 24; - } - return 0; - } - return 0; -} - static hwaddr ppc_hash64_pteg_search(PowerPCCPU *cpu, hwaddr hash, uint32_t slb_pshift, bool secondary, target_ulong ptem, ppc_hash_pte64_t *pte) @@ -494,7 +472,7 @@ static hwaddr ppc_hash64_pteg_search(PowerPCCPU *cpu, hwaddr hash, if ((pte0 & HPTE64_V_VALID) && (secondary == !!(pte0 & HPTE64_V_SECONDARY)) && HPTE64_V_COMPARE(pte0, ptem)) { - uint32_t pshift = ppc_hash64_pte_size_decode(pte1, slb_pshift); + uint32_t pshift = ppc_hash64_hpte_page_shift_noslb(cpu, pte0, pte1); if (pshift == 0) { continue; } -- 2.1.4