From nobody Fri May 17 07:07:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1597349426; cv=none; d=zohomail.com; s=zohoarc; b=AtMS+XeKHoDLtw06qecRnW/CSAqihJNB97DzrYaI4XIEDIU8QWC/QXB2Wr7SCpMK8zV6i/P1ZgGcts1pJbYz/WxfBq9pi8msSHemK3g8iH0fCgcpBDi588iWUa24RC5dqKC2GKIGMnD/M421oyZC/G0fkc6ja9Yg52xeoSv3ILk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597349426; 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=NLFZn9LdjJ9UB9ritgxbSbOqTqh6V8tBQ/0fw+Yfzd86IwV9g40t3ZETLas2KVnLaJAF+aOYe80D8pYmidpBtQyQWxtMkjJyMj9JUusUQZmNJPHPBuPkcz1iahIIrP3cg1HAM+3g4bInDIhn2SgjzvnCePWXITK5G5TkspKxuIw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1597349426756593.5865506937793; Thu, 13 Aug 2020 13:10:26 -0700 (PDT) Received: from localhost ([::1]:39684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6JYP-0004Ym-IP for importer@patchew.org; Thu, 13 Aug 2020 16:10:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6JWR-0002NI-NJ for qemu-devel@nongnu.org; Thu, 13 Aug 2020 16:08:23 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:39987) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6JWQ-0003dO-3Q for qemu-devel@nongnu.org; Thu, 13 Aug 2020 16:08:23 -0400 Received: by mail-pl1-x641.google.com with SMTP id u10so3110004plr.7 for ; Thu, 13 Aug 2020 13:08:21 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm6811642pfc.202.2020.08.13.13.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2020 13:08:19 -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=plIHfCGX62hyS4a3SD1Gkm+v5hXzm1gv01HKXxCHjaZBAI0j2XouGingvd/umKY7Cs yHmDPM5+ZdozIoOqcMTLe4h1JH3B09o6RliH9qJ/TkHYKJCNtj7/7xh6VJYQqhoGe5Xt hJYEzocYfafx664XbjdRU8Wxs6YCCZPX29U9XNCddW7ZBEplq9zNjw4tYzKyyBmwDhsy Yq7R2wLa8vvHKf9YZ9XgUxxfPmzSGiiS3St9nYc+PLG3ZDD37hxIW+y7k5wAhJlJbqTf VKL5umQ/CQEuqLATFLQbgJWNy4Zcm7Wmz6H1+QjhJarrXa73xQiEq0NMsDsCRaV5KZdT 61ZA== 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=MAfYB69XrUI3dG8H1r2o+P50x9Lae+GjPBtsX+grfH2b0QVdf/pEUkSlwghI4bc7GW Wjs/aqEv0BQsXZtf+Nlv/NmRQ08L7r6tNv7QtmJSEQhsX2IRs4e1l9bUQukNIMecnj9Z B2p5LTdmdiAFpJtSSFBDiOsJnWnhbe568Nj0EhhkGeIE9p/bbn+o+Vypzg25yAw/lyGf eEeAG0Sg1B+QBM0c8KCXWwolAK932Jr69ZEzERFIsTuzcWT5OX6vlTcwF48DCGYLP1yD a6HZOOxqlVl2qddkCdeu+vJTRd/c2wouuNBcnN8u4uqpt41lcubZTqpX5V2u9sZkeSth HcOQ== X-Gm-Message-State: AOAM530tekGSEVL2lSW9v44d0DPSA1CiHcgvyxdVsIb/61zxTe0e/yMy Mjaopgcbe4kZshczc8WJljD1YR60lEQ= X-Google-Smtp-Source: ABdhPJyB2FLMgjz2a/6jcpsxynK2bzv+4bPDCGzyTrH97jeueX//dGaHTDEp4oW2a6m/evP4RIBTfA== X-Received: by 2002:a17:90a:1384:: with SMTP id i4mr6960842pja.157.1597349300278; Thu, 13 Aug 2020 13:08:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 1/2] target/arm: Pass the entire mte descriptor to mte_check_fail Date: Thu, 13 Aug 2020 13:08:15 -0700 Message-Id: <20200813200816.3037186-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200813200816.3037186-1-richard.henderson@linaro.org> References: <20200813200816.3037186-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::641; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x641.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: andreyknvl@google.com, vincenzo.frascino@arm.com, alex.bennee@linaro.org, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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 Fri May 17 07:07:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1597349361; cv=none; d=zohomail.com; s=zohoarc; b=hqxWumKUYVrWHDZzbVXX7VF0IHJcdpgBbiw26YKXp3LoTNnQ/fJHKTFRtePisAgKeoZCOb3u/ghSrpZL2m2eVj1YqTOOWw+IvMulBrhvzR8F6K4u7PMBn2H6ks38E1DE+tkvzIgHOvjdjfxJ4BJz73/7DcqapEVwkc0b6e+qzNY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597349361; 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=a9KU3BFjLPcvWd1ynHXjJMFI8AkA4Hb5hz2Tk+NCbVg=; b=DRj33FTiRKk78j35BGeYlpt6jYKHREOuvBuQEBGVM0sfWZkxBiEBzEfvPnHnZD2sSaUwRx9hHr5d98/jmHaijApHBN8ThTdU3qr/d3KAmiBXaWrMAriVcbV33WLgkt4iGCXBGRK83r9G9L8wYntul3tcRog9PCTrdXgLqz5C7ng= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 159734936124538.701982226275845; Thu, 13 Aug 2020 13:09:21 -0700 (PDT) Received: from localhost ([::1]:36444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6JXL-0003Dp-OD for importer@patchew.org; Thu, 13 Aug 2020 16:09:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6JWS-0002Oc-Mb for qemu-devel@nongnu.org; Thu, 13 Aug 2020 16:08:24 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:35147) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6JWR-0003da-54 for qemu-devel@nongnu.org; Thu, 13 Aug 2020 16:08:24 -0400 Received: by mail-pl1-x642.google.com with SMTP id r4so3121680pls.2 for ; Thu, 13 Aug 2020 13:08:22 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm6811642pfc.202.2020.08.13.13.08.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2020 13:08:20 -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=a9KU3BFjLPcvWd1ynHXjJMFI8AkA4Hb5hz2Tk+NCbVg=; b=WMrYJVlGhGObuqXg4p/j7BSxZFF8fQpAIGxwV6E1xqQLVqi/gpw8ko+r/v3rUBxYbI /s4Ox6IuWo1Dd5TuAnk8C9oJT6GpxC8jecbMoS6AJHPW7NL4IiIXTzYvwNFqlS37tily GVRIG1wFqBpu8mUJSSikGNFKBQKH7hs0HEmBddnTCRGJhIn/Du2ZjL386FvJPUB3U9O1 MZaymyawwAtUSW6HF9N2Fr+SqF02g+tC1i8AgSjxFk+cc6G3ZSM8eLduqtWUOdc5F50J um9m+ADZ11Oz043tEmMTO5ZF6gH0wy61p6lCCsFIJ3hKSHj19N+6Iz9IJERfnKdBk166 +Zng== 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=a9KU3BFjLPcvWd1ynHXjJMFI8AkA4Hb5hz2Tk+NCbVg=; b=VuHpk7FXnUxmLmcuJQnTeqHwAOd8ljtQ0BJJrhloAsAs4kOL8XK9SDPsH4pRCGNUWa n4iI44oKQpXKyvR6pqFqNKVK1lLIrcBZSD5GCkhlpG2pNuaSROTup+bprDkNIpYVFUPR jInR3W9QmNH6wpNE7pWhOhwk9rOMInYLmrhrdp/fOPxR7IYVgxJbaeLK5ziTV1QRTQi6 GJLf9cVxGAxohSRfgazDawnPImDLIG9S2gi7/LdzLcg1q7cCkx5vtGjGJM4KH7C0QRxM JIq4cO7GtwcHq/Wd+rmK7lm0Wq84OiZmCQErYN0Zq8ZnpHkh7Q5ZbFz2CIs8ohSc4Mrn ns5g== X-Gm-Message-State: AOAM5304O1BRBVtBMvX4hnW110rRehyOEnNrvd41rIkcjtAnp3eJYTtF XRI5477GVi8yogD397U9CscerRC1X+A= X-Google-Smtp-Source: ABdhPJzlLM5EQU2ChY5Aqs/hAwTuajBfDa2O99yKBH2XXoAmZxwOEKk+mcLvcutyUvFp8XnDWdf//Q== X-Received: by 2002:a17:90a:1682:: with SMTP id o2mr6943714pja.227.1597349301471; Thu, 13 Aug 2020 13:08:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 2/2] target/arm: Fill in the WnR syndrome bit in mte_check_fail Date: Thu, 13 Aug 2020 13:08:16 -0700 Message-Id: <20200813200816.3037186-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200813200816.3037186-1-richard.henderson@linaro.org> References: <20200813200816.3037186-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::642; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x642.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: andreyknvl@google.com, vincenzo.frascino@arm.com, alex.bennee@linaro.org, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" According to AArch64.TagCheckFault, none of the other ISS values are provided, so we do not need to go so far as merge_syn_data_abort. But we were missing the WnR bit. Tested-by: Andrey Konovalov Reported-by: Andrey Konovalov Signed-off-by: Richard Henderson --- target/arm/mte_helper.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c index a40454588d..891306f5b0 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, reg_el, tcf, select, is_write, syn; uint64_t sctlr; =20 reg_el =3D regime_el(env, arm_mmu_idx); @@ -547,9 +547,10 @@ static void mte_check_fail(CPUARMState *env, uint32_t = desc, */ 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)); + + is_write =3D FIELD_EX32(desc, MTEDESC, WRITE); + syn =3D syn_data_abort_no_iss(el !=3D 0, 0, 0, 0, 0, is_write, 0x1= 1); + raise_exception(env, EXCP_DATA_ABORT, syn, exception_target_el(env= )); /* noreturn, but fall through to the assert anyway */ =20 case 0: --=20 2.25.1