From nobody Fri Dec 19 18:47:31 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=wdc.com ARC-Seal: i=1; a=rsa-sha256; t=1607978788; cv=none; d=zohomail.com; s=zohoarc; b=bDHyj9vasBQFFNsfJbwqI8A/dfLVyggElU+zwZbk9YNhsdUEzYVq0zgShpYVa+Pd5bR7pWaz3+kzHpW8TKWUfsuGWdx/3ft4GZOWHE3e5KlQcbzEBqVEZq6aqz35XKAuIOdz4+lzImhRrEvqVLijSh5JdEZREQAZI6M85MZbXxM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607978788; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=y+YPQOkHN/tvIPnEQPCGJYKSI/Ed/F7VHHGqAwfQSjQ=; b=Dg4xYlTMx51aXHVlZojFVSn9NoNd3cLh84QsQYUcuBO3uYONw68dPeOY2NCJwfrWxgTg9tEi8HzSCVddR0of2Ry4rO/BQJry3xFM9FqqhGghSy1/SGEXc7029L6/AyuLCmQ2/0rsN2dJMyRWVsWtoCY2uPvoO48jwhh0TJ2OVd0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607978788290716.4207245555419; Mon, 14 Dec 2020 12:46:28 -0800 (PST) Received: from localhost ([::1]:59366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koujh-0000ev-Sa for importer@patchew.org; Mon, 14 Dec 2020 15:46:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kouYG-0001qI-GU; Mon, 14 Dec 2020 15:34:36 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:20005) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kouYE-0007wB-Ib; Mon, 14 Dec 2020 15:34:36 -0500 Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 15 Dec 2020 04:34:32 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2020 12:19:51 -0800 Received: from cnf006900.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.62.52]) by uls-op-cesaip01.wdc.com with ESMTP; 14 Dec 2020 12:34:33 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1607978074; x=1639514074; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UXfR7yx7NJcqhSL5KrvP2pJM0clSZ78wWV9a/1rBfMc=; b=PEvUwz5Z8E3fH1zt2h7unew6ZCuqQvl2FYcJgcxlVLAutSmFgj0QDx+N cwAKIOWwhDtYB72LvCNpJgDXc2SDI5fBMyprAmtLhhi11Lb0GHVlJm3Su oYoNFZJIYA58n5XZLfNY1saUAajSnK5nOOVouDx8TlPavGHJKcD2aojcU wV8dEXrWByze4USto0LFTMeW1W135hFbKKBaszcu7gXT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h8rfe6vVKowAq31YVJK9T2JD3frLUCOIBBz8L7TyL32dOgmhUfRCAKCEcu+P3ZnWT/ /YE= WDCIronportException: Internal From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v3 13/15] target/riscv: cpu_helper: Remove compile time XLEN checks Date: Mon, 14 Dec 2020 12:34:31 -0800 Message-Id: <1d0407a7fd46da8eb17315fa9450021f13722fed.1607967113.git.alistair.francis@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=68.232.141.245; envelope-from=prvs=61015ee87=alistair.francis@wdc.com; helo=esa1.hgst.iphmx.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair.francis@wdc.com, bmeng.cn@gmail.com, palmer@dabbelt.com, alistair23@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Alistair Francis Reviewed-by: Richard Henderson --- target/riscv/cpu_helper.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index a2787b1d48..1fc9273cea 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -446,11 +446,13 @@ restart: return TRANSLATE_PMP_FAIL; } =20 -#if defined(TARGET_RISCV32) - target_ulong pte =3D address_space_ldl(cs->as, pte_addr, attrs, &r= es); -#elif defined(TARGET_RISCV64) - target_ulong pte =3D address_space_ldq(cs->as, pte_addr, attrs, &r= es); -#endif + target_ulong pte; + if (riscv_cpu_is_32bit(env)) { + pte =3D address_space_ldl(cs->as, pte_addr, attrs, &res); + } else { + pte =3D address_space_ldq(cs->as, pte_addr, attrs, &res); + } + if (res !=3D MEMTX_OK) { return TRANSLATE_FAIL; } --=20 2.29.2