From nobody Tue May 7 15:03:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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 ARC-Seal: i=1; a=rsa-sha256; t=1605712396; cv=none; d=zohomail.com; s=zohoarc; b=PMcI+OdztBS9MtJld+b+ZK5o/VpcF0MN8CFg+oKKfz+UfjwTnN2Ele2Lbq3gsjj7TwSC/GTGZ4bKcu7kQHKe7It4YIC/6k/07di53Q9VvFnpXPxu8NlhUn8TUJahX08DtX4xBCup7hnUSinunZjlMs0cAXVQcc354tIun1bIdi4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605712396; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=6s82WB+8tvuOYlghTqFLNpnIelzLv1lqaVsobXhv59E=; b=bKilXpgnl7bqYgGRWyHPnyeiZOF6RkOYPrEDyJz3/gWkobR9i3zH7FEKTJy7qpc4Ut8fRVwr5eM0U+SXpKzkbvP+Ry03EGl3hAUX8cW5i15T7tmANyMhFtJFFSbbiIRz1O9AQ/bHHvhKvqa0+mmsUqdlvvE8icbEXA+KHskbCsg= ARC-Authentication-Results: i=1; mx.zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605712396220915.0703766187182; Wed, 18 Nov 2020 07:13:16 -0800 (PST) Received: from localhost ([::1]:60598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfP90-0006Qx-Jj for importer@patchew.org; Wed, 18 Nov 2020 10:13:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfP0g-0008AB-PA; Wed, 18 Nov 2020 10:04:38 -0500 Received: from poy.remlab.net ([2001:41d0:2:5a1a::]:49734 helo=ns207790.ip-94-23-215.eu) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfP0Q-00077n-AC; Wed, 18 Nov 2020 10:04:38 -0500 Received: from philogene.remlab.net (ip6-localhost [IPv6:::1]) by ns207790.ip-94-23-215.eu (Postfix) with ESMTP id 494025FA5F; Wed, 18 Nov 2020 16:04:15 +0100 (CET) From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= To: qemu-arm@nongnu.org Subject: [PATCH] target/arm: fix stage 2 page-walks in 32-bit emulation Date: Wed, 18 Nov 2020 17:04:14 +0200 Message-Id: <20201118150414.18360-1-remi@remlab.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2001:41d0:2:5a1a::; envelope-from=remi@remlab.net; helo=ns207790.ip-94-23-215.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/18 10:04:16 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=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: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: R=C3=A9mi Denis-Courmont Using a target unsigned long would limit the Input Address to a LPAE page-walk to 32 bits on AArch32 and 64 bits on AArch64. This is okay for stage 1 or on AArch64, but it is insufficient for stage 2 on AArch32. In that later case, the Input Address can have up to 40 bits. Signed-off-by: R=C3=A9mi Denis-Courmont Reviewed-by: Richard Henderson --- target/arm/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 11b0803df7..38cd35c049 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -40,7 +40,7 @@ =20 #ifndef CONFIG_USER_ONLY =20 -static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, +static bool get_phys_addr_lpae(CPUARMState *env, uint64_t address, MMUAccessType access_type, ARMMMUIdx mmu_id= x, bool s1_is_el0, hwaddr *phys_ptr, MemTxAttrs *txattrs, int = *prot, @@ -10988,7 +10988,7 @@ static ARMVAParameters aa32_va_parameters(CPUARMSta= te *env, uint32_t va, * @fi: set to fault info if the translation fails * @cacheattrs: (if non-NULL) set to the cacheability/shareability attribu= tes */ -static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, +static bool get_phys_addr_lpae(CPUARMState *env, uint64_t address, MMUAccessType access_type, ARMMMUIdx mmu_id= x, bool s1_is_el0, hwaddr *phys_ptr, MemTxAttrs *txattrs, int = *prot, --=20 2.20.1