From nobody Mon Feb 9 13:39:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502121271243977.224141346238; Mon, 7 Aug 2017 08:54:31 -0700 (PDT) Received: from localhost ([::1]:38096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dekMP-0000ns-Os for importer@patchew.org; Mon, 07 Aug 2017 11:54:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dekKT-0007xg-0v for qemu-devel@nongnu.org; Mon, 07 Aug 2017 11:52:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dekKO-0005n3-Cv for qemu-devel@nongnu.org; Mon, 07 Aug 2017 11:52:29 -0400 Received: from mel.act-europe.fr ([2a02:2ab8:224:1::a0a:d2]:44797 helo=smtp.eu.adacore.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dekKO-0005m6-7I for qemu-devel@nongnu.org; Mon, 07 Aug 2017 11:52:24 -0400 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id CE71F8135D; Mon, 7 Aug 2017 17:52:22 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kWNWCQnvq5wV; Mon, 7 Aug 2017 17:52:22 +0200 (CEST) Received: from localhost.localdomain.localdomain (unknown [IPv6:2a01:e35:87f0:3180:2b18:7e65:c33:7f62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 5044481362; Mon, 7 Aug 2017 17:52:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at eu.adacore.com From: KONRAD Frederic To: david@gibson.dropbear.id.au, agraf@suse.de Date: Mon, 7 Aug 2017 17:50:45 +0200 Message-Id: <1502121048-1816-2-git-send-email-frederic.konrad@adacore.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1502121048-1816-1-git-send-email-frederic.konrad@adacore.com> References: <1502121048-1816-1-git-send-email-frederic.konrad@adacore.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2a02:2ab8:224:1::a0a:d2 Subject: [Qemu-devel] [PATCH for-2.11 1/4] booke206: fix booke206_tlbnps for mav 2.0 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: frederic.konrad@adacore.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This fixes booke206_tlbnps for MAV 2.0 by checking the MMUCFG register and return directly the right tlbnps instead of computing it from non existing field. Signed-off-by: KONRAD Frederic --- target/ppc/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 6ee2a26..d2faea9 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -2472,10 +2472,10 @@ static inline ppcmas_tlb_t *booke206_get_tlbm(CPUPP= CState *env, const int tlbn, /* returns bitmap of supported page sizes for a given TLB */ static inline uint32_t booke206_tlbnps(CPUPPCState *env, const int tlbn) { - bool mav2 =3D false; uint32_t ret =3D 0; =20 - if (mav2) { + if ((env->spr[SPR_MMUCFG] & MMUCFG_MAVN) =3D=3D MMUCFG_MAVN_V2) { + /* MAV2 */ ret =3D env->spr[SPR_BOOKE_TLB0PS + tlbn]; } else { uint32_t tlbncfg =3D env->spr[SPR_BOOKE_TLB0CFG + tlbn]; --=20 1.8.3.1