From patchwork Tue Mar 1 21:59:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 547262 Delivered-To: patch@linaro.org Received: by 2002:ac0:9f50:0:0:0:0:0 with SMTP id l16csp4065638imf; Tue, 1 Mar 2022 14:05:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwi9oTuXMM+OP/cs0HZyc7J9d2ulsR6XIu8phlkvB77kg563wRKvuA0o3JvS11bIM4/P0XJ X-Received: by 2002:a05:6902:203:b0:628:7b6f:2845 with SMTP id j3-20020a056902020300b006287b6f2845mr4907131ybs.533.1646172327095; Tue, 01 Mar 2022 14:05:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646172327; cv=none; d=google.com; s=arc-20160816; b=h6YgWH1r2vxnIPdfB+7cuUlwhwsF7XCNibLZIA8DExFr/c5WlOKVXPijhpM0QruqV5 SaBEeXN5j4l31KO3jiYC46kchhe6uDzHZCBo0NuKK+nkjwV6lGmgLinW3DXJn8B5Euov p/m/ndeudyMncr0MEsAiMw+HdaTUUUiUNEXIUcsmD546YrSu+MlwMf4or0WqMW37YZoI hopVIxQOP6cM6y+Ueu4TdyNFtW1tfwIp+9ZJYxHlMeFnTLtrKRo+adHNoaJphK40XAxn 9hSxvFNDnNx/mmxmN8F5G3F8B52kRfOtwssCTaqwa6H5aochHKd39rB3mccYIUYICwxs 389Q== 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=gIGj1SBy99bk76FDyotKqntArH5MW9KjKA2GprTkmIQ=; b=dGNCNKem9Y7WzoogDJWES1nL74A3Lrfqo77JH3uegNTJq5vzmp1PyfIuyVQbxu5U3g 2VeabCPXdvqADxie6pHkZ9V6Lkz9d2Nhr41pWWSns/5VcYxeLnu96nTQJVIki5zO3VT6 xX102kCUE5WqRGVfhDbcDgUn+NsRvKoPkX1zyS1eBzg4lrDt7HV3tJQv8DEt0w5vON23 8NGrOzuGa39mzzlI9BhFClNXikuhgzz8LJW853g1QEyRbeDwd5GO1oUU6QOMcs83YsWb nQnGhGofGlOn3+lkNTK9uNWW3lUTUAIhkfT8RPy9z+v40d5VjJkg+rRrN+VB4q73ts+J XrDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="ufj/OzUb"; 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 f126-20020a816a84000000b002db3b9bd86fsi9174043ywc.506.2022.03.01.14.05.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Mar 2022 14:05: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="ufj/OzUb"; 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]:38434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPAcY-0007KN-JX for patch@linaro.org; Tue, 01 Mar 2022 17:05:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPAXY-0001Hd-Tn for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:16 -0500 Received: from [2607:f8b0:4864:20::42b] (port=36650 helo=mail-pf1-x42b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPAXW-0004xH-BK for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:16 -0500 Received: by mail-pf1-x42b.google.com with SMTP id z16so77613pfh.3 for ; Tue, 01 Mar 2022 14:00:13 -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=gIGj1SBy99bk76FDyotKqntArH5MW9KjKA2GprTkmIQ=; b=ufj/OzUbqqQUDuTaXi3d9MgYlKLV9cHEpkT37DK9zFn+XCtbqYVLdyNow4JjEbF3Qq QvI5lk8sM5Gkg1wnVXxNS2KAa+rFlcrCR0x1Qr/AgFjfmwJ5k3qQ8xBtSF8TDNlDdtN8 yxXl+BTunQiP+U0vrBVX3CUyhPGITo8PaWJxSiPQp3Lt5E19VyyZs/pBLAQgRKLYmv46 nFjtKrh1ynLQAgmNyk3xNpKTZ4Rk9WM+644t00CrAiswWsU7YKLTiaE5LvFAe4lVK4Lr FKRZJEFhNhZNTSBrDg83ZycGZ00yB/5FSoStrNLXbRdsH2XBlKhSx6roiHSO3GPRW/fM RQfw== 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=gIGj1SBy99bk76FDyotKqntArH5MW9KjKA2GprTkmIQ=; b=ylJ1Xpp0GJT/3Q8L3QX5G0fSKNSjJTmQ28gC+bleXdWgyvNy9gp/QfUtgVO4bBDucD tEnDEMX8ddue4Iu0ClNV+oe914PQA4sASydOdBGGDqjcTYWyYk3cEtFaUGbOsM9JZzHX McXR2E2CbeJAUBafZciUfTHdIHqoD5BxecNECQoFnnxyOiE50pA4LTe97gg+ldo9CLXX htwYRYd1XLRKdZ688iIXzoZcE6ZAOp0KKkVUWhI4DkcO3XozChiAIDWJbRCLsv6RDSfl YHAK+S5OdvwP/feqr4VPr9FDipMgp3+ZRQ11LoQ/jbdeb8du02Wlt/MEBqUa7+ASUHbK 6+gA== X-Gm-Message-State: AOAM533P6sq0o23BpYB4W4z4FdH1mKbXwFu7rIiivFa4NiFosw5PvQlK 0PsO8e6n4q6rgxTJxsiuoL2gQjTjU2JRsw== X-Received: by 2002:a63:2c14:0:b0:373:7200:d07d with SMTP id s20-20020a632c14000000b003737200d07dmr23393129pgs.617.1646172012700; Tue, 01 Mar 2022 14:00:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 14:00:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 06/18] target/arm: Use MAKE_64BIT_MASK to compute indexmask Date: Tue, 1 Mar 2022 11:59:46 -1000 Message-Id: <20220301215958.157011-7-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::42b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The macro is a bit more readable than the inlined computation. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- 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 431b0c1405..675aec4bf3 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11518,8 +11518,8 @@ static bool get_phys_addr_lpae(CPUARMState *env, uint64_t address, level = startlevel; } - indexmask_grainsize = (1ULL << (stride + 3)) - 1; - indexmask = (1ULL << (inputsize - (stride * (4 - level)))) - 1; + indexmask_grainsize = MAKE_64BIT_MASK(0, stride + 3); + indexmask = MAKE_64BIT_MASK(0, inputsize - (stride * (4 - level))); /* Now we can extract the actual base address from the TTBR */ descaddr = extract64(ttbr, 0, 48);