From patchwork Wed Feb 23 22:31:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 545230 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp1092787imn; Wed, 23 Feb 2022 14:48:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBb80EmKEvovvurKfGI6N2iAZ3nPIcRLLDLASGOpdRyvEbm50m4S7ppciAFDl3BiQZ9bo/ X-Received: by 2002:a05:620a:ec9:b0:608:292f:8479 with SMTP id x9-20020a05620a0ec900b00608292f8479mr1344qkm.328.1645656507100; Wed, 23 Feb 2022 14:48:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645656507; cv=none; d=google.com; s=arc-20160816; b=XJ2swLpq97jquVpzRlGF78BoBsPwK6vGsQKgIyY/G9suPuehofohbcGFnK8J99NHGc HnFHW7EWisb2WHHknBt68GVcDurHTMXn5GpO1WrDNjpFdcyPcgu9xgS93QXTE4zqNtJ/ Uskz+tYqKK7nsFwm/2ymfR3DxGMHIU0PB/yzAm5JlVs4OK3dmk5Z35w+WMeMXdYYwLEp 1x1PeNuPg4qQ6/8QVVeawu/3cZW8BlXcsz3b2kR1DpYjuncOd9JascBtczQJ03IaruP9 LnILkcAFwNHJjALzUPk4HvjXZIHVh4WZPxg0TmOzldK9X5c0rVAr/VVPnJzbJGJWE7HU UGig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=iuG8ohkKwqyyIJ7svsXNRHI3s70BPYfliw43HdSQEsk=; b=VQqyYi4V3c+FZxHJbYxOTQgwDUhnH6pdoQzW/5QSduqglDtSmgpAkjaaHAqoL57mE9 TiXWSBoGOmv+Pay8eD4mfXJuF2hiMPfZRiZFZ6WUJZmyVlDvciES5krI6xrZs14HF3l7 zZjKsYpL9EnoZ3hE2F2qwZjjTqN2Mcviz6pzf3eec1beS10b2AVPbVGwix3Xh/8pwraI QIncDY3TE3ycVe1u0SOizhd6TPZYYVDszbSP1NZ9pjnz1YSRCjoahTlNXUNpfmAGFD7E Ckwa+1Va/U2EKet2iiPWQ3naDdwy/wLsBy+OZvL227SEFrxiJCmnZ4hAEv9TP7boxi/f vzCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WddS2ivj; 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=fail (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 bj3si579988qkb.712.2022.02.23.14.48.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Feb 2022 14:48:27 -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=fail header.i=@linaro.org header.s=google header.b=WddS2ivj; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nN0Qs-0001hA-N4 for patch@linaro.org; Wed, 23 Feb 2022 17:48:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nN0B5-00079z-Sr for qemu-devel@nongnu.org; Wed, 23 Feb 2022 17:32:09 -0500 Received: from [2607:f8b0:4864:20::1033] (port=55291 helo=mail-pj1-x1033.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nN0B1-0001Gr-DQ for qemu-devel@nongnu.org; Wed, 23 Feb 2022 17:32:05 -0500 Received: by mail-pj1-x1033.google.com with SMTP id b8so295351pjb.4 for ; Wed, 23 Feb 2022 14:32:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iuG8ohkKwqyyIJ7svsXNRHI3s70BPYfliw43HdSQEsk=; b=WddS2ivjSWfNCTiD1OOwywbmtXYERS9f9cKw9sBPsqwsdwF13gXFDZQXznIoHcZ6Z6 VQyCOG8v3AIC8azqObcb5p1dJP4zfkF31qkZiNoGUpICs1dEeyge0k0egcw27mUk+1+G ZonCBG9cj/spNu8efQYMwJO0gZAVWYP/+ThksB3Cr9G0xgYPv1QrNAPT7iGieyS+nKsp wuHI/Aa+rIX+6PdRKmlm7b/toLTQ2r1sQtyJM2bckxJXM3t4BDGO53Albqq2N5sRin+n 1F6vAsntLlGT/B78qOj2I3pbAG6husIZN2qPjs23rJMvmvKC4pKBZgyP/cUmjzIvHWL9 nkIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iuG8ohkKwqyyIJ7svsXNRHI3s70BPYfliw43HdSQEsk=; b=00mG6k8VeAgJ/34NIommAhV/CbuURrmKhHpLr6t+Mh3kpvr7izp7tBLmgituKJQBEW XnO6n3n6qEcZWGnhDzG5aYkYTDznP7br5aZ9UCxBAC9lA8Ix6a/BFrXC3/QpAMg7/4Ta lOZE59yFiFrTyQ06MsCGiFlkG3YUHJ+AqZy0qVcMIYm1DXlOUda/VFFTURPrWwcZk9WF eUVRF9ct9F/vFFVA0Aysjx3LtIWP9Eq4kk9PB/Bpuc+QFG51JmVvMXfX+21GER/GQU+h fq77csLWqfAq4b1J3+nT104wjguZMloaJ+QcbDzkS5B2y7Y/cB7hagV3n+E0Oh4Famqg tFWw== X-Gm-Message-State: AOAM531MzTjarjewntJjU2xt86NU171pmcUm4plTwDdS0uZJobOzzsPP msAMD4hklPZGlEwObuG2koyYvsRsqg3s8w== X-Received: by 2002:a17:90a:4043:b0:1bc:450:df68 with SMTP id k3-20020a17090a404300b001bc0450df68mr11308406pjg.120.1645655521450; Wed, 23 Feb 2022 14:32:01 -0800 (PST) Received: from localhost.localdomain (cpe-50-113-46-110.hawaii.res.rr.com. [50.113.46.110]) by smtp.gmail.com with ESMTPSA id f8sm533815pfv.100.2022.02.23.14.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 14:32:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 13/17] target/arm: Fix TLBIRange.base for 16k and 64k pages Date: Wed, 23 Feb 2022 12:31:33 -1000 Message-Id: <20220223223137.114264-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220223223137.114264-1-richard.henderson@linaro.org> References: <20220223223137.114264-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1033 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- 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 31c2a716f2..e455397fb5 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; }