From patchwork Fri Oct 11 13:47:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 175970 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp805352ill; Fri, 11 Oct 2019 07:07:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUEfhcOSboMNY8Pb9mk02aeVCotTqFDBCl9xWDOfJk/wsSDzOAZ03SpsDE7YwXBtnEojoJ X-Received: by 2002:ae9:f204:: with SMTP id m4mr13185154qkg.300.1570802839405; Fri, 11 Oct 2019 07:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570802839; cv=none; d=google.com; s=arc-20160816; b=sTNUvZLkL7ia1h5V8cyd1Uk//xjzln++rWZuT1NO5STQKBg+vzPCCz+sphbKCLQNxh Mc2Wu9cqaae9yvdkc/cm86z9Im1CzLblrrm5scFZE4GVkOnpnsPRV91tsB5287BypeTp 2US1vb+OXdhOWBKpLnBOUrY0OlJ+kXqyOxvIPHYV4cv+bkCL3QEI2Vh+BP4TJLh1JfUy /+AatEnPaRaycGYFHhUNUzyD9a4RMvJAQm8i5i0R6N4sDVnoMSf1+lmfS9aS6JCTz1f2 tNX8YJIFrnJpb1btz3Ay7sNlRhpRRg/elP5KmngII86XukT17LJ7njKqHv95UOMsUZJp Pv1Q== 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:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=fmdmkU2Zh+ktxeMt/gay8d04S3LmhLt8jnMCWxeDlf4=; b=xKUXZISwPa6e+I2BEhH7GXFOI+zy2w5+8ERBLwaUKqMentuwecC96Jd/eYhW5sdbB9 UzCHqzaHKZ+9KKVQDRwkyU/4x5Qb0xY/Bj2MZ6JCgPMuxtV+kqKRgw97IdYQyDs8vjd+ 19FnQ1VIFUbFpragW6pt3qPbIo643qqMQa5SajrCm+3O67QwohRlTo005fKSLc5z+a5P kZV2OIB7s5CaGdqnnKsqXYs65NAUkU2diPj9tLgBhoGf7V8s2UPHhpmUV5TZAIrUDclY GPva0rS+xvO4ZE7VUG1nJMRcjsj6mZi7DHMphlpnB31cHBdtv6ZZeIh1uqYdd1qaNScu eJrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JpUbxzlV; 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 q31si8994479qtc.224.2019.10.11.07.07.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Oct 2019 07:07:19 -0700 (PDT) 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=JpUbxzlV; 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]:50922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIvZe-0000mt-Pv for patch@linaro.org; Fri, 11 Oct 2019 10:07:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39329) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIvJN-000674-Bi for qemu-devel@nongnu.org; Fri, 11 Oct 2019 09:50:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIvJM-0004BB-4Q for qemu-devel@nongnu.org; Fri, 11 Oct 2019 09:50:29 -0400 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:41703) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iIvJM-0004AU-0i for qemu-devel@nongnu.org; Fri, 11 Oct 2019 09:50:28 -0400 Received: by mail-yw1-xc43.google.com with SMTP id 129so3491536ywb.8 for ; Fri, 11 Oct 2019 06:50:27 -0700 (PDT) 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; bh=fmdmkU2Zh+ktxeMt/gay8d04S3LmhLt8jnMCWxeDlf4=; b=JpUbxzlV4uswbaJPDJA8Y/qbYUEc3BtqiTXRjynxmYcnPhpxsZ0WznseAMeS30IM9D w9a28hzfzLtCCBcblxOgzxDAzdiNjQ3Hx4u1y1rYsISXQ3U/N1lkv068KJF5pLhYf31u tmbdGXR+Db45liCV35aWKu3TaGtF8HC7D6i1DrmwgCinoIvD2igLRJYxTy3Xt/V0Vcfd Vtl8LZjQZa0o2MYRHNkC0tA3EoN7LVFWP+NU+LY7zwyM6uwQ0IW0rqg3CJS0ZBl8GOmX 37ZrG8pluANeKZIp0zk8ji7CCLWj2+7jcnztfEqrn+Bi6KStmcZd0qdYPyzd0bLmaJ4x 8KWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fmdmkU2Zh+ktxeMt/gay8d04S3LmhLt8jnMCWxeDlf4=; b=hCLIKFVEBHAjaO++X854yjXhA8IVXgSRuSj2qpYJrs4I84tN9oHofE6n6mtRoJPN1a yOGoid/5jXLMDp+pcvrHeymLYTlI8a9b0fEPj6tmrXj13H5HfStU78GJBvNsiKBZtxFw fa+zwM3toy//U4tLAYYGXwQhWVnzUzDM/xXyS0mB4Z7IzHN+e12JX1dmnlT7HqoX6J7J Hh2KFJmX54hH3ne4vDzvQ0pF8Y+xaKDm9SV8FeNPeCHdhxjGYspqs7FYQ8nhisUwq0yj sqxUgUWecdjo0EnlvNAnFPWWuuF0W7jGRUQ6gwa0KjRPtGT5Fliw/4I5WNPA3ohOuna0 9NbA== X-Gm-Message-State: APjAAAUzXffMw5er4k8PuCIOZCXXy7hsvDycTUhfHPtsGRnbNpyTSf5H pwZ6OY+uqTrWA13/MbylF1daGbepq8Y= X-Received: by 2002:a81:f10e:: with SMTP id h14mr2471006ywm.49.1570801827105; Fri, 11 Oct 2019 06:50:27 -0700 (PDT) Received: from cloudburst.gateway.pace.com (67.216.151.25.pool.hargray.net. [67.216.151.25]) by smtp.gmail.com with ESMTPSA id f68sm2534000ywb.96.2019.10.11.06.50.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 06:50:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 19/22] target/arm: Cache the Tagged bit for a page in MemTxAttrs Date: Fri, 11 Oct 2019 09:47:41 -0400 Message-Id: <20191011134744.2477-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011134744.2477-1-richard.henderson@linaro.org> References: <20191011134744.2477-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c43 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This "bit" is a particular value of the page's MemAttr. Signed-off-by: Richard Henderson --- target/arm/helper.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index e988398fce..17981d7c48 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -9609,6 +9609,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, uint64_t descaddrmask; bool aarch64 = arm_el_is_aa64(env, el); bool guarded = false; + uint8_t memattr; /* TODO: * This code does not handle the different format TCR for VTCR_EL2. @@ -9836,17 +9837,21 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, txattrs->target_tlb_bit0 = true; } + if (mmu_idx == ARMMMUIdx_S2NS) { + memattr = convert_stage2_attrs(env, extract32(attrs, 0, 4)); + } else { + /* Index into MAIR registers for cache attributes */ + uint64_t mair = env->cp15.mair_el[el]; + memattr = extract64(mair, extract32(attrs, 0, 3) * 8, 8); + } + + /* When in aarch64 mode, and MTE is enabled, remember Tagged in IOTLB. */ + if (aarch64 && memattr == 0xf0 && cpu_isar_feature(aa64_mte, cpu)) { + txattrs->target_tlb_bit1 = true; + } + if (cacheattrs != NULL) { - if (mmu_idx == ARMMMUIdx_S2NS) { - cacheattrs->attrs = convert_stage2_attrs(env, - extract32(attrs, 0, 4)); - } else { - /* Index into MAIR registers for cache attributes */ - uint8_t attrindx = extract32(attrs, 0, 3); - uint64_t mair = env->cp15.mair_el[regime_el(env, mmu_idx)]; - assert(attrindx <= 7); - cacheattrs->attrs = extract64(mair, attrindx * 8, 8); - } + cacheattrs->attrs = memattr; cacheattrs->shareability = extract32(attrs, 6, 2); }