From patchwork Fri Jul 1 07:10:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 9209351 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3CD7C607D6 for ; Fri, 1 Jul 2016 07:11:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B1CF2840E for ; Fri, 1 Jul 2016 07:11:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E9962868E; Fri, 1 Jul 2016 07:11:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 90AE82840E for ; Fri, 1 Jul 2016 07:11:26 +0000 (UTC) Received: from localhost ([::1]:54154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIsbl-0004qb-MH for patchwork-qemu-devel@patchwork.kernel.org; Fri, 01 Jul 2016 03:11:25 -0400 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) Received: from hermes.ibm.com (LFbn-1-2234-107.w90-76.abo.wanadoo.fr [90.76.55.107]) (Authenticated sender: clg@kaod.org) by player158.ha.ovh.net (Postfix) with ESMTPSA id D93766200A3; Fri, 1 Jul 2016 09:10:38 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Date: Fri, 1 Jul 2016 09:10:11 +0200 Message-Id: <1467357013-4039-3-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.1.4 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 X-Ovh-Tracer-Id: 1690257235549326310 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeltddrudekgdduudejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 178.33.44.239 Subject: [Qemu-devel] [PATCH 2/4] ppc: fix large page support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, Alexander Graf , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; }