From patchwork Mon Nov 23 11:42:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 11925031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31545C56202 for ; Mon, 23 Nov 2020 11:44:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9CC8720758 for ; Mon, 23 Nov 2020 11:44:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="I7CbLDZ+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CC8720758 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khAGc-0005zJ-Dv for qemu-devel@archiver.kernel.org; Mon, 23 Nov 2020 06:44:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khAFh-0004Dx-LS for qemu-devel@nongnu.org; Mon, 23 Nov 2020 06:43:25 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:36103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1khAFc-0002eQ-Ae for qemu-devel@nongnu.org; Mon, 23 Nov 2020 06:43:25 -0500 Received: by mail-wr1-x441.google.com with SMTP id z7so2449585wrn.3 for ; Mon, 23 Nov 2020 03:43:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=60shXaWLqPtiw2PDg/2z7RXNgbXvTsuPrfA/VmL6lhA=; b=I7CbLDZ+B4mrKiI8Ld3AAJhjqj5NS3nX4HomQd3RUZkcqbpYuqwHPJtVdVcyzKT3K9 w+jXIkE4QmeFM6YgrXhkKRMnwkL4C08QGt5OUgSFD+wc52SRT1vXl6s9zIOqI2sqEPP/ jzjOJFBezn4hPC1uxuLc0Ux2SJpv6CZrPnn4/ZqTTEF9A7dpYfm7qgn2LPwVAK/KjEXK khamHwqX9Hr/dvbo5xNHwlI7Xz69j3hSVjQvNNjetpfDiCmXgI1/NbNvTA0T/lwZJ4+v HDEtfAzphXvVRFLPEGnXVXy7jvKV5AUKRjjoBcAhvPL6Cb4jcOG/teJv7VUol6L9cjET rn/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=60shXaWLqPtiw2PDg/2z7RXNgbXvTsuPrfA/VmL6lhA=; b=TDIEbWRlDS5r6AW3nqF3BDWSLcwLUgE3I/YZRd6pVfw1ZBcaQ+C/+cYfEMyR8pX3o8 WCzLtMOIF1Jglx0Q/48L/xB5w1E4REq1EOSOt9pGHXzfBEoutv1CCH/dGUxL06cvCvDR tEZBDdRhFaF+lZUs0Ztn0Cv2WYG9foUJIcH67ldgL7er4U9D3v/PSHRSyJWrBdXe+NPQ EzFM6yxxPSJMCpBVuKMu+wgf6O6NttlWqcZv8wbbkbNtO3vofuLyvNLc0Rd7EyidnU3W 3IbBv1uopIxK9WDSRLF3qMVhPLOW6BrseHvb06HwTVpiIZj+kfA1Sfjl0wUTJKrMTA9v MlxQ== X-Gm-Message-State: AOAM533JMFliHxu6i/ES9sOQkwO4uvGeIDiwZ3KG7miX85Qphk8Lv/VH LReigUZZOTS8YxPp0PcK/LA8n7nTEJjtZQ== X-Google-Smtp-Source: ABdhPJz8LDSwXpEzj2g8vlsxwflishAiyFebFLJf5Vqhz7lvXCXOPK9bTRhPkPI+ka+dPIKSLfL0Sg== X-Received: by 2002:adf:de12:: with SMTP id b18mr31383111wrm.187.1606131798672; Mon, 23 Nov 2020 03:43:18 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id g186sm50836495wma.1.2020.11.23.03.43.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 03:43:17 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/24] target/arm: fix stage 2 page-walks in 32-bit emulation Date: Mon, 23 Nov 2020 11:42:52 +0000 Message-Id: <20201123114315.13372-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201123114315.13372-1-peter.maydell@linaro.org> References: <20201123114315.13372-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x441.google.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_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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Rémi 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émi Denis-Courmont Reviewed-by: Richard Henderson Message-id: 20201118150414.18360-1-remi@remlab.net Signed-off-by: Peter Maydell --- 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 11b0803df72..38cd35c0492 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -40,7 +40,7 @@ #ifndef CONFIG_USER_ONLY -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_idx, bool s1_is_el0, hwaddr *phys_ptr, MemTxAttrs *txattrs, int *prot, @@ -10988,7 +10988,7 @@ static ARMVAParameters aa32_va_parameters(CPUARMState *env, uint32_t va, * @fi: set to fault info if the translation fails * @cacheattrs: (if non-NULL) set to the cacheability/shareability attributes */ -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_idx, bool s1_is_el0, hwaddr *phys_ptr, MemTxAttrs *txattrs, int *prot,