From patchwork Tue Mar 1 21:59:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 547269 Delivered-To: patch@linaro.org Received: by 2002:ac0:9f50:0:0:0:0:0 with SMTP id l16csp4070306imf; Tue, 1 Mar 2022 14:12:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2BbMWckZFmxHciBhLrq+OBPEqi0++++XhCfS7aMj7rNzH46s2DrhAH/k060aPpTJbbXdK X-Received: by 2002:a81:9844:0:b0:2db:db74:f7db with SMTP id p65-20020a819844000000b002dbdb74f7dbmr5606810ywg.359.1646172750940; Tue, 01 Mar 2022 14:12:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646172750; cv=none; d=google.com; s=arc-20160816; b=iAzGMhQcd5If5yPB8915HrUnlWYSSk6JCje356NN2AVUndgTxJS6WvjGs4ifX+W7D+ U26Po3IizdfVMIHf3Wr5E7/P8+i/M3w4AXln/lSal2ADxo73lcoD5OnOYyPdGMEQP+Rr EI3uQbkmxuy7Cl8MFc5UTb3/FfV3x2YgezMsYDq34SyNWQM3U98fMmZIoTWSNzoCXggP Rb5Na8S54jMkmE1VNWWjTTqineXVXad0NarsKkx02W24rC2jbJ7yXU4R/bok0RpeUaTA elO9yHJYoNkBqDyhFj5WqXUdqRb1zeqSjjioGbGhl62Cz3c6NjS7+5Ej1VzN2FBNuIq2 G36Q== 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=YegY33l89ptYeEZamUvG4cQGlHv/JZGnd8MAa4yhcB2qpalKBeu9sRG2jEVg/lRDfT GBGdBFsc/BxUmZ6x/qLWgcym9BrjzVG4m9LxqbHPyWAvZ4WNro3XpLVbNQHmwDWZ42an lxiSaqUyXvJvlXbXfpc9xg1OhQDBAu42CI5/R50p6kcmdMHoEn0N4YdZstaaUI18FXVr 8Yrwh5+2tXtoj0eWF+7LB94YCAaHnn1zuMXfNo/tFBUVCSdU2+R1rFUZA4m+l5ICL//M j9OhvIDhT6Bxe6dQL2n4kU2w05dTlKfIvbhsdJH3Hkd1CbVgpMgZBrSZqe0Gnw8YIA4S 1wVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=v6vhctFG; 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 h125-20020a812183000000b002dc03926e2dsi916482ywh.389.2022.03.01.14.12.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Mar 2022 14:12:30 -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=v6vhctFG; 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]:55246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPAjO-0001z7-EG for patch@linaro.org; Tue, 01 Mar 2022 17:12:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPAXi-0001MT-1K for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:26 -0500 Received: from [2607:f8b0:4864:20::1029] (port=45892 helo=mail-pj1-x1029.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPAXg-00055C-9x for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:25 -0500 Received: by mail-pj1-x1029.google.com with SMTP id m11-20020a17090a7f8b00b001beef6143a8so47918pjl.4 for ; Tue, 01 Mar 2022 14:00:23 -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=v6vhctFGtQ9+UuTVknMXPWTTC4GFlxgV3M6vlHVEU/BYRvyePLI+kh8gjOG3ssREou xGKIwLKegECDh3fqaNNJ9iNWIchFv9H5qJtgE82VNlL9UsBRp867UZGfb8aarEz1hDbs 2nWXGx43oqz53sQdyrF/AX9Ar66/YUvRcDTxGzZjcOK0fL/ij/iiT5aLL605pK98RQ8Q bJL1Snj0/4hkQRAiW0U+CS0cK7Cl6I7TmttvfkxzR1MTH3rcsykpWlIw7yhIf0z9KGqt HhRahD9ThmgunpeEXKtV6vaL+j0JlSgfslCeasi9GjAfLAOPH6NuMVWE/9TE01GN1j4K COWw== 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=4sebbOTtnVkDY8perr9VIz3c0JasYTJn/EtPTCph31Zju7r8HMQfKR16KCJIWc4fdP iWRnsIp3ALLEtl+7cdww5UCMm5DVpE70gXbI8HnQNXE9xBFMjTlcFVK1gPGONpq2JXeG 74PUNjqS7MwnHGmnfu1Q4qnsjDq8pP6TCiim8eTnsdBDFX856OCsmu+Nsjs9uWMGD2TJ /GbEkZzzzVbHuyrHlAqk4L/Rd05umgrlr2BLyA/VJ9+SgYhfqfMhay0twALrKahdx5RR 9QnnJMbnsbXA2V76xCScJnnD4eLH8nUcm+ijjoEciWLo2LNQGz7KEapMvGOt9xLBDaoY Me7w== X-Gm-Message-State: AOAM532KFL820gU3HD6eVBsCO2auqTDIfzRWUry2/rJjfzNJuyZmInep lYirpJN6IMVGO0Qdol4ZDJCk/LiX9+vSXQ== X-Received: by 2002:a17:902:cacb:b0:14f:ef7f:b0c4 with SMTP id y11-20020a170902cacb00b0014fef7fb0c4mr26480658pld.135.1646172023148; Tue, 01 Mar 2022 14:00:23 -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 m4-20020a17090a7f8400b001bef3fc3938sm284392pjl.49.2022.03.01.14.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 14:00:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 13/18] target/arm: Fix TLBIRange.base for 16k and 64k pages Date: Tue, 1 Mar 2022 11:59:53 -1000 Message-Id: <20220301215958.157011-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301215958.157011-1-richard.henderson@linaro.org> References: <20220301215958.157011-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1029 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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; }