From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIsbC-0004n0-AN for qemu-devel@nongnu.org; Fri, 01 Jul 2016 03:10:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIsb8-00079U-7Q for qemu-devel@nongnu.org; Fri, 01 Jul 2016 03:10:50 -0400 Received: from 3.mo53.mail-out.ovh.net ([178.33.44.239]:45847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIsb8-000794-04 for qemu-devel@nongnu.org; Fri, 01 Jul 2016 03:10:46 -0400 Received: from player158.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo53.mail-out.ovh.net (Postfix) with ESMTP id 33A95FF872A for ; Fri, 1 Jul 2016 09:10:45 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Fri, 1 Jul 2016 09:10:11 +0200 Message-Id: <1467357013-4039-3-git-send-email-clg@kaod.org> In-Reply-To: <1467357013-4039-1-git-send-email-clg@kaod.org> References: <1467357013-4039-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 2/4] ppc: fix large page support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Alexander Graf , Benjamin Herrenschmidt , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= 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=C3=A9dric Le Goater --- 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) } } =20 -/* 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_p= shift) -{ - switch (slb_pshift) { - case 12: - return 12; - case 16: - if ((pte1 & 0xf000) =3D=3D 0x1000) { - return 16; - } - return 0; - case 24: - if ((pte1 & 0xff000) =3D=3D 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 =3D=3D !!(pte0 & HPTE64_V_SECONDARY)) && HPTE64_V_COMPARE(pte0, ptem)) { - uint32_t pshift =3D ppc_hash64_pte_size_decode(pte1, slb_psh= ift); + uint32_t pshift =3D ppc_hash64_hpte_page_shift_noslb(cpu, pt= e0, pte1); if (pshift =3D=3D 0) { continue; } --=20 2.1.4