From patchwork Thu Feb 10 04:04:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 541377 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp1924781imo; Wed, 9 Feb 2022 20:14:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrKBUI7GJn7O0eAQcSXzPyWrOxNEdI7VZQJYdIXXxeV63sXHUiDdvqsAsSyKMycBpmnajp X-Received: by 2002:a81:ae07:: with SMTP id m7mr5277731ywh.269.1644466451547; Wed, 09 Feb 2022 20:14:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644466451; cv=none; d=google.com; s=arc-20160816; b=OI8OIPaHA1sC7RUmzy7Ia96EC5iniCyPVzN304qYXLj2tuArNHYFEqJFIbERwOqWUp T6lusYlFudQrjhiYZWRQbXbx8v65LZt7ZM31vLdxEAoKdF7sRXSuVwxtebRh/69mwnw7 YIVs2sCOe0RFzmz9WUqX/6AC0mBjZ4E4NqWIoNxiGzurvQTviAYFaRg7GpIbivRqltHr XHb8bb4yjEkDeJ8F9QOaaLXx3bJUmA9qtTnFekS6TdDXfZFY6PQKJq3VXOZPyRR0V5Zg Huq2l5tgjoqak57tID9IX8eOxacn2tKZAJzgJAcqaqlp1Bt6zxKeDsUQxbuo/CjVfdQr 8w0w== 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=ySk6DI87bH3eZGMitydYEQW5NydufZmFbEicSz0knRM=; b=sxr2dglxfhUJbE41R+lKzahDEKhkO8dXPp4BoXcUNT60FLvdTdsaX1Os32TSnGfGyR M37o/5Oo5LVvGR9av05raHVocbfZx/4jkO13Tt4rghzxYucLkvvjNnqvDlmAQLswoPJf h+4REdeO/MetCRxqt5xmeLener99oHuWAhBJC4m4JLS/fndMwtP3VDb78Jv6klYLYlo0 ILeUdDW1ZAE8BfCXzzEGOkekdN1y2lge9Kud4sHl0uZte90lyTGwwatzd+JTViOc7i1T Fe+CM34dIwZbLY5mhFYVYsMpszPsb4wR1Pun8oSoL7XRNoikiYvEOklOLXStw74buIxh u5cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="dpyNdJ/F"; 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 b141si2812536ywh.197.2022.02.09.20.14.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Feb 2022 20:14:11 -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="dpyNdJ/F"; 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]:60836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nI0qR-0006ob-06 for patch@linaro.org; Wed, 09 Feb 2022 23:14:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nI0jc-0004OJ-Vo for qemu-devel@nongnu.org; Wed, 09 Feb 2022 23:07:09 -0500 Received: from [2607:f8b0:4864:20::434] (port=38792 helo=mail-pf1-x434.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nI0jU-0004Lz-Pj for qemu-devel@nongnu.org; Wed, 09 Feb 2022 23:07:04 -0500 Received: by mail-pf1-x434.google.com with SMTP id x15so5567832pfr.5 for ; Wed, 09 Feb 2022 20:05:09 -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=ySk6DI87bH3eZGMitydYEQW5NydufZmFbEicSz0knRM=; b=dpyNdJ/FKi6Zmei/B8RXxNVHE0F3dnzClNKC/Chn7jfsgSbMp3Z3ZHnZzZhJi6TYeU Y4qToCWUSvQpHzFZVHK/yPcNTMajdFG80e0m8eYIg8Vldv/tZrVXdvjhYGoPpyxSVw3w PBSgLGUdJjLsOfADwOPKNzXFuoNOSbVihRAfWsKGoKTzlIUDl1JQ4BOD3/pi4Eqr62HB tAoFBAcWnn3nG1W32czzvmMVzyTz9OFd41t2Chl6k5tWichkJmpJdiI8BzftUMpzdNW7 qz49lRXNYlCdYFZ6x9CcYFG71NNNp5VuMLaUwB0Dm6ieIYqfwhWuMsht6FvFha4mygMA Qetw== 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=ySk6DI87bH3eZGMitydYEQW5NydufZmFbEicSz0knRM=; b=p/72x6rYe6dzasazGN/jF5jykF6OKd8HBJxnlpLyda0aJ/nATZHM+pFRbQUoWfwKVl ILaZXbDN1dBX2iWzdYWvin6QOZKql+Q8pXpuf/alEYTwGmYO+bee0BwqKojagavF+6ov 05zygPrR1CEMxXaT3FdjwkVygy7K4eFq6u8LShwffMRslPaIz3eyG+lWmR9VBiCILh9a 8oJi2xp+UXcFCIO388wmHyYG+I3h4wK9XhZPfjtss7WLL6Yy36VP5ELEPfOFIGRzMTuJ LzQAt8tLlbOy271AhPMTv/sK8FuOcYnfIRlhQLM9GZExEN4MNtle3zi71OhNfMMry+N+ Cc2A== X-Gm-Message-State: AOAM531cuq7e6PlQI8ckNOj5FztvPZ9umD2bSWNu7k3odQDF9BjQNIkY k130/GmDqBo++1xcIW6MhAu7KnDgqdG60foK X-Received: by 2002:a05:6a02:195:: with SMTP id bj21mr4545558pgb.277.1644465908969; Wed, 09 Feb 2022 20:05:08 -0800 (PST) Received: from localhost.localdomain ([124.189.222.164]) by smtp.gmail.com with ESMTPSA id y4sm9749814pgp.5.2022.02.09.20.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 20:05:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 13/15] target/arm: Fix TLBIRange.base for 16k and 64k pages Date: Thu, 10 Feb 2022 15:04:21 +1100 Message-Id: <20220210040423.95120-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210040423.95120-1-richard.henderson@linaro.org> References: <20220210040423.95120-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::434 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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.001, 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 Signed-off-by: Richard Henderson Reviewed-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 8b1899ceef..e2551e693b 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4536,10 +4536,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; }