From patchwork Wed Mar 2 20:52:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 547521 Delivered-To: patch@linaro.org Received: by 2002:ac0:f585:0:0:0:0:0 with SMTP id s5csp31379imq; Wed, 2 Mar 2022 13:01:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwKJYzP9KwwkOMUC8ojBDUsxzuFHWY6Y8f1B6/tq6RwX9Zge1rHQvzYfFcJexuvKh9G6VD X-Received: by 2002:a05:6102:cce:b0:31b:b16b:fde1 with SMTP id g14-20020a0561020cce00b0031bb16bfde1mr12165383vst.77.1646254892517; Wed, 02 Mar 2022 13:01:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646254892; cv=none; d=google.com; s=arc-20160816; b=Mpg/32hduQu7N5IusRnD1fOkp4lnJr/ZZN5yjJ/rPzIq90cNY86adq/6u+XuBpknIH YK7isiV1x2azYYaFVAwTfauoBqBBqGuIdzOzQLhQcL5kcWsNADgFr2blnH0YoN57iSuz ukqcDTL0JzK5TUyMXqHv8oV5GFBSnUDFBvOmFGKx9VRIewy3+uHBFs22KFz1ra5Vky/Z KzPl7XOdWi6S4HmJlcMi8WbTgcJELljL8GbMQrssxy30M0qTu2CFHut7d2POiGBSMAok 5L848T3kM42vhXkc/XgKb6ECWgIrwwXo0NlHV628LkdCwbcfcM2natjRbUt/8oxhZltd dTBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Drnno4VnFLtPbToNjmzneuITCSewrWEnfgXUqfz8b3M=; b=Js5k4KFIeE3W2OswzKOd7iDG94z4+y4zp9vJ/zXKfyj0NzGMPOQLN8UEsRNQxuBsss T+FojQc+14aXqP4DjaE7YDz7DLQe/K9TfDewMya8yrLtGmbUfF+pYqyQd7zQZQ+hgnLf rbrXJNx5eIhoO/LG2AjALGbBw+O4aBtueYE3XK3+zKRJ6Pt4Y8fyasThd9o/yi8UPhhK pRLrClOdqOBejacizVSCwhlWXEeiA2/ZXK71U3KnnmIGlnVnt+jJrTzhuvtoadvkQjwW 6lJPp7jmLD9XR5D3mynaUgS3EG+f1dMDsc5r0HYeCXJaCBRQpS50V6ydP1pz2lU61MK7 kAFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KZ69s9sX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u11-20020a67ab0b000000b0031ba558f294si6242vse.392.2022.03.02.13.01.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Mar 2022 13:01:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KZ69s9sX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPW6G-0000yK-0p for patch@linaro.org; Wed, 02 Mar 2022 16:01:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPVxt-0005s3-9v for qemu-devel@nongnu.org; Wed, 02 Mar 2022 15:52:53 -0500 Received: from [2a00:1450:4864:20::429] (port=45989 helo=mail-wr1-x429.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPVxr-0008Sq-Jr for qemu-devel@nongnu.org; Wed, 02 Mar 2022 15:52:52 -0500 Received: by mail-wr1-x429.google.com with SMTP id p9so4646503wra.12 for ; Wed, 02 Mar 2022 12:52:51 -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=Drnno4VnFLtPbToNjmzneuITCSewrWEnfgXUqfz8b3M=; b=KZ69s9sXpbZegzB6sASBbDezN8Ki+Kep2u6cijHbA2LiCnDSZr5aqeMMOZBhXELG4W FDqlCsq3PzRRuz/t2wgsAgJd/3vp1LAvcJvX8DeMTuSbZu/96pggfgnIZTb6HD0WGjHI AwvaikWF1lVfPsClFfN4wD95hbpy4Tj5MGsc604oIqpLFhj3RLOYARhNmcE4LqBBXMiD 6FluAyjiV1kOGO8yC0y1hEPcb6vCSZum4cw64XRZpbFZhV44FiQ1QeA4YRvgF1MV+LPT GGgUCvUj62Nk6ZeTP9WscLPk7QoMI6yJHEaewSTzxqUzWLClpplrCKEhUpfr+zgc522J pXiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Drnno4VnFLtPbToNjmzneuITCSewrWEnfgXUqfz8b3M=; b=Al5hlT2Dn40vaBRqtUIPjbBqE/3+aACD9dT/TTIAwb95WnQGtobbD0GlNWb+kidthS xqlI6ThoBhOXnYfWFuCtaTnCW6DRAkzEJw3R5HvyhzEqp8kKjn+YFg/u9M1m/XnHLENp e2ClQgIV0X7iEhKjswHmIlgOlKq7MS7c/Er+ayZ0N95Hefss1PsLdrt69yWIPLT3CCy+ GBw7mKiWnTbd3mDo3YiRH2zb1HzwvnJ7qWVAUv+H+FvXbqWgFv5Di6DlhU3EVJQFS6pr onw+edowQQ8uokgfOA3To/TlyYcdfQvzxWOyJ8BvC58aK+5ArOfl2Q3Hv0nQJHeFOjHY i5JA== X-Gm-Message-State: AOAM530ILIg7jYPUXFOUMIpL8RzkiqVMuklNooIv5RkhMmVgFBVYFvWi V26wZLzzlEXxbJ9rjCdUgfvEFRC7yKyMoA== X-Received: by 2002:adf:e6cd:0:b0:1ef:db24:7ad1 with SMTP id y13-20020adfe6cd000000b001efdb247ad1mr10717215wrm.233.1646254370308; Wed, 02 Mar 2022 12:52:50 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id x13-20020adfec0d000000b001e31279cc38sm90801wrn.11.2022.03.02.12.52.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 12:52:49 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/26] target/arm: Fix TLBIRange.base for 16k and 64k pages Date: Wed, 2 Mar 2022 20:52:24 +0000 Message-Id: <20220302205230.2122390-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220302205230.2122390-1-peter.maydell@linaro.org> References: <20220302205230.2122390-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::429 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The shift of the BaseADDR field depends on the translation granule in use. Fixes: 84940ed8255 ("target/arm: Add support for FEAT_TLBIRANGE") Reported-by: Peter Maydell Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20220301215958.157011-14-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 31c2a716f2a..e455397fb57 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4538,10 +4538,11 @@ static TLBIRange tlbi_aa64_get_range(CPUARMState *env, ARMMMUIdx mmuidx, ret.length = (num + 1) << (exponent + page_shift); if (regime_has_2_ranges(mmuidx)) { - ret.base = sextract64(value, 0, 37) << TARGET_PAGE_BITS; + ret.base = sextract64(value, 0, 37); } else { - ret.base = extract64(value, 0, 37) << TARGET_PAGE_BITS; + ret.base = extract64(value, 0, 37); } + ret.base <<= page_shift; return ret; }