From patchwork Wed Aug 12 17:19:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247638 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp550477ilo; Wed, 12 Aug 2020 10:20:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaqsY4wl0sLdyz2SWemmGhUI/uq/Qi4eSv5aIHo/L6hczv9riFOsAZNox61+iq7KYelZQC X-Received: by 2002:a25:6d04:: with SMTP id i4mr524724ybc.283.1597252832306; Wed, 12 Aug 2020 10:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597252832; cv=none; d=google.com; s=arc-20160816; b=pueSxFipqATSjbbLmusuuzPUP5HLLIwgtHldHsh7CovusADRobBOMdeXfEm5WyPCWL WUzlrNeXCW4vqsCHkDYwR9AZoXfs7zOPCXETOsjTzbNy/z7buy4mT+wMa0uq5K6nQPrX kvlp5YaQV0CfYlGyBIUZqcVtuLk5toNg/0ndqHsA0l4beLodi2wr8vFOa/KE/GWpb1zM 88e5EYb7+BwGmrgah12hyr3MJPnYClElwx2MOZnQm+Ogg+XACbm4YwfI9xZgKV9TeRRD fOkf66P4CnuKXzSC1jElwzq7X3Xmt4UDwGBNyZjQjcH12FBbC9jCj0yRokjMNtUEkb// okYw== 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=gkaf80e+VCqbV0BxEoX+BcAOlQwRYSyZFcs+VT/z7+o=; b=vSvscX1L9VYydQgJJvoaE3TJtwY+qpSOMk3H0xeu5jPn11dab+vEiUMUoeVT+nxtVB I0wDDqFaaSEXKifJgE0ahPjl4SJ1MnQUMCM6ChMcygLnvloI//gWBLkPw+sW1nc4p31O r91AX3fvNAayFWesc8EQkbEQirLdL6FbJx5u7VEsHN2pQY6tpMHU/1vCK6Nzq9lU7zQF auPudvKWJZzrGRqo6g4bjldp2ri0rFUVFoQ9TDshjcXaGLaoTkzRWeRVtKD+4sFMqxHc Y5OVhpSPu/689lfmlDVzRF/MRLbNb3VojJeeuhNK+4J861g6ZoeokmiK3J9jy4VHivLn cDVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mDb35vGi; 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=pass (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 z3si3194513ybo.258.2020.08.12.10.20.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Aug 2020 10:20:32 -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=pass header.i=@linaro.org header.s=google header.b=mDb35vGi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5uQR-0003sX-O8 for patch@linaro.org; Wed, 12 Aug 2020 13:20:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5uPq-0003ps-1o for qemu-devel@nongnu.org; Wed, 12 Aug 2020 13:19:54 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:35442) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5uPo-00018E-Ix for qemu-devel@nongnu.org; Wed, 12 Aug 2020 13:19:53 -0400 Received: by mail-pg1-x542.google.com with SMTP id o5so1392667pgb.2 for ; Wed, 12 Aug 2020 10:19:52 -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 :mime-version:content-transfer-encoding; bh=gkaf80e+VCqbV0BxEoX+BcAOlQwRYSyZFcs+VT/z7+o=; b=mDb35vGim9EgH3JJb/PyRIlq5ub8+kRd1Ba0zOmajcbNBeNz3KB1gUWxikbLT7OryE fuX4bWy5zKdUZAUM1TCSHJBi2+EAC+LMTHLHv9oqTf0M+szq6dU/o5CpZWMvQgy8RNJz TBzctLq6pZ413C4UYfWy6uSMM14uHOxuvKOJKTvUGmwJPoNYHu7KtuDeVZFLmsVWXH7N RDiUVH/vIq7tU/XKK1auJ0oPAwsA8LLEp8QzJl4RDNZFhTxpGihhQkSdAemfFkhGACrk vPV9xlkJkbD1yN6vQ5afLK9Cg0lz+QFvDQUNMsWbHBZacSp7oKEiyGNYcx3mDbCCep9O OELw== 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:mime-version:content-transfer-encoding; bh=gkaf80e+VCqbV0BxEoX+BcAOlQwRYSyZFcs+VT/z7+o=; b=TbgwgEIB/9e7By8/fw07PkYfyrMeQCtcIyp2OhEAqRUrV51HJFxp6eVrtC7Bjtt39Z gCOEoG+q65561uVw1w39mO3lHUpXj72/yFGCNq8s1OSn0py9g+DNv6ubHIxN2K1hwiAs 9h8MY9QOelCOzs+X05SfCBPht/dTM1jZmYjBUS7ldNIRZrZ/mn71pSs3EiJzpqDZRoMx AfzcubZ5+zo6/l8gIESfjfCjSnFOKMaxFNcF6ui/1G+ngVsofk5f2ZMvrm6/QOIoh+I1 cdsTbTzz/juIjwohom0HuHfyibIdo3vS1K2pEFJbz+jZr4gKMc8NzMeHHHh4gJsm71AF oLow== X-Gm-Message-State: AOAM53149iv6w4JZdHEQ+9JGeGqjrhCH++DG3Ra3XqQSK0fJPJS+dcP8 9ujEL+Raj7EUWwgLXHMcu2/h5hKAQDc= X-Received: by 2002:a63:5022:: with SMTP id e34mr158542pgb.384.1597252790887; Wed, 12 Aug 2020 10:19:50 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y79sm3097206pfb.65.2020.08.12.10.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 10:19:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/3] target/arm: Pass the entire mte descriptor to mte_check_fail Date: Wed, 12 Aug 2020 10:19:45 -0700 Message-Id: <20200812171946.2044791-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200812171946.2044791-1-richard.henderson@linaro.org> References: <20200812171946.2044791-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Andrey Konovalov , Vincenzo Frascino , alex.bennee@linaro.org, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We need more information than just the mmu_idx in order to create the proper exception syndrome. Only change the function signature so far. Signed-off-by: Richard Henderson --- target/arm/mte_helper.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c index 104752041f..a40454588d 100644 --- a/target/arm/mte_helper.c +++ b/target/arm/mte_helper.c @@ -514,9 +514,10 @@ void HELPER(stzgm_tags)(CPUARMState *env, uint64_t ptr, uint64_t val) } /* Record a tag check failure. */ -static void mte_check_fail(CPUARMState *env, int mmu_idx, +static void mte_check_fail(CPUARMState *env, uint32_t desc, uint64_t dirty_ptr, uintptr_t ra) { + int mmu_idx = FIELD_EX32(desc, MTEDESC, MIDX); ARMMMUIdx arm_mmu_idx = core_to_aa64_mmu_idx(mmu_idx); int el, reg_el, tcf, select; uint64_t sctlr; @@ -639,8 +640,7 @@ uint64_t mte_check1(CPUARMState *env, uint32_t desc, } if (unlikely(!mte_probe1_int(env, desc, ptr, ra, bit55))) { - int mmu_idx = FIELD_EX32(desc, MTEDESC, MIDX); - mte_check_fail(env, mmu_idx, ptr, ra); + mte_check_fail(env, desc, ptr, ra); } return useronly_clean_ptr(ptr); @@ -810,7 +810,7 @@ uint64_t mte_checkN(CPUARMState *env, uint32_t desc, fail_ofs = tag_first + n * TAG_GRANULE - ptr; fail_ofs = ROUND_UP(fail_ofs, esize); - mte_check_fail(env, mmu_idx, ptr + fail_ofs, ra); + mte_check_fail(env, desc, ptr + fail_ofs, ra); } done: @@ -922,7 +922,7 @@ uint64_t HELPER(mte_check_zva)(CPUARMState *env, uint32_t desc, uint64_t ptr) fail: /* Locate the first nibble that differs. */ i = ctz64(mem_tag ^ ptr_tag) >> 4; - mte_check_fail(env, mmu_idx, align_ptr + i * TAG_GRANULE, ra); + mte_check_fail(env, desc, align_ptr + i * TAG_GRANULE, ra); done: return useronly_clean_ptr(ptr);