From nobody Wed Oct 22 04:13:11 2025 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 1519914263708145.17380897485236; Thu, 1 Mar 2018 06:24:23 -0800 (PST) Received: from localhost ([::1]:57279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erP87-0003mw-GH for importer@patchew.org; Thu, 01 Mar 2018 09:24:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erP7A-0003Kj-7T for qemu-devel@nongnu.org; Thu, 01 Mar 2018 09:23:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erP74-0005Bz-PJ for qemu-devel@nongnu.org; Thu, 01 Mar 2018 09:23:18 -0500 Received: from mel.act-europe.fr ([194.98.77.210]:40731 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 1erP74-0005BV-JJ for qemu-devel@nongnu.org; Thu, 01 Mar 2018 09:23:14 -0500 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 3D5E38139B; Thu, 1 Mar 2018 15:23:13 +0100 (CET) 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 5hsbd6EHYQgk; Thu, 1 Mar 2018 15:23:13 +0100 (CET) Received: from localhost.localdomain (unknown [IPv6:2a02:2ab8:224:100::1001]) (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 A6CA581390; Thu, 1 Mar 2018 15:23:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at eu.adacore.com From: KONRAD Frederic To: qemu-devel@nongnu.org Date: Thu, 1 Mar 2018 15:22:53 +0100 Message-Id: <1519914173-31868-1-git-send-email-frederic.konrad@adacore.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 194.98.77.210 Subject: [Qemu-devel] [RFC PATCH] sparc: fix leon3 casa instruction when MMU is disabled 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: KONRAD Frederic , mark.cave-ayland@ilande.co.uk, rth@twiddle.net 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" Since the commit af7a06bac7d3abb2da48ef3277d2a415772d2ae8: `casa [..](10), .., ..` triggers a data access exception when the MMU is disabled. This fixes this wrong behavior. Signed-off-by: KONRAD Frederic --- Notes: There is an other way to do that: emiting the instruction with a MMU_PHYS_IDX when the MMU is disabled. I can switch to that if it's a prefered method. target/sparc/mmu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index f8886ae..3cebf50 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -100,7 +100,7 @@ static int get_physical_address(CPUSPARCState *env, hwa= ddr *physical, =20 is_user =3D mmu_idx =3D=3D MMU_USER_IDX; =20 - if (mmu_idx =3D=3D MMU_PHYS_IDX) { + if ((mmu_idx =3D=3D MMU_PHYS_IDX) || ((env->mmuregs[0] & MMU_E) =3D=3D= 0)) { *page_size =3D TARGET_PAGE_SIZE; /* Boot mode: instruction fetches are taken from PROM */ if (rw =3D=3D 2 && (env->mmuregs[0] & env->def.mmu_bm)) { --=20 1.8.3.1