From nobody Sat Nov 15 20:33:58 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1597252854; cv=none; d=zohomail.com; s=zohoarc; b=aeqBdap6sWyVmTZ+SGFQN6arc9NnGKsn86HMKZygi77YYbOf6R+kMRglCjMrzKVRa/HEwttSoEAa8lqrgMNibmzsrL9fhbCGPMSU0haudwJChbiYV1sCKf02mh0cSVXPrvAlSdXZV+DNbq0DphcqReXy7YS+cbBCDrCy5FEcnh0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597252854; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3Vi8D6cToE+83DNLkfNqfMDYxXOTd4xd+RpYBMQnwio=; b=Yf03Z3nOyZk0GkZqFU1Sl0ipAUJFowQRPYSVjyo3ClVIFynIarRlu+Ckc0i8Zb+YCa/rqjrtFFMUO1FcEvWmVxXD1TTy2w0swgBXKnfn7q241FUtZ3KCiraIU741VRRjMQm3XGvZga73IMTX3YUcR6xKGX+ShZeJpE74KOtSVgo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597252854824619.7890193752883; Wed, 12 Aug 2020 10:20:54 -0700 (PDT) Received: from localhost ([::1]:47680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5uQm-00057Z-VQ for importer@patchew.org; Wed, 12 Aug 2020 13:20:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5uPp-0003og-6h for qemu-devel@nongnu.org; Wed, 12 Aug 2020 13:19:53 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:44294) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5uPn-000182-Jo for qemu-devel@nongnu.org; Wed, 12 Aug 2020 13:19:52 -0400 Received: by mail-pf1-x441.google.com with SMTP id r11so1338019pfl.11 for ; Wed, 12 Aug 2020 10:19:51 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y79sm3097206pfb.65.2020.08.12.10.19.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 10:19:49 -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=3Vi8D6cToE+83DNLkfNqfMDYxXOTd4xd+RpYBMQnwio=; b=LUjXCMBnc3FU5sdaW54XQ44rDWLDksdD10xRyOT+mpzCO+5LTSgsARnJ63kpTV5vXa X3kgLvEcnMhgSq8Qg20Aq5S7YBauDtBlhukrqINo76CS/HkNeepcAxUiJ2mQHJhG4lWb HzSPUfdbljHyGF3F6SjpMYNTIjFRe2P/GDFZK8mzrCDdb2AB0zBRuQuAXXmxPodE7RDu RmzGHQKCkFQzWvEV0er+2qhUc6g8AfIVX+RzFO2/Lbjr/OFIZc/ZGHKQzHnB9dNpf7id bwFbDNB1K7ZROWuIY/P+4f/mhvwa3JZeoMB0uJk+LOZXG9zTnZNNO+ISsJdYf559CgSB yoHA== 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=3Vi8D6cToE+83DNLkfNqfMDYxXOTd4xd+RpYBMQnwio=; b=PIKlYPJzoCmsfxDgFznsY/x0QWBJDFz0yKjK1lpmvyDsPIOFYH+q0ax6PSMl5yTB6s /SwkXnXOinZNYglFJCvzN3U3FKNYV0tDC5Tg4xM1EFRQlZCEoIHAbiFJKSvd5l/ZajRu tqmmNWYbHU9KK4j905kSk9v7RbkLUG6Dym9AM4xQc7vKT/tEUm5XIBUtF/mGXGQnhgEL x34RD85KsYXvUzFf06nez5hlg1Rxz7nOBkbO3Cr7hWdD4CaJwWFGh0gxn+fEBOKnNRtH Ru+BNiTl7smUgSVtriWz5kcJDwQF9UfJEwoJLpxgfBGGbVtphSbp21YLbwwIhZYSmos1 C8tA== X-Gm-Message-State: AOAM5315brIjrcLbLE3I8WINyKXcey7PH8pZWH0ocVshTMB0qvfXKl1W z60cADogNa7pPUqc53VCcDAbg07RxqI= X-Google-Smtp-Source: ABdhPJxLj5L3XaFypiF5IUk1WgmAREDbIdrnkrA9UjI4UStQcPnrYVJk9m39VwqnjTwAsYjeDM5BgQ== X-Received: by 2002:a63:5b0f:: with SMTP id p15mr123360pgb.299.1597252789793; Wed, 12 Aug 2020 10:19:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/3] target/arm: Export merge_syn_data_abort from tlb_helper.c Date: Wed, 12 Aug 2020 10:19:44 -0700 Message-Id: <20200812171946.2044791-2-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x441.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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" We will shortly need this function in mte_helper.c. It's also a bit too large for inlining, for something that is on an exceptional path. Signed-off-by: Richard Henderson Tested-by: Andrey Konovalov --- target/arm/internals.h | 4 ++++ target/arm/tlb_helper.c | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index ae99725d2b..967d1319de 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -500,6 +500,10 @@ static inline uint32_t syn_wfx(int cv, int cond, int t= i, bool is_16bit) (cv << 24) | (cond << 20) | ti; } =20 +uint32_t merge_syn_data_abort(uint32_t template_syn, unsigned int target_e= l, + bool same_el, bool ea, bool s1ptw, + bool is_write, int fsc); + /* Update a QEMU watchpoint based on the information the guest has set in = the * DBGWCR_EL1 and DBGWVR_EL1 registers. */ diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c index b35dc8a011..e8cf39f7d9 100644 --- a/target/arm/tlb_helper.c +++ b/target/arm/tlb_helper.c @@ -10,11 +10,9 @@ #include "internals.h" #include "exec/exec-all.h" =20 -static inline uint32_t merge_syn_data_abort(uint32_t template_syn, - unsigned int target_el, - bool same_el, bool ea, - bool s1ptw, bool is_write, - int fsc) +uint32_t merge_syn_data_abort(uint32_t template_syn, unsigned int target_e= l, + bool same_el, bool ea, bool s1ptw, + bool is_write, int fsc) { uint32_t syn; =20 --=20 2.25.1 From nobody Sat Nov 15 20:33:58 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1597252856; cv=none; d=zohomail.com; s=zohoarc; b=IM/EmTdomnScahEZP88tWQ54imrG5AmQfrdz+W2KHpSpZb7BmvvJViGB5Fo9lQedlJbwWWR7h70gqfK9ZN8CG8uFD6PRsVfhkrMRmySDKnRCo1M0Or0hQLqiCtmVolKQMWI+hEU24kRDm5Wq22JRMgG8lA27H2bAq1uaggu8bnA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597252856; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gkaf80e+VCqbV0BxEoX+BcAOlQwRYSyZFcs+VT/z7+o=; b=HNQt+PAvkh/iF4Ea0zj8LbXXd+58fQHccbJ2LB0BJ+p5MoI2NnlyO/7tlpnmqWoviTSvi0GADA7RSbfkagSz4h3DBgLSV3TI7FBd3I/kKc9hez1CkNcmJ8f+KddmXQKyR1+Weq5qtpp+SRZVZIch2xk050JZr03ugnmb5PDa80M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597252856203388.0820171520272; Wed, 12 Aug 2020 10:20:56 -0700 (PDT) Received: from localhost ([::1]:47782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5uQo-0005A3-Px for importer@patchew.org; Wed, 12 Aug 2020 13:20:54 -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) 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) 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-Google-Smtp-Source: ABdhPJwIlLn1MeGlZiok90nU9kHBKS9tPRG7llizWcQBujC64VpAi20HMuZNxByMaGx6+Y4JBnTzcg== X-Received: by 2002:a63:5022:: with SMTP id e34mr158542pgb.384.1597252790887; 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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 Tested-by: Andrey Konovalov --- target/arm/mte_helper.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) } =20 /* 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 =3D FIELD_EX32(desc, MTEDESC, MIDX); ARMMMUIdx arm_mmu_idx =3D 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, } =20 if (unlikely(!mte_probe1_int(env, desc, ptr, ra, bit55))) { - int mmu_idx =3D FIELD_EX32(desc, MTEDESC, MIDX); - mte_check_fail(env, mmu_idx, ptr, ra); + mte_check_fail(env, desc, ptr, ra); } =20 return useronly_clean_ptr(ptr); @@ -810,7 +810,7 @@ uint64_t mte_checkN(CPUARMState *env, uint32_t desc, =20 fail_ofs =3D tag_first + n * TAG_GRANULE - ptr; fail_ofs =3D ROUND_UP(fail_ofs, esize); - mte_check_fail(env, mmu_idx, ptr + fail_ofs, ra); + mte_check_fail(env, desc, ptr + fail_ofs, ra); } =20 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 =3D 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); =20 done: return useronly_clean_ptr(ptr); --=20 2.25.1 From nobody Sat Nov 15 20:33:58 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1597252928; cv=none; d=zohomail.com; s=zohoarc; b=D8Jzvah0HrkZ/ayWh6ru0wLjHOXuKBa6EOvGQMJtTmBU8fY2nz2JSfc6NbZswCnRf8/ob5RjNzg2ipuOnUuhwV4lJnM1zcuI+YJh6I2V2NoMbzwH61SLgmb9wYTaZ/GBhMLBZvriONEP/E0KaYZeQYfW1vVgZ4fsLWP7unP9W40= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597252928; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jMyCh+YeOhdMjPLdLsR5j0kgHNJrks8+hvyL+Yjz/84=; b=ecPtjEW7429bzdeZeD8h0qsptrST2hSG9WoZMmMqoi8IA/JoXJYJ6gXnk6t294YkgxiGCS5wSQ6rzw974U/tUk7g/uuXDyp5bUbaVjoYEO/r4t6ui5BTX0FrGLn8KYYWUsd0MO4Ig/1CIrVVTYAQjn3vmKilBSzaZXWZliHhVJM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597252928569960.0963320995305; Wed, 12 Aug 2020 10:22:08 -0700 (PDT) Received: from localhost ([::1]:53036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5uRz-0007HT-Bt for importer@patchew.org; Wed, 12 Aug 2020 13:22:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5uPr-0003sS-D9 for qemu-devel@nongnu.org; Wed, 12 Aug 2020 13:19:55 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:41593) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5uPp-00018O-P2 for qemu-devel@nongnu.org; Wed, 12 Aug 2020 13:19:55 -0400 Received: by mail-pg1-x544.google.com with SMTP id s15so1380384pgc.8 for ; Wed, 12 Aug 2020 10:19:53 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y79sm3097206pfb.65.2020.08.12.10.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 10:19:51 -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=jMyCh+YeOhdMjPLdLsR5j0kgHNJrks8+hvyL+Yjz/84=; b=DMpv+LdCydkAxltYsDakxLALllgSYdbu8doogBi4YLzeRDCqDMCoSFKOZYzDVxqC++ pXxGkUpiD4qPSExa9XNyB5uu0BWeLhUHo2bm/NS3Ahh3zWa+Wkfw6wH8uAvpqJ51lmi0 feswXiEyi/fwgiscXgPPwSuVi3i4tuuX3rjnDQcSzGSCnb03E01rhyzYBdM5HHiz6XbI Pqzhh7QRq+cScScwM+3KvGhrWkSy1nitllnc78hjPS+sNd0xp/phwt0HZNq8S5+/s4HN +vedV37BDoo7HbPvO2tnDBAwdSt/3mZ/b1ksirYnzPzNIWtPvt306Tz5+RiXJmjTmdlw chfQ== 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=jMyCh+YeOhdMjPLdLsR5j0kgHNJrks8+hvyL+Yjz/84=; b=PGF7BXX8PNC552cbHsAXdlr9CV+vKpOncT9z8nXYwNB6OFAo/nS16UyJMFiwoePOJ8 NzFL6NnA283akMYgaioWKwl+eOnoSmCddiZSe+63rJjMAhaa66/Y2ts2PwoL/R1wHwPY cB2Dg9FSKBIzy7Dfhgpn+3mp0Xkz8naOmF6W75DEffHxpCRTif2/ftu7j4OAODmHcJSQ 2ONsV9svfsFL7FmX7UXCiajnVxrpO8kyvCSiFG8hnSyr5M3byDWyx89xWXZnUZ0BlVCJ Nkpe7KdSceNhQMgSt2o5LX+MoOtLH6UYqlRjVtUD/yHOYD0VOBalY7FUYwr9PR84RSfv TeAA== X-Gm-Message-State: AOAM530y3us2zA3XlPCtHZaSDrDfJsH7OetWhNWomhEMMiCf68qzq5e3 c6Fgwlwn92GWz0yLKxpZgyFKgEeptgk= X-Google-Smtp-Source: ABdhPJzPRmnwD1928Ac2WkFKGrsP46WAAl6oKcBs74Y7UNd7aIbRNwvEr/uTwzlU44mIkjakyndbxA== X-Received: by 2002:a63:d143:: with SMTP id c3mr167852pgj.306.1597252792088; Wed, 12 Aug 2020 10:19:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/3] target/arm: Merge ISS for data abort from tag check fail Date: Wed, 12 Aug 2020 10:19:46 -0700 Message-Id: <20200812171946.2044791-4-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x544.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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Merge the ISS data saved by the translator for the originating insn. Use merge_syn_data_abort so that we properly take the target EL into account. Set the WnR bit properly in all cases. Reported-by: Andrey Konovalov Signed-off-by: Richard Henderson Tested-by: Andrey Konovalov --- target/arm/mte_helper.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c index a40454588d..2dff4c548d 100644 --- a/target/arm/mte_helper.c +++ b/target/arm/mte_helper.c @@ -519,7 +519,7 @@ static void mte_check_fail(CPUARMState *env, uint32_t d= esc, { int mmu_idx =3D FIELD_EX32(desc, MTEDESC, MIDX); ARMMMUIdx arm_mmu_idx =3D core_to_aa64_mmu_idx(mmu_idx); - int el, reg_el, tcf, select; + int el, target_el, reg_el, tcf, select, is_write, syn; uint64_t sctlr; =20 reg_el =3D regime_el(env, arm_mmu_idx); @@ -543,13 +543,17 @@ static void mte_check_fail(CPUARMState *env, uint32_t= desc, * * In restore_state_to_opc, we set the exception syndrome * for the load or store operation. Unwind first so we - * may overwrite that with the syndrome for the tag check. + * may merge that with the syndrome for the tag check. */ cpu_restore_state(env_cpu(env), ra, true); env->exception.vaddress =3D dirty_ptr; - raise_exception(env, EXCP_DATA_ABORT, - syn_data_abort_no_iss(el !=3D 0, 0, 0, 0, 0, 0, 0x= 11), - exception_target_el(env)); + + target_el =3D exception_target_el(env); + is_write =3D FIELD_EX32(desc, MTEDESC, WRITE); + syn =3D merge_syn_data_abort(env->exception.syndrome, target_el, + target_el =3D=3D el, 0, 0, is_write, 0x= 11); + + raise_exception(env, EXCP_DATA_ABORT, syn, target_el); /* noreturn, but fall through to the assert anyway */ =20 case 0: --=20 2.25.1