From nobody Sun Dec 14 02:00:53 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=1752274372; cv=none; d=zohomail.com; s=zohoarc; b=P2h/CdVeL4SLuOSPcupvEZ8vmR+nq6KUKUWNBa0BiDhtDTsWonhK1eE697XINrIvqZvBhN0R8cxujFgDo3HErzZBrH/I5mSZy6ZXTRpaOgYd9W7zHEe8iJAm8/6Pckmu0RbJDMNLOXLLSMLaT443yu4tL71hCv0AUMkvkl1e3gw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752274372; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QoVt34T1baW12rVn5dQP7UZyDzzjRTAvBEJWDUabYc8=; b=cdb1RTXd8AR0vT0/zlP/7NWCrnN7NQ7zM7Id/Hd662Ow3gISbgNuaViSv6XGF2gF5ahKDZfua6+EYuV9JyaaPFaaqqOeeAjNmSxabv7tg3acA+84rIv1tUvHkAxfOBIXQ++i1RCe9smxHGkOb37mhAZ4TKJH8L0A5eodLadgKTA= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752274372119130.14073759314408; Fri, 11 Jul 2025 15:52:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uaMb7-0001Be-0t; Fri, 11 Jul 2025 18:52:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uaMYa-0007Pl-W3 for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:40 -0400 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uaMYW-0008NC-FB for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:27 -0400 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-40ba3d91c35so1473558b6e.3 for ; Fri, 11 Jul 2025 15:49:20 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 5614622812f47-414197c6064sm696638b6e.20.2025.07.11.15.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 15:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752274159; x=1752878959; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QoVt34T1baW12rVn5dQP7UZyDzzjRTAvBEJWDUabYc8=; b=n9NaGnPLsvzJs+dCKkeZ6pAhsiDx4djkvkCVePO/q5kto9gZO4Bg23GkBNBVdEwZ03 F66YhzS+fZ2LNn4oQMkwkUiPA8c7jTe/kda1HhmA7zazsEh0An442W2dKX1Yn5vvdCaN tSELltLffrweNA2OmMrzCaJPgggcWJskMJPBz0kuE4GHOX6wYNlPpG/QREleqpEu1MYX w8j+GsL6g0/8sDoXBLdHYrnkpLL3juUpoS7gvDmkQ0XCkbSxqkIu4d2ZVT9crvVZ02SI naOmN2bGi3mKQ1R7gtqD7k4AkBigRnJ8/RcEaKn81MNzvRYv+wgkp1tD9CyogFmyu3/r DkxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752274159; x=1752878959; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QoVt34T1baW12rVn5dQP7UZyDzzjRTAvBEJWDUabYc8=; b=CmbZkxC6SXvgnr9kTQcSXl+gbxMK1SDGx2vhRK266AWLclv6gF6QzC+D2MAt3RyU+6 6KAaOttwyOiRg144Q7YdEsbAEXurBQ+V52toCI6wqlVbXZY+nPuXBajgmBaKljUz9oq3 HpKXPDjtpjwvslBO3I3otTn5sBtf1Ub/QhpNHTpMCOWT0QesY7MEnZ5ekrr8/DUuWVBY oiMx41n6rYKwpwYSceQ7pfM+Wv11ZDBWyWuX705tMzALQ69Sn1Rz67LknFCdK974Ue+F kTib1t6k+LrF/Z1ah1wpjNj7lzpCaAA9kcIQ8xCNDrHHxx7e4sn4rj5p0PlEoR4iKHdr apww== X-Gm-Message-State: AOJu0Ywvq7EymvXi8qAvQm+7IYU9pGsUjDVnmkcxegutvLGsSA2x0nyW EoN5JV+w0kf9iK+beqmIMUHdHc8rcp+GrS37FU18Pwce4LhntZVuDQ7QdYzFxsKO8ZHM4PVFF9t o623WXrQ= X-Gm-Gg: ASbGncvJrlp6rVLXi8BE0oX5dX63Ym5vfspKaA0pPOnj9RI8tTWDZAEAFCCf4zdPWcG lI/AAlkvsZ7E0Wa+SQD/W2xxwemjkJUp0UWxYWv7756c1xw3f3X20h1tfB3y+vXPvEE1/0oN2y4 TeSNte33mlApXcyU2IhDcQuUyByb+Nmq9yAKDPnZGhAI45ro8oVQnPoxRMSme07mSnAcFv5w12h N5326ucLO/AoukeMzrqRss3L1F0VHpSnYAhf3355MQ6Y5L6aC/+R7BpBxIaCDajQMr1sayHJS45 GLZRgOAladRRl24F0bA6cFPwcoQYGZDMm9f9cpd1bsS4t+QlKSkNV9f+E/5U22aS9yIHaRHzjWp pr7+CvjvMLNX6StAWPCHHml+vsnWvXaIbMj0GbLCR07UI2eyla+k0pKud6jEUA1UFGMaFK9zC4n AolkNRRfvS X-Google-Smtp-Source: AGHT+IHSaMXCLhJsYxE72egofJvuoL3B7jCSbh+M675b/V+Nvl80TQx28723SE4aU5enP6/eM/nt8A== X-Received: by 2002:a05:6808:16aa:b0:40b:1222:8fd8 with SMTP id 5614622812f47-41539f925c2mr3663531b6e.35.1752274158939; Fri, 11 Jul 2025 15:49:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 1/9] target/arm: Add prot_check parameter to pmsav8_mpu_lookup Date: Fri, 11 Jul 2025 16:49:07 -0600 Message-ID: <20250711224915.62369-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250711224915.62369-1-richard.henderson@linaro.org> References: <20250711224915.62369-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::232; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x232.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752274373664116600 Content-Type: text/plain; charset="utf-8" Separate the access_type from the protection check. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/internals.h | 5 +++-- target/arm/ptw.c | 11 ++++++----- target/arm/tcg/m_helper.c | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index 6c1112e641..a02439df63 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1626,8 +1626,9 @@ bool get_phys_addr_with_space_nogpc(CPUARMState *env,= vaddr address, __attribute__((nonnull)); =20 bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, - MMUAccessType access_type, ARMMMUIdx mmu_idx, - bool is_secure, GetPhysAddrResult *result, + MMUAccessType access_type, unsigned prot_check, + ARMMMUIdx mmu_idx, bool is_secure, + GetPhysAddrResult *result, ARMMMUFaultInfo *fi, uint32_t *mregion); =20 void arm_log_exception(CPUState *cs); diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 561bf2678e..a914e7e23c 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -2561,8 +2561,9 @@ static uint32_t *regime_rlar(CPUARMState *env, ARMMMU= Idx mmu_idx, } =20 bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, - MMUAccessType access_type, ARMMMUIdx mmu_idx, - bool secure, GetPhysAddrResult *result, + MMUAccessType access_type, unsigned prot_check, + ARMMMUIdx mmu_idx, bool secure, + GetPhysAddrResult *result, ARMMMUFaultInfo *fi, uint32_t *mregion) { /* @@ -2750,7 +2751,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t add= ress, if (arm_feature(env, ARM_FEATURE_M)) { fi->level =3D 1; } - return !(result->f.prot & (1 << access_type)); + return (prot_check & ~result->f.prot) !=3D 0; } =20 static bool v8m_is_sau_exempt(CPUARMState *env, @@ -2952,8 +2953,8 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, } } =20 - ret =3D pmsav8_mpu_lookup(env, address, access_type, mmu_idx, secure, - result, fi, NULL); + ret =3D pmsav8_mpu_lookup(env, address, access_type, 1 << access_type, + mmu_idx, secure, result, fi, NULL); if (sattrs.subpage) { result->f.lg_page_size =3D 0; } diff --git a/target/arm/tcg/m_helper.c b/target/arm/tcg/m_helper.c index 28307b5615..d856e3bc8e 100644 --- a/target/arm/tcg/m_helper.c +++ b/target/arm/tcg/m_helper.c @@ -2829,8 +2829,8 @@ uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t ad= dr, uint32_t op) ARMMMUFaultInfo fi =3D {}; =20 /* We can ignore the return value as prot is always set */ - pmsav8_mpu_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, targetsec, - &res, &fi, &mregion); + pmsav8_mpu_lookup(env, addr, MMU_DATA_LOAD, PAGE_READ, mmu_idx, + targetsec, &res, &fi, &mregion); if (mregion =3D=3D -1) { mrvalid =3D false; mregion =3D 0; --=20 2.43.0 From nobody Sun Dec 14 02:00:53 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=1752274328; cv=none; d=zohomail.com; s=zohoarc; b=AHhzsy4iZSebBSVLCDi3bX4HMWgR76OmWyR26148Umpthven/2SwZpeUyLrmlS/3Ej82hk8+RgvbagthCrUn2d/i494CZK31jHO+HkmpnkKcyrn4t8WrZATAHJty1iw8NpkG4y8Zg/h+bzVEPv54g2lA6sTd9Cop1001+4A1SA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752274328; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ytRuA3L88Bv4lWdDsxQUFk0uzi+wgTB6xmr4FnWYbaQ=; b=ML4eDKQHvJJpqLdDEcQ7E027LMEb1WF8Nc5f21Di8L4BSQdog1WoZzInn8oDTOE66ybBFTs7UCJxGInl4PuXdLWovM87cUTjjAEJYrW3OTFrYT7HlQRFxqcZhiOz7ygOBE6uSYMcmRv/SgGlwlqFUvkdcj0ubOwXfEu9PtI91KI= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752274327966290.6638958351656; Fri, 11 Jul 2025 15:52:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uaMax-0000Zt-8j; Fri, 11 Jul 2025 18:51:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uaMYu-0007ch-FG for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:52 -0400 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uaMYa-0008O1-79 for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:31 -0400 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-40ba3d91c35so1473571b6e.3 for ; Fri, 11 Jul 2025 15:49:21 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 5614622812f47-414197c6064sm696638b6e.20.2025.07.11.15.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 15:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752274161; x=1752878961; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ytRuA3L88Bv4lWdDsxQUFk0uzi+wgTB6xmr4FnWYbaQ=; b=YTV3DpI0FJcl6J1dYtdji5Ln842hZTBxgI3Mc9k4euSCYbfEUqLJXIixgR4MluABfc 07X3NTs0J+9w1MaozLlopsBy5paoUUEoK5CUtO0ddoC0KBNpzCfhRSrb1hQuG4xSwaex wZgP+o29iPefHPBchquuNuluVpyciCD4qdDqDgGDU54tpofjNtNXb9WrHMAqQkqKPAVV BibhcmeCr26zt5W+olTma1mOwiYXpsV8wFreWM3IxC0jPZzWZt4MKYaWvpGh5CRiTgO9 5RBE+AEw2++3xMNKaXnq5cq2+9fsjZoGIen4gLkJFsRF9WTN7Ejn9a4Se3rlmdDGZiOO LH6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752274161; x=1752878961; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ytRuA3L88Bv4lWdDsxQUFk0uzi+wgTB6xmr4FnWYbaQ=; b=M1qtzOKy65M4zex4GXDgFjrwOeJxLjW279v/1VaYnvuQFbKxk76pY+Ag+2D2cXW0k6 EbSRmWAnn0/n9FNtzYYRUiXXt7+azwffYB9o3S2nq9pVDLY4lnE4ETiLVRKl5lFZ6KiW t5bYSOdGEMfnUa4PUGWf1jplhcFEkkZTOQmCWYUWY9Hj3jwniQ4BRoZrwor3fX2prYIX ppvrDTYDrxtN4J6TnnpSes3EESp8znq4gbQCgiWRx3HZMWg72lgF6Y+2QoorNuFTl0z6 rd+9zPEPXrxqK1shoXwaxesoUmcrRT0Vuz7ykFn22NbJNdmGxSnA8mdOqkMRDweDvi9o 62Tg== X-Gm-Message-State: AOJu0Yyc8U0SifObm0Xj19+4zqve754ISqS3Tp25BXjKJiMAdN/nTxgL XOTE7v40VpJ5hL4vBJMYPaq6o+jmrFWE1xZXLPvTBvVxLiIm0eKjRovM7qi0wKqC9WI9/tdjLkd PZe5luJE= X-Gm-Gg: ASbGnctmsKRXGoo69styk87C4UqddMq6Izjv0hsG1lPVilGpiWx40qeCCU4lZR3UWOE IMILhZyk1x0ru981tZ7No8tLx4JgWM/mRGnjUixnCXqkCjcP4M91XLF50iUvc3CpLLrKQ9jkFap DC1B7upo6T+XdNl7Imvyok8Akws0KixRxfhhK68pU94bDkl/6odY8QwAQxA4sw5TSy23sruiDdw En5z7rrlkNA1D9fL5AD2xjwxba0lpPmgSWdl9xsKbxEWjzXFDbobR3QAQdliSbr67SLBtNq8g7W dnHKNtovzxNTFBhTG5SHV9jnDYgFd/AtTqBHBiH7I3bOakobK1k8HLcqtkRm2s3ox3agyT27GFn UpdHAPHKaooHnk2TQdZK0A+9Err1n2FLoLQBH0N+8aN0A715N87GCPnyp5KxrLwLblOSwyUtzod tQ8nzo68G0 X-Google-Smtp-Source: AGHT+IHEkOP+Q3xABq3vffoBrw7LoV5057c6d47P6hfcTRllA0GS8rOPvY6a0zehbRmrlDRCJGrzUA== X-Received: by 2002:a05:6808:690c:b0:40b:711:377d with SMTP id 5614622812f47-415393d60b3mr3329472b6e.18.1752274160863; Fri, 11 Jul 2025 15:49:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 2/9] target/arm: Add in_prot_check to S1Translate Date: Fri, 11 Jul 2025 16:49:08 -0600 Message-ID: <20250711224915.62369-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250711224915.62369-1-richard.henderson@linaro.org> References: <20250711224915.62369-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::235; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x235.google.com 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=unavailable 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752274329258116600 Content-Type: text/plain; charset="utf-8" Separate the access_type from the protection check. Save the trouble of modifying all helper functions by passing the new data in the control structure. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index a914e7e23c..1b90e33f52 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -64,6 +64,12 @@ typedef struct S1Translate { * Stage 2 is indicated by in_mmu_idx set to ARMMMUIdx_Stage2{,_S}. */ bool in_s1_is_el0; + /* + * The set of PAGE_* bits to be use in the permission check. + * This is normally directly related to the access_type, but + * may be suppressed for debug or AT insns. + */ + uint8_t in_prot_check; bool out_rw; bool out_be; ARMSecuritySpace out_space; @@ -581,6 +587,7 @@ static bool S1_ptw_translate(CPUARMState *env, S1Transl= ate *ptw, .in_ptw_idx =3D ptw_idx_for_stage_2(env, s2_mmu_idx), .in_space =3D s2_space, .in_debug =3D true, + .in_prot_check =3D PAGE_READ, }; GetPhysAddrResult s2 =3D { }; =20 @@ -1089,7 +1096,7 @@ static bool get_phys_addr_v5(CPUARMState *env, S1Tran= slate *ptw, } result->f.prot =3D ap_to_rw_prot(env, ptw->in_mmu_idx, ap, domain_prot= ); result->f.prot |=3D result->f.prot ? PAGE_EXEC : 0; - if (!(result->f.prot & (1 << access_type))) { + if (ptw->in_prot_check & ~result->f.prot) { /* Access permission fault. */ fi->type =3D ARMFault_Permission; goto do_fault; @@ -1243,7 +1250,7 @@ static bool get_phys_addr_v6(CPUARMState *env, S1Tran= slate *ptw, =20 result->f.prot =3D get_S1prot(env, mmu_idx, false, user_rw, prot_r= w, xn, pxn, result->f.attrs.space, out_sp= ace); - if (!(result->f.prot & (1 << access_type))) { + if (ptw->in_prot_check & ~result->f.prot) { /* Access permission fault. */ fi->type =3D ARMFault_Permission; goto do_fault; @@ -2123,7 +2130,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Tr= anslate *ptw, result->f.tlb_fill_flags =3D 0; } =20 - if (!(result->f.prot & (1 << access_type))) { + if (ptw->in_prot_check & ~result->f.prot) { fi->type =3D ARMFault_Permission; goto do_fault; } @@ -2537,7 +2544,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, =20 fi->type =3D ARMFault_Permission; fi->level =3D 1; - return !(result->f.prot & (1 << access_type)); + return (ptw->in_prot_check & ~result->f.prot) !=3D 0; } =20 static uint32_t *regime_rbar(CPUARMState *env, ARMMMUIdx mmu_idx, @@ -2953,7 +2960,7 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, } } =20 - ret =3D pmsav8_mpu_lookup(env, address, access_type, 1 << access_type, + ret =3D pmsav8_mpu_lookup(env, address, access_type, ptw->in_prot_chec= k, mmu_idx, secure, result, fi, NULL); if (sattrs.subpage) { result->f.lg_page_size =3D 0; @@ -3625,6 +3632,7 @@ bool get_phys_addr(CPUARMState *env, vaddr address, S1Translate ptw =3D { .in_mmu_idx =3D mmu_idx, .in_space =3D arm_mmu_idx_to_security_space(env, mmu_idx), + .in_prot_check =3D 1 << access_type, }; =20 return get_phys_addr_gpc(env, &ptw, address, access_type, @@ -3638,6 +3646,7 @@ static hwaddr arm_cpu_get_phys_page(CPUARMState *env,= vaddr addr, .in_mmu_idx =3D mmu_idx, .in_space =3D arm_mmu_idx_to_security_space(env, mmu_idx), .in_debug =3D true, + .in_prot_check =3D PAGE_READ, }; GetPhysAddrResult res =3D {}; ARMMMUFaultInfo fi =3D {}; --=20 2.43.0 From nobody Sun Dec 14 02:00:53 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=1752274369; cv=none; d=zohomail.com; s=zohoarc; b=A0BEVu0Lsw7Y/utio2mmDjBxNmqeRvR+jlzXh3biLFbMgQkBz+35AwZlThNRbRKZGh1FkNgX9M/I38b3truATb7DOb+bcecIuWyKGdekzVxgel2N2bIUdIjwJAjET+4SRzUpVOsgqne6yx4ED/T9E973JeCPT079/8k+JFvwhtI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752274369; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KbpMjeNAOgpQVH9iBoeuKkwL+dC1QrhKT8NKphlDlP4=; b=ElztBp1M1QGn+8JpaVS2GVMVZxmXxeqhsYoVzdCJyAmEvWCD/JS+Mm7AsYvVWYV53bywx8bo4R1tpB/ykDwtg4v8377OXQOaBMMSKPHM3gHPvC/E+MTREFUhkeeTfqZ5zDN0/QQQNwblL/eZ2Cx8qS/Pr8muFEQW7APH3NAt3hE= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175227436895352.94398626829934; Fri, 11 Jul 2025 15:52:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uaMb4-000156-K2; Fri, 11 Jul 2025 18:52:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uaMYa-0007Pb-Hr for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:40 -0400 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uaMYX-0008Oc-2J for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:27 -0400 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-40b99490728so1716966b6e.0 for ; Fri, 11 Jul 2025 15:49:23 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 5614622812f47-414197c6064sm696638b6e.20.2025.07.11.15.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 15:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752274162; x=1752878962; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KbpMjeNAOgpQVH9iBoeuKkwL+dC1QrhKT8NKphlDlP4=; b=VTjf1FQWCHgo+V2FxsALuWDkv+TyRaiyvFGB49aBvi+xifLP7E6gToh6knb8UZTigz x4X6LqXJKTjQpy+p5BrVJOMAW2beuIK7EC1VMOqPcGT1a+Dd3PgwJy8A5Ton5UfFGq7L TQct9xe2JICCMD2JSs2LlvarWSqlkpuhBPi6FfMkzOXYH/BoTK9y6H0QIqzSD6JJkJIu NMRz6D53X78U7wbTbcwsIo1ZzSxoKQ4gDx0Z/NqgIzeN4eVUnX2maIm5inC+CqaNaIPN bOA2MN9AIVD7r3+tJWjIFJ7liqbVllxXU9IjQR4BT5u24BZjc27wqOu1De1fgKr2VXHp Xotg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752274162; x=1752878962; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KbpMjeNAOgpQVH9iBoeuKkwL+dC1QrhKT8NKphlDlP4=; b=evlquaivy/c9ZbFCD87u2aWojzalFtloJLUwlBKR0z4L6Zu3geWcGeu7SVgmPKswbG zPnGk5iRgJ5rpotO1jnvstpSXu7wfn3nM42cCnK4jOGjCWySV72aVb2akJyeBMlaiyKC KRAHNR+53GeJ5RdF9VT78WjQE2Tx/jjsqtBgLkcDPIeM9ScgHXINwUIJpJfOq4WpG30z I7QCrP4rppzvFA095lYfNvh7MbMo8veNLnZ0rzA7y+xgXu8TJ5omp7gj4UdGtijmB7Lp Aun0FYP8UYXBqX1f0Jg5KxTUHhyCoxqcVS3mlJxcQMaYjfo/JdjwLIWwdNoq0rrtROYl PQlw== X-Gm-Message-State: AOJu0YxUIpp9hynWK3r9n2lS8zCaXuAsC6pr2LK1syKU7DKe0i9tVsT4 1Yx/KlACYu8Z0/puV+QFAyZtm9fsqulNyYgTeOM2Z/su1EWqzpZdzQ+FyapGPmWyRjK8GDlnVBb MDJC6dk8= X-Gm-Gg: ASbGnctSdaw3qtIq6VS2+iv6RK+nMnV0AiGG/cOLzMbQNr1hvAdb1uzqcbP6ZIbmQZX kclUPQ/9M408K6NdXFJllPCoBA48QgWyn7rOYDQKoprJZqoF5HF2mVTM94Ln4Nhmifyef+Pdmjs j1lpoemWVSR6yfssEXnqx6QpDO7hDA5QTDibBSmgvihSlxtdVoBCKG2jlNoErYvgufuGCKBi7dQ QYogFRBA1/2qJAddQ5FCg4v1Vx0H3kTiW1AJHB7lIFY7vTWNX9/A1JbjchtL/EIbdCTGqj+eS9x 8JuDOUxPJ/GkOyiDr0UIcDjOtSnv0sTj//IigJT64BQCjQhUugsMsz1rHpHlMVAXIaXPD14gnDF ZWTnjF2okd8Wx/FGd8M+/zwqbfXzlAV70/EoKfhB7bV7SQUOwgbQktTCbDZxbFveJwAp/lcnQUl CvBxZY20DU X-Google-Smtp-Source: AGHT+IHd/cShmp/DDpinxsJhjSfIokOny9YTjZKob2rm3OVi4pqd7xfB9nwXs1iaZCN0Aks+bo5Ivw== X-Received: by 2002:a05:6808:1995:b0:407:9d24:af03 with SMTP id 5614622812f47-4151f835e39mr3565860b6e.14.1752274162167; Fri, 11 Jul 2025 15:49:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 3/9] target/arm: Skip permission check from arm_cpu_get_phys_page_attrs_debug Date: Fri, 11 Jul 2025 16:49:09 -0600 Message-ID: <20250711224915.62369-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250711224915.62369-1-richard.henderson@linaro.org> References: <20250711224915.62369-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::236; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x236.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752274369751116600 Content-Type: text/plain; charset="utf-8" Do not require read permission when translating addresses for debugging purposes. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 1b90e33f52..c7db93b95c 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -3646,7 +3646,7 @@ static hwaddr arm_cpu_get_phys_page(CPUARMState *env,= vaddr addr, .in_mmu_idx =3D mmu_idx, .in_space =3D arm_mmu_idx_to_security_space(env, mmu_idx), .in_debug =3D true, - .in_prot_check =3D PAGE_READ, + .in_prot_check =3D 0, }; GetPhysAddrResult res =3D {}; ARMMMUFaultInfo fi =3D {}; --=20 2.43.0 From nobody Sun Dec 14 02:00:53 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=1752274375; cv=none; d=zohomail.com; s=zohoarc; b=h/BIxmN2V9WyZlwieKyqmy5gzNGngKZ+YOwA2S3/uXQZrxvtl6Dd8yYFhTpKD2JuGSxfo9rn5kT/TQxx0D5PxaUVhyKodoUm5FYkEigBTrhMumMvxeHEN7WYm5tf+Z9hbHTzttyRw+6R0qxfnbn02jY1yQXgtlLAC58gP1/hJLE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752274375; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AF32OpjR7IHi5ZdO5VPn5KefJdmAIBFy6cf7BlYfba8=; b=dv/yT52AXTLCw+NMn3JE2t/N7IiZKlPPZy+GIqkJ8zJlYS62LrtJ4tX4qKYGlaMbXW7kjkf78mAhW0i87XEkS9Fs0LsZecWGJO36nkQ0kAL4OVCjne2m73v5CJb2wipp+/9LePHnOe2En3xQfpwQk/iefC+wh40ntCAcgvIXDkQ= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752274375751459.15180519120895; Fri, 11 Jul 2025 15:52:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uaMbp-0003W4-TH; Fri, 11 Jul 2025 18:52:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uaMYc-0007RX-BP for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:42 -0400 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uaMYX-0008Qd-NF for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:28 -0400 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-40a55314d06so823982b6e.1 for ; Fri, 11 Jul 2025 15:49:24 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 5614622812f47-414197c6064sm696638b6e.20.2025.07.11.15.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 15:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752274163; x=1752878963; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AF32OpjR7IHi5ZdO5VPn5KefJdmAIBFy6cf7BlYfba8=; b=X0wYYXpOUUoNNWJOIazljetpkbDWNsBGuQayEca8Imtc8L9wS3uk89iwSi3xmMB7/j 2s6ZUYdQBT0a8H3vmU5Th2bd6LUtK3ANsGBO29lE83yRIZ/ySLcIOZqOWN0NlMvi52uF VUkiJXXPHw4AlOAKSXdstF+GWPXbEcq6DXIbfSl/BOmbP9eYEAQwRwT/eNE93nfLU7kE J7KK3DWzJLABt83B1nuNKdj4Y8NwIr3+AAEWpOoPoNepBe0wiY8qjYSew9O9s4xcDZ+n LqzAKC1hSL48SwFSO3zXb3C1NfhPP7SViuy5a9+Lix07ILGRPk0alZGx64WmlE5WbMz/ vScw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752274163; x=1752878963; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AF32OpjR7IHi5ZdO5VPn5KefJdmAIBFy6cf7BlYfba8=; b=Z2gD7Kz1WbTSYCarTW98iytqK2vVpgBT3i39z+gzi8ApLz0bct18rFOrsDIDGPsud8 sS6r2/hj6FVA4U5bhplsA25cbGusTsnULLjHIfdHgL+Z27Gzu811dD96YrYoBR+wSDH0 N/fI/lDA9JYrOWtY7pOMM4rac2je97EMqO9gGz/u7brKJEQ13pilS5jlUfHrFeqTNFWf VJjOOjkBVLCdiIBwCvOR21QsatyqHP5xZ3tN63Nzu/eGNwbLj4S61mo9QvFZCGABpHMf 330Y7Budvhn3K9SbEmVKwx/90Vuq7OqWPKL3orUWpjLIga55sp8DdvtXhsQDj4A0eeUM o5yg== X-Gm-Message-State: AOJu0YwVw/kSmlppRrjRkrM4JWYUxPcDMnrVuQq9n0Nq5mBmq4bxXPQU JriaJT9deAvcdyMJNwlGpdSZGXKgn4iVUvFLvWKqyalQHdopm87JB0vvS6FhfKJzqRHyjiQXFTx w/DGFqno= X-Gm-Gg: ASbGncvd2Gc6zEN8jbBSO7VK06+OlB8h+9QwuJooDLgKPxL/jcIiJeDDqmTtD1cr5hZ zOU3keKTnFv70bKsIEXB6iZ0KMrhkufJ6AsoK+oFn7C1HhgxU8DHK+/4Z1VkrI0G3SZwhYQgaHr gzxLgh10rIQHWnoqFcE274IjaEcp4XcILeXQkjuI0qHncOoc6odeOFhzSYSOxepYwHArnfNWvEu hGMSPGlVt0LXLItlP9CMhoXW2CtwrOIWBFl3eGGy8oPXgvpu5eIzRh0O/pMOnOEcp3iJMU/xxuF nTZ1GVtdbUB/GLRftD99kcscv576AXGq6DnV7DMPYMJX33EXFdsrCCTxOxSECfjvBV5z+C16mOR 3k65zsLFLRg3lyJ+FEIJPJ9V2u67qVbjuK3ltA4yxTpN5cwOV0PT0yuwdT8RkTmEAs4K3RGJE7L 3m5CutB/6x4aErs+zdhwY= X-Google-Smtp-Source: AGHT+IEhGX78e48TrYxo2s509U+G5Z04kiOtV/5xvL0aLSjfkwogNT0nAqIjjbQQuAkBsvlM1t1xrg== X-Received: by 2002:a05:6808:1818:b0:40c:f698:c132 with SMTP id 5614622812f47-4150fe892famr3383207b6e.11.1752274163233; Fri, 11 Jul 2025 15:49:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 4/9] target/arm: Introduce get_phys_addr_for_at Date: Fri, 11 Jul 2025 16:49:10 -0600 Message-ID: <20250711224915.62369-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250711224915.62369-1-richard.henderson@linaro.org> References: <20250711224915.62369-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::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.google.com 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=unavailable 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752274378138116600 Content-Type: text/plain; charset="utf-8" Rename get_phys_addr_with_space_nogpc for its only caller, do_ats_write. Drop the MemOp memop argument as it doesn't make sense in the new context. Replace the access_type parameter with prot_check. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/internals.h | 18 +++++++----------- target/arm/ptw.c | 21 ++++++++++++++------- target/arm/tcg/cpregs-at.c | 11 ++--------- 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index a02439df63..6c2555610e 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1604,25 +1604,21 @@ bool get_phys_addr(CPUARMState *env, vaddr address, __attribute__((nonnull)); =20 /** - * get_phys_addr_with_space_nogpc: get the physical address for a virtual - * address + * get_phys_addr_for_at: * @env: CPUARMState * @address: virtual address to get physical address for - * @access_type: 0 for read, 1 for write, 2 for execute - * @memop: memory operation feeding this access, or 0 for none + * @prot_check: PAGE_{READ,WRITE,EXEC}, or 0 * @mmu_idx: MMU index indicating required translation regime * @space: security space for the access * @result: set on translation success. * @fi: set to fault info if the translation fails * - * Similar to get_phys_addr, but use the given security space and don't pe= rform - * a Granule Protection Check on the resulting address. + * Similar to get_phys_addr, but for use by AccessType_AT, i.e. + * system instructions for address translation. */ -bool get_phys_addr_with_space_nogpc(CPUARMState *env, vaddr address, - MMUAccessType access_type, MemOp memop, - ARMMMUIdx mmu_idx, ARMSecuritySpace sp= ace, - GetPhysAddrResult *result, - ARMMMUFaultInfo *fi) +bool get_phys_addr_for_at(CPUARMState *env, vaddr address, unsigned prot_c= heck, + ARMMMUIdx mmu_idx, ARMSecuritySpace space, + GetPhysAddrResult *result, ARMMMUFaultInfo *fi) __attribute__((nonnull)); =20 bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, diff --git a/target/arm/ptw.c b/target/arm/ptw.c index c7db93b95c..1866c494ef 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -3545,18 +3545,25 @@ static bool get_phys_addr_gpc(CPUARMState *env, S1T= ranslate *ptw, return false; } =20 -bool get_phys_addr_with_space_nogpc(CPUARMState *env, vaddr address, - MMUAccessType access_type, MemOp memop, - ARMMMUIdx mmu_idx, ARMSecuritySpace sp= ace, - GetPhysAddrResult *result, - ARMMMUFaultInfo *fi) +bool get_phys_addr_for_at(CPUARMState *env, vaddr address, + unsigned prot_check, ARMMMUIdx mmu_idx, + ARMSecuritySpace space, GetPhysAddrResult *resul= t, + ARMMMUFaultInfo *fi) { S1Translate ptw =3D { .in_mmu_idx =3D mmu_idx, .in_space =3D space, + .in_prot_check =3D prot_check, }; - return get_phys_addr_nogpc(env, &ptw, address, access_type, - memop, result, fi); + /* + * I_MXTJT: Granule protection checks are not performed on the final + * address of a successful translation. This is a translation not a + * memory reference, so MMU_DATA_LOAD is arbitrary (the exact protecti= on + * check is handled or bypassed by .in_prot_check) and "memop =3D MO_8" + * bypasses any alignment check. + */ + return get_phys_addr_nogpc(env, &ptw, address, + MMU_DATA_LOAD, MO_8, result, fi); } =20 static ARMSecuritySpace diff --git a/target/arm/tcg/cpregs-at.c b/target/arm/tcg/cpregs-at.c index 398a61d398..2ff0b3e76f 100644 --- a/target/arm/tcg/cpregs-at.c +++ b/target/arm/tcg/cpregs-at.c @@ -27,19 +27,12 @@ static uint64_t do_ats_write(CPUARMState *env, uint64_t= value, MMUAccessType access_type, ARMMMUIdx mmu_idx, ARMSecuritySpace ss) { - bool ret; uint64_t par64; bool format64 =3D false; ARMMMUFaultInfo fi =3D {}; GetPhysAddrResult res =3D {}; - - /* - * I_MXTJT: Granule protection checks are not performed on the final - * address of a successful translation. This is a translation not a - * memory reference, so "memop =3D none =3D 0". - */ - ret =3D get_phys_addr_with_space_nogpc(env, value, access_type, 0, - mmu_idx, ss, &res, &fi); + bool ret =3D get_phys_addr_for_at(env, value, 1 << access_type, + mmu_idx, ss, &res, &fi); =20 /* * ATS operations only do S1 or S1+S2 translations, so we never --=20 2.43.0 From nobody Sun Dec 14 02:00:53 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=1752274359; cv=none; d=zohomail.com; s=zohoarc; b=UczTHgP8l4HHN8jkOl+iiqQc2IJJ0/k7mY60/MR4MtcqCcmp+eszb5Z3ubRzO7K96qoShFEhSp6xmM50RkQHeJpgyaQEqZFKygPi9iJz9kpcjI2FhRA+4GAOZHIqAWXtW77muA6qDXUiF2NzXt0rtPT41VOz+W/4s77IufM/9/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752274359; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pCFS6cqTwlg3fFOqku117fnhPK1D7OaRJaQ+ElcEeuA=; b=SXXrGEIuhbWA4PKxZ1c7+w8c+fQaxrgLce5SV8Ll0cVilFA4y6IVBA0lv9of0H1oqPwEcYP9AD1B75YmI/ECIIi+V+zntXwgz42v28N867vQLaDnc8cWUe0LMrr4dXkQmK99YmKJYN6mWIsIeN5RbCUQOZ2FAINmrcZ6OOg5fLA= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752274359272219.29144374458792; Fri, 11 Jul 2025 15:52:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uaMbD-0001ZZ-Fr; Fri, 11 Jul 2025 18:52:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uaMYc-0007RW-AT for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:42 -0400 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uaMYY-0008Re-B7 for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:28 -0400 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-40af40aee93so1620847b6e.0 for ; Fri, 11 Jul 2025 15:49:24 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 5614622812f47-414197c6064sm696638b6e.20.2025.07.11.15.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 15:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752274164; x=1752878964; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pCFS6cqTwlg3fFOqku117fnhPK1D7OaRJaQ+ElcEeuA=; b=OK/3CtOtNlG1YwdCbDsLgaV0C0IR94svBNywGbUrkb8ap+wQS0I6mLjb2dt+WZ2uCB l0t2fZtDITQ1WhuA7eLSG7K125G+svmNy7Kd7KXlvguSJKWrQCXzdlRdOYtHVQc680fO e6CxxHxf/wE48x4F++sIwZHMvhpFEr6v58E0c2xBd4hlcY5y523Ail56qtJ43bGCNLmG xnm24wJSLa7r2wPXgK8OhCAesDFQ29tNo3yCP0PqjVcn+p9xwZioNlfKCWLI8885X18q ucWwwF7MCz3R4FpTTw3kpXAGxzqAQzeW8HF3wE/0bCJkOvecFxnMprXZ9JZTUF+qIMtz bkcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752274164; x=1752878964; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pCFS6cqTwlg3fFOqku117fnhPK1D7OaRJaQ+ElcEeuA=; b=BJsPTPlrApXO59LrOKGVcWU0+64Ggf2uEa2hyNT15A4FU+sBGuA2kl+N+tLJmyO7QC yxqVcNZlm5MCRNdvoJg2je0QwHUbfB2ewoycD973wwLB72sMxpyQBmsfpH/Vf91MFPiM +RcCO0JGeCI7ZPlwW1tLadH4MMV1hz5OhuAwK3DqxSGTwnd28pw2P9cLB2IFySLvKzZW WnZsxB4dsq6QGaHbbojmd7WVEf8AXWGyNTGKChfy0CI1FiQZ1q9MqxhIXDgBkOAoC41z odaVmDfOHystinrqkS+39+r18hd+oLDC97dsBbAlh0H1z+PZAvXEJrcE77fVP6TsMSj4 aFdw== X-Gm-Message-State: AOJu0YzuW8yiR0sBjiXFhecVlK7oU67PfTdLd5rrunYJe0eJZHjrefXM Sp6NXMY8lp5tLHIc+pQwSe0Zx8rrCmVMreFXS5gceyJAJwTFL2EouL9AOrNOwPcT3QRGKghpIeP X/PeYdO0= X-Gm-Gg: ASbGnctCmGw3YWlvyaRxl+KwFeA0izf46lCg/4ndvhkffu+5LMXB7ST18B2NrZmuLHH DidiT3dhLxGdtaU1DbmkJRobOK0AuxhXIqOhXweSRsGMZyXGUQPEOlNm7AXizGvfh0x+OwszotG LujWUKGgzwQhXdP94QE8Zrz89UC/4L8wsRUm2wCF+4M1BLZbs3I9hFyKvEwGLXejPzP28moTYFb +ANNZ9d6i052j2oPIZLfKfQKPdPTVcRv2MaRQ/jNyBGa74MnoLxS4EJrHq+aHXLtFeP7qi+nCHw 9NwmWf7MOxM+14FqhFgh9bL2dWtgm8jUmCmQKOFdqyGOCLtv+O0MYWDSKOequRga9bXPIIHF/P5 qhRcxlO8YLw/1MrDkW7ljvGlX2WAMag2jGYdHG7+n+i6H5tfMBk2WzRrbn9p/Js0EU3XWU19Z/e JopnRnY8SX X-Google-Smtp-Source: AGHT+IE0kbKNmv08MvHE23M3QnsEtA91s/oN4v56/+kvsVhJ/ISBjSMp6NA19DZO4UgR2OdUB31cVg== X-Received: by 2002:a05:6808:3025:b0:410:f243:a502 with SMTP id 5614622812f47-415659ac4ecmr3328808b6e.8.1752274164100; Fri, 11 Jul 2025 15:49:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 5/9] target/arm: Skip AF and DB updates for AccessType_AT Date: Fri, 11 Jul 2025 16:49:11 -0600 Message-ID: <20250711224915.62369-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250711224915.62369-1-richard.henderson@linaro.org> References: <20250711224915.62369-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::22c; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22c.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752274361647116600 Content-Type: text/plain; charset="utf-8" We are required to skip DB update for AT instructions, and we are allowed to skip AF updates. Choose to skip both. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 1866c494ef..efbad7af1f 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -58,6 +58,12 @@ typedef struct S1Translate { * and will not change the state of the softmmu TLBs. */ bool in_debug; + /* + * in_at: is this AccessType_AT? + * This is also set for debug, because at heart that is also + * an address translation, and simplifies a test. + */ + bool in_at; /* * If this is stage 2 of a stage 1+2 page table walk, then this must * be true if stage 1 is an EL0 access; otherwise this is ignored. @@ -1929,7 +1935,12 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1T= ranslate *ptw, descaddr &=3D ~(hwaddr)(page_size - 1); descaddr |=3D (address & (page_size - 1)); =20 - if (likely(!ptw->in_debug)) { + /* + * For AccessType_AT, DB is not updated (AArch64.SetDirtyFlag), + * and it is IMPLEMENTATION DEFINED whether AF is updated + * (AArch64.SetAccessFlag; qemu chooses to not update). + */ + if (likely(!ptw->in_at)) { /* * Access flag. * If HA is enabled, prepare to update the descriptor below. @@ -3553,6 +3564,7 @@ bool get_phys_addr_for_at(CPUARMState *env, vaddr add= ress, S1Translate ptw =3D { .in_mmu_idx =3D mmu_idx, .in_space =3D space, + .in_at =3D true, .in_prot_check =3D prot_check, }; /* @@ -3653,6 +3665,7 @@ static hwaddr arm_cpu_get_phys_page(CPUARMState *env,= vaddr addr, .in_mmu_idx =3D mmu_idx, .in_space =3D arm_mmu_idx_to_security_space(env, mmu_idx), .in_debug =3D true, + .in_at =3D true, .in_prot_check =3D 0, }; GetPhysAddrResult res =3D {}; --=20 2.43.0 From nobody Sun Dec 14 02:00:53 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=1752274374; cv=none; d=zohomail.com; s=zohoarc; b=gndQMxx5r0R6Db7YlXBRZTGnE6MZMG3jlm3nX4N4NvpQ1QY7hbBnv242mbDfiPXldSxNZ2KlASdIv0+jZJcHXCr1OC7YDLVnw1JBEX10OH1zazaZYycoSZ53fO3Xags9z/9DPwL7XahBZM3CKxprTRl4qUDaaMVY0aI9Yzz1z3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752274374; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=STWIYU9G50oq6+fT8dxvuAWf3Y81wJSGWcY0ZHxvSjQ=; b=SUpQp3OlIGQufnJxhpCzGWzO0XC6dJbUcZ/jLVaNsEE2GIm7OO+VNUJCDKzLMiIuYoQv35OnnTBKfWoniEoRomitqgW/+GkTFNrpGJuHgpqsBs3teij6czG0yTFu045+UcfEfeb5yIXmCSUWBnhb3OaBU/qURmnuiMo4gWB5/mc= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752274374520208.67247651407104; Fri, 11 Jul 2025 15:52:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uaMbk-0002zg-5T; Fri, 11 Jul 2025 18:52:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uaMYu-0007cq-H9 for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:53 -0400 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uaMYa-0008UI-A7 for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:31 -0400 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-73d0152369fso352497a34.2 for ; Fri, 11 Jul 2025 15:49:26 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 5614622812f47-414197c6064sm696638b6e.20.2025.07.11.15.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 15:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752274166; x=1752878966; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=STWIYU9G50oq6+fT8dxvuAWf3Y81wJSGWcY0ZHxvSjQ=; b=aKV+u656HDtopq5iVFZtkl3lAlJ7YMiVjeE22rS25H/qbF9qfmYX29cbUx9P6fAlJp SrNB+BUM8L5ijRBD/9+Y/VKtx3+gsxjz+uEfRC26ed03JuZctyXMtC8y1g9evG6rNXUY 9oSOYFQxvx0pJceIZWlqwJ7KB29rMy4t+OFor6M5hl7G5gU6m/R0FFecsAX9Qsl8BtFM UMpTH5UiSj8WIyhjKxrh2Nll4Or+gFUiFxhbjUoiUyECmRX5RvHMScs8GlKla3W6geSw txoIiAswUI0e+iAdMFAT1BJcqvJTDPAcPJ+IUuZbAo/wLIMqH3gjSPLJVrB2HhvaDE8C 2tYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752274166; x=1752878966; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=STWIYU9G50oq6+fT8dxvuAWf3Y81wJSGWcY0ZHxvSjQ=; b=JrPYcbWRfny1UfH2rC6uRGSRWUnBv4oX1m1/Hfi8Ec5WYo49TTwOan7rmBdjcdnrAV 2RNaqJuFcE1+EldINEpGlxTPEm4R6DFiTcZVr6e6HDGCnMUgzAMsAkQTUcSdFjHWzKfg /WxbUPX0iN8HlXnk+R/WIJEJTrpOouFJoKDwSe9xar11d2muP2R14DHL1Ai4jlRhJ9B9 gzbE4+J9TmYAar4OmS/Z3OGkeEGFHCxYjuhQJ72kfsokWOmoIcMWJdAExtV1r9ZlgojX bJhsyPlHkLDSjU4CQflqDgorNwXnpSNSwsZxHYUsamE2h9Fda29RuTcfXfIAm3yG3IZD P42w== X-Gm-Message-State: AOJu0YxZJMCTvUnQKt1+g8xGpfgqrr/pR2eSphuZvAPrvkk0tOyK+9BD dgrzIDmRIriKZW5523VihDoXOz1F5GcZmbqmg4+0Ns+wk38gDQ3iiJhQ1Oo09+fcz4cSXECyOi3 cm81+kVE= X-Gm-Gg: ASbGncvGIrf52X8KxGgJZOGm+eO0NHJQ12iZF8+8CcOmLPnEe0ozi1c3NCY57kHIA91 IAG7M357TgPjnIK3Pc6JWflebPNRiiApvqUmQhb1aruUjKkJ3eNnkF+2SXdzWBX3pjf37X1zWnv tR0DqnyMs0Oh9yEkwA5Da0+bs9U/YW/roR8a2d8WXoM4UdkNFTzrJdG15bmkG3XTS/u+HvVi3xA qQzSLnm2R8UaLZ4loTf+qzu+3THhp2DIoSOqoC6auMAFgh0leXKgclHZ3NFD3HLJBNZKQI3LngC yzSmA0NA8SU5j9Oap1kj5+MANhSgyLAueYA4u+A0QJrC4jBwGP23R7QFBCnzsGaWfa/3dpZLJFy pOx1lEdv2K1vpr6ywXuGSMhcW1gF5Zyp6s/fWflU755PM/aCakYyOAEg+JihYbS9LSXIZa/COYR NEwsVILose X-Google-Smtp-Source: AGHT+IFA/EbfPu3L3gqXnUBGS8nca6pNF7wXeEcL84IIr+gAZ/L4j4NBXNGlSg61p6S5lP6+eBWYSg== X-Received: by 2002:a05:6808:6c8e:b0:40a:526e:5e7a with SMTP id 5614622812f47-415396c4933mr3617316b6e.23.1752274165635; Fri, 11 Jul 2025 15:49:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 6/9] target/arm: Convert do_ats_write to access_perm Date: Fri, 11 Jul 2025 16:49:12 -0600 Message-ID: <20250711224915.62369-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250711224915.62369-1-richard.henderson@linaro.org> References: <20250711224915.62369-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::331; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x331.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752274375724116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/tcg/cpregs-at.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/arm/tcg/cpregs-at.c b/target/arm/tcg/cpregs-at.c index 2ff0b3e76f..bebf168997 100644 --- a/target/arm/tcg/cpregs-at.c +++ b/target/arm/tcg/cpregs-at.c @@ -24,14 +24,14 @@ static int par_el1_shareability(GetPhysAddrResult *res) } =20 static uint64_t do_ats_write(CPUARMState *env, uint64_t value, - MMUAccessType access_type, ARMMMUIdx mmu_idx, + unsigned prot_check, ARMMMUIdx mmu_idx, ARMSecuritySpace ss) { uint64_t par64; bool format64 =3D false; ARMMMUFaultInfo fi =3D {}; GetPhysAddrResult res =3D {}; - bool ret =3D get_phys_addr_for_at(env, value, 1 << access_type, + bool ret =3D get_phys_addr_for_at(env, value, prot_check, mmu_idx, ss, &res, &fi); =20 /* @@ -191,7 +191,7 @@ static uint64_t do_ats_write(CPUARMState *env, uint64_t= value, =20 static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t v= alue) { - MMUAccessType access_type =3D ri->opc2 & 1 ? MMU_DATA_STORE : MMU_DATA= _LOAD; + unsigned access_perm =3D ri->opc2 & 1 ? PAGE_WRITE : PAGE_READ; uint64_t par64; ARMMMUIdx mmu_idx; int el =3D arm_current_el(env); @@ -253,7 +253,7 @@ static void ats_write(CPUARMState *env, const ARMCPRegI= nfo *ri, uint64_t value) g_assert_not_reached(); } =20 - par64 =3D do_ats_write(env, value, access_type, mmu_idx, ss); + par64 =3D do_ats_write(env, value, access_perm, mmu_idx, ss); =20 A32_BANKED_CURRENT_REG_SET(env, par, par64); } @@ -261,11 +261,11 @@ static void ats_write(CPUARMState *env, const ARMCPRe= gInfo *ri, uint64_t value) static void ats1h_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { - MMUAccessType access_type =3D ri->opc2 & 1 ? MMU_DATA_STORE : MMU_DATA= _LOAD; + unsigned access_perm =3D ri->opc2 & 1 ? PAGE_WRITE : PAGE_READ; uint64_t par64; =20 /* There is no SecureEL2 for AArch32. */ - par64 =3D do_ats_write(env, value, access_type, ARMMMUIdx_E2, + par64 =3D do_ats_write(env, value, access_perm, ARMMMUIdx_E2, ARMSS_NonSecure); =20 A32_BANKED_CURRENT_REG_SET(env, par, par64); @@ -309,7 +309,7 @@ static CPAccessResult at_s1e01_access(CPUARMState *env,= const ARMCPRegInfo *ri, static void ats_write64(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { - MMUAccessType access_type =3D ri->opc2 & 1 ? MMU_DATA_STORE : MMU_DATA= _LOAD; + unsigned access_perm =3D ri->opc2 & 1 ? PAGE_WRITE : PAGE_READ; ARMMMUIdx mmu_idx; uint64_t hcr_el2 =3D arm_hcr_el2_eff(env); bool regime_e20 =3D (hcr_el2 & (HCR_E2H | HCR_TGE)) =3D=3D (HCR_E2H | = HCR_TGE); @@ -352,7 +352,7 @@ static void ats_write64(CPUARMState *env, const ARMCPRe= gInfo *ri, } =20 ss =3D for_el3 ? arm_security_space(env) : arm_security_space_below_el= 3(env); - env->cp15.par_el[1] =3D do_ats_write(env, value, access_type, mmu_idx,= ss); + env->cp15.par_el[1] =3D do_ats_write(env, value, access_perm, mmu_idx,= ss); } =20 static CPAccessResult ats_access(CPUARMState *env, const ARMCPRegInfo *ri, --=20 2.43.0 From nobody Sun Dec 14 02:00:53 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=1752274333; cv=none; d=zohomail.com; s=zohoarc; b=edf/WPgPNp6ABnXLebmpJFBTTBIJoRX5vdM9HMA7AZdyhHZInGlfNzNo609f9VL4WKpnJyRKsEjhbIyYIbXEdN82LHpJg4CWL6EY0Qnrx6wpZCCUpiTptDMHjIraSnVcmN1Q3GHMsAtAttYqtE+Uqd4sNaBSbc61yXQqF0S9cqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752274333; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8MiZSYeSsFc7E9O+r65QuNCOOnlvBtRW+4SiNaYQadU=; b=fVUchR44v7hSbni6aTILepji53IY7m2W+3raPC6f9ejgjvAxOKiA63fagKCkQeniAyPycAfQplVgR8rQf7ll8EoHjRavSIyqMaDlll0UQW/k2hYRh3g+13XIXVF8W1u0JvdsbgtyzBI6WEfQ/+d7f6dCW7QVdAn0+j0AdvYTK6s= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752274333249244.09151291175738; Fri, 11 Jul 2025 15:52:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uaMb9-0001Lk-4D; Fri, 11 Jul 2025 18:52:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uaMYs-0007YL-6W for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:47 -0400 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uaMYb-0008Vl-Mb for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:31 -0400 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-61208b548e8so709333eaf.3 for ; Fri, 11 Jul 2025 15:49:27 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 5614622812f47-414197c6064sm696638b6e.20.2025.07.11.15.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 15:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752274167; x=1752878967; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8MiZSYeSsFc7E9O+r65QuNCOOnlvBtRW+4SiNaYQadU=; b=a47NU0h2PcXOH4zNCoD7V3dG71GE7UpCKUz9PEPlQop4rZzSneue5IeOoLcVQSY+Sz LiRhp0FOJ4DTkRtKKkglfMnBjBYNV7nXyWDqGIsJ+4f3lq6lEgQP/iKw915ssBzreQ5o qmU5cw/KWseapxmOXLkMHyO8hB+Swc7MYmJwZUmGPG1f0o/t+hFLnrsbCWET8QIgK0u7 CtEYRXJmP2Ai85mWjrpZhdbRAcHm4tSbsK6R+xwjlArieCQcUUUxq43m5Yud43Y3EyxZ cdgIHspiNnqp/Jqrrm55KGSgtxoaX+XAhJFQ9wZ88rx29tZbyNddyb/aq6UqOHsO0CmT eV0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752274167; x=1752878967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8MiZSYeSsFc7E9O+r65QuNCOOnlvBtRW+4SiNaYQadU=; b=SiYsoBQWvjjPeh/6qnUFURCyEq+S975Yu+7IxxR5Pgag/6ozrOEGTE23rFDRb4RMFs T4mLakzie5bd4o5NVpXo1S6dx37wczJsv8DyMRk6+qeoyDmSo22YR8o+sF7evIUP1qo7 AyRs9xAE9Tj99RcEb9l+udFJe+mYUHF+d+Fi1AINqazSwEX0BZlv9nttt8tmlQrdrylX c/LF+iSIYr+Gyo2O5omKyn8EbND6b4gns8Mg8wubZI+J6FDeL1c+hThpH9lzntTfVqW0 hR7Awe3/ZlfLuL2NZOOfC3DBB2pXi5/mKhEzGW3WyXWu+8K7yYjwGdgWn0ymbx01qVsT Y9Ng== X-Gm-Message-State: AOJu0Ywa//p+RZkCqOMz5SQP/zp4FEVlG8RIMWC5FxUJvjncjtWqBNMs rpQ5jiCEfDDhfu7M78Aw86ImVoLdyZ4j4Y+wh3NAiSS+wpV59N6uZ/w2OoidQRk8BOgxC8uYiSJ kQOMKqcI= X-Gm-Gg: ASbGnct2BT8Grq0s0/Du5mdQC4jdicj4pgTz1GydpayijEcDVnAKwvAlLN/Kv8RnvmO DKYm5Ze/U2MmDlGoFoTTTjwSQZ9GVjNS8A/lzIAz6TQmRbaK5ow+77QaIG7OnARCVfPARvVzJdh z8SCQQD3ZsG5MvxUUaBlPdUY46k76mdoIzB7G0slZuVpe0ew12N4FBwemgT/8zPW81TBUbKv944 j464e3RvE7QzWhZUN/uGWj0QXnZQ25vuXyzyy5f8OKVpN/Xna6WSa1R21TMTUKTntFwyll539qu E/DEyqRKO8zzbk7KU9Junz1bKSI08IfhVCSGbfYPhkuA5Vs7FAWdAKfKA7nMWFMAxOZI4TVivkQ xz1+v3bkg90s9ZaDIBgMvb7XHYt99LFISZlkmQGkxMXDdJLkfh9zi1FBDsuJNzosTwIYA/1XLpm UgX+qCSfLs X-Google-Smtp-Source: AGHT+IHVbX6gvoj89AkIBy0BO24YTgUwsopb7/bS+LGdYPdlTAQF2c2acGbVaqq/xNclqrP3z0DbtA== X-Received: by 2002:a05:6808:2e4a:b0:409:52f:b361 with SMTP id 5614622812f47-4150cd84e8cmr3798418b6e.0.1752274166877; Fri, 11 Jul 2025 15:49:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 7/9] target/arm: Fill in HFG[RWI]TR_EL2 bits for Arm v9.5 Date: Fri, 11 Jul 2025 16:49:13 -0600 Message-ID: <20250711224915.62369-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250711224915.62369-1-richard.henderson@linaro.org> References: <20250711224915.62369-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::c34; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc34.google.com 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, UPPERCASE_50_75=0.008 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752274335129116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/arm/cpregs.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index c9506aa6d5..1d103b577f 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -408,10 +408,19 @@ FIELD(HFGRTR_EL2, ERXPFGCTL_EL1, 47, 1) FIELD(HFGRTR_EL2, ERXPFGCDN_EL1, 48, 1) FIELD(HFGRTR_EL2, ERXADDR_EL1, 49, 1) FIELD(HFGRTR_EL2, NACCDATA_EL1, 50, 1) -/* 51-53: RES0 */ +/* 51: RES0 */ +FIELD(HFGRTR_EL2, NGCS_EL0, 52, 1) +FIELD(HFGRTR_EL2, NGCS_EL1, 53, 1) FIELD(HFGRTR_EL2, NSMPRI_EL1, 54, 1) FIELD(HFGRTR_EL2, NTPIDR2_EL0, 55, 1) -/* 56-63: RES0 */ +FIELD(HFGRTR_EL2, NRCWMASK_EL1, 56, 1) +FIELD(HFGRTR_EL2, NPIRE0_EL1, 57, 1) +FIELD(HFGRTR_EL2, NPIR_EL1, 58, 1) +FIELD(HFGRTR_EL2, NPOR_EL0, 59, 1) +FIELD(HFGRTR_EL2, NPOR_EL1, 60, 1) +FIELD(HFGRTR_EL2, NS2POR_EL1, 61, 1) +FIELD(HFGRTR_EL2, NMAIR2_EL1, 62, 1) +FIELD(HFGRTR_EL2, NAMAIR2_EL1, 63, 1) =20 /* These match HFGRTR but bits for RO registers are RES0 */ FIELD(HFGWTR_EL2, AFSR0_EL1, 0, 1) @@ -452,8 +461,18 @@ FIELD(HFGWTR_EL2, ERXPFGCTL_EL1, 47, 1) FIELD(HFGWTR_EL2, ERXPFGCDN_EL1, 48, 1) FIELD(HFGWTR_EL2, ERXADDR_EL1, 49, 1) FIELD(HFGWTR_EL2, NACCDATA_EL1, 50, 1) +FIELD(HFGWTR_EL2, NGCS_EL0, 52, 1) +FIELD(HFGWTR_EL2, NGCS_EL1, 53, 1) FIELD(HFGWTR_EL2, NSMPRI_EL1, 54, 1) FIELD(HFGWTR_EL2, NTPIDR2_EL0, 55, 1) +FIELD(HFGWTR_EL2, NRCWMASK_EL1, 56, 1) +FIELD(HFGWTR_EL2, NPIRE0_EL1, 57, 1) +FIELD(HFGWTR_EL2, NPIR_EL1, 58, 1) +FIELD(HFGWTR_EL2, NPOR_EL0, 59, 1) +FIELD(HFGWTR_EL2, NPOR_EL1, 60, 1) +FIELD(HFGWTR_EL2, NS2POR_EL1, 61, 1) +FIELD(HFGWTR_EL2, NMAIR2_EL1, 62, 1) +FIELD(HFGWTR_EL2, NAMAIR2_EL1, 63, 1) =20 FIELD(HFGITR_EL2, ICIALLUIS, 0, 1) FIELD(HFGITR_EL2, ICIALLU, 1, 1) @@ -512,6 +531,11 @@ FIELD(HFGITR_EL2, SVC_EL1, 53, 1) FIELD(HFGITR_EL2, DCCVAC, 54, 1) FIELD(HFGITR_EL2, NBRBINJ, 55, 1) FIELD(HFGITR_EL2, NBRBIALL, 56, 1) +FIELD(HFGITR_EL2, NGCSPUSHM_EL1, 57, 1) +FIELD(HFGITR_EL2, NGCSSTR_EL1, 58, 1) +FIELD(HFGITR_EL2, NGCSEPP, 59, 1) +FIELD(HFGITR_EL2, COSPRCTX, 60, 1) +FIELD(HFGITR_EL2, ATS1E1A, 62, 1) =20 FIELD(HDFGRTR_EL2, DBGBCRN_EL1, 0, 1) FIELD(HDFGRTR_EL2, DBGBVRN_EL1, 1, 1) --=20 2.43.0 From nobody Sun Dec 14 02:00:53 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=1752274395; cv=none; d=zohomail.com; s=zohoarc; b=KBH4F3BqPuequrBo1S0I5v+vbrTHCP5RDAuNDaowgUqConcOrgiCpZ3dEvVl1MGXuWfFEUYyJdzlQcMGRszrFq41rHmsZ6zseoIhBT3RNfucEsFXA6hj2UMmWsC24PY/aA9aJbuWzLf5YtYrfAEgSMiQWwVSCXMMCr9TYTvQQMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752274395; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JYyc4l1Ys1D8hkqY3d5nf+X4jsLM/BFSkkdf36YJhnw=; b=g8DQAXWVZQNPy1g9dZxGVsrb6hc58RNF5ZoCFxYmwe1lWYPUrnDteVF4cJjZL81STS/20uCui0YFDTPrwwm9/T20TFigYHheJ2sU/GOmdAiEf9uUPozf+CAyNHk5fK9VYtF+vBNbRVk2rQXNeatvZkv19ZqFXYWSYdTyiYIl9es= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17522743951601003.1848310615553; Fri, 11 Jul 2025 15:53:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uaMbf-0002er-Ls; Fri, 11 Jul 2025 18:52:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uaMYu-0007cj-Ff for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:52 -0400 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uaMYc-000056-4y for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:33 -0400 Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-40ba3d91c35so1473598b6e.3 for ; Fri, 11 Jul 2025 15:49:28 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 5614622812f47-414197c6064sm696638b6e.20.2025.07.11.15.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 15:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752274168; x=1752878968; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JYyc4l1Ys1D8hkqY3d5nf+X4jsLM/BFSkkdf36YJhnw=; b=m9TVgoZHvKRcLh3g/xQNJ8h6rRCmdrahgH32pBhYN+UvZamoP3B8oG5Q57mt1hRSWc apAnF/H9EXVd1EqrMDSHzRwC7m5G9IsCAlrZOJvMQftybYxZ55+9jaGgZKt6dVBGiuC6 6e9piNJ644/3J2sOaSVt8PZi892xJDxJHDEuCdEyvMpv4Gw+BpZazsedltIcTgsGW1Vx TpAyhG+NxQPRACpuYLxpq8YEQ1uMRplsO4zF31GK7qEunvAVMI/lp1dU9BaQT9uEpBIW ZVF2PWSW7agJqTGLB7BihCQWOX3IAUCgYmjf8j3AMVodkIeQdO0dgsP1XvyVtxlaHl0c /6RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752274168; x=1752878968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JYyc4l1Ys1D8hkqY3d5nf+X4jsLM/BFSkkdf36YJhnw=; b=f/4hPUcad72e5YrDys3KJ28OhKMOMic8OYZ5Z6i7O47cq7gIZzcM82ZzXQQfyUHjnn AYLvC3lhtSnfJF9blck9IZ/Rc50LkAMwO6YndZdw7cAZMYqxgBufRQXZkMUFqK2VL1j9 k6XeQNZ/1M2KkZtfNgJy0Nup/y2WGVtPRmsqp24ZQhfI9mdO3F9O+1fZw8fQtPwa7gR9 3v1tTAXtrkSL7AjGfHZ1iAQUmm67GGPV2XkdSHd4QEhHmXZRd/hPfcTLHgQZ4gWeA1o+ mul8yQDkGjZrVSTODXX4vCLRwgLaeSR/6QKqjEvzaOIt6OC2wU3BSwPxkDnnBy2Db18i kurQ== X-Gm-Message-State: AOJu0YzuzpD/f2oeGTIP9YEX9NOGjC1pOULERSXMprI4wwwZsYmZ+7sN ZYpgBq9HfwwywYDRqzX7mS2UEytBDwLcZZEXWKTO4cOBglvURmAzrRJhTh6A7x/9ol1YzhFaeUK QjoCKidg= X-Gm-Gg: ASbGncs2xEHEDN+VihQFc1Ln5Ku2Zacf+i6uTsukfe7MyzLfthtwfEb6tkUrkk4WSJm dPlse4Q0WdOUWftf5XdqWu6JOFKHWGxZ9LWg5nq//n6byhzrLPhl1/XHFjtHIq2i7csw6A0l4+3 /jk55dx40O+uh+/aAH5u0zHKACzxQT5NX8syCCDs67qV8DKhdFMU9uow1dL4updMzye5Ebc5bl3 olZBYhCbn6zNAfG+lmfNx+uRFOHsq2Mue6FTfF4eAAqd5gBa2lYLdHChLAkKoxRyN5AwKREFPA4 wE6vmxYMEXrpHsAOkEeqF4m8kBREqzT6X6t8hEnLMWEBlHaRcNZxP8lfJP7EEK/+YuweOwY4K3c xj87d5T9x+vqxzxe3LtKqoXZH5eFBRPnLnSYfQEFhpwh3NxGDJMKcYf81qrfMG4+WIs4MQ6ZWfu Mx7tFqXrfAZh5DIY1IlbM= X-Google-Smtp-Source: AGHT+IF+3kBtBrg3gzB3gMKCw2m/2p2GrSRGyXYjuDsb3AOQrJOytctWOPgwtDDckgfD/R7b3FIjyA== X-Received: by 2002:a05:6808:1796:b0:40b:3631:f757 with SMTP id 5614622812f47-415393d609bmr3399554b6e.19.1752274168000; Fri, 11 Jul 2025 15:49:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 8/9] target/arm: Remove outdated comment for ZCR_EL12 Date: Fri, 11 Jul 2025 16:49:14 -0600 Message-ID: <20250711224915.62369-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250711224915.62369-1-richard.henderson@linaro.org> References: <20250711224915.62369-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::22f; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22f.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752274397930116600 Content-Type: text/plain; charset="utf-8" The comment about not being included in the summary table has been out of date for quite a while. Signed-off-by: Richard Henderson --- target/arm/helper.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index ce981191b3..8c8eea7109 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4548,11 +4548,6 @@ static void define_arm_vh_e2h_redirects_aliases(ARMC= PU *cpu) { K(3, 0, 14, 1, 0), K(3, 4, 14, 1, 0), K(3, 5, 14, 1, 0), "CNTKCTL", "CNTHCTL_EL2", "CNTKCTL_EL12" }, =20 - /* - * Note that redirection of ZCR is mentioned in the description - * of ZCR_EL2, and aliasing in the description of ZCR_EL1, but - * not in the summary table. - */ { K(3, 0, 1, 2, 0), K(3, 4, 1, 2, 0), K(3, 5, 1, 2, 0), "ZCR_EL1", "ZCR_EL2", "ZCR_EL12", isar_feature_aa64_sve }, { K(3, 0, 1, 2, 6), K(3, 4, 1, 2, 6), K(3, 5, 1, 2, 6), --=20 2.43.0 From nobody Sun Dec 14 02:00:53 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=1752274364; cv=none; d=zohomail.com; s=zohoarc; b=ca6/pO9bz7c3HbqsyXeZh7fQQgpRENwhM8IJ3sWDDkuxJEwRn+5NrFdqmEofa21Ik8qB6detdnzxjbYgVN7AwT577gjmXs/WVhd+S9k0qRz/FHd8UyxVzEvzBtie4OfP1M6iO1Vt75dRNvKykpoidu6+/lk6LBPx56CJs1DDGxM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752274364; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=d2EtIwYhWBdunEnHZqFFjPpeIhDqDk+A7MtfcXFRuII=; b=BqTqgmr1S1ZFLmDFYfccwyRHVM3O1PdFhL8myVenF/X7E3CqoHmx4kA/5qZtG9n1IChMWQOO2xd7wbFOo2L0g/VJFh/0C4FKtuLGcwCGFF7KPDebxNAc6ksL6OhaR8xD5Bzp3CMRIWCtJkZ5/ilPlCb6Mo01DXbzVtDck8ltoXU= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752274364141431.12641293270804; Fri, 11 Jul 2025 15:52:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uaMbD-0001Yl-3j; Fri, 11 Jul 2025 18:52:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uaMYu-0007cf-DG for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:52 -0400 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uaMYc-00005c-13 for qemu-devel@nongnu.org; Fri, 11 Jul 2025 18:49:31 -0400 Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-40a7322f081so818512b6e.3 for ; Fri, 11 Jul 2025 15:49:29 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 5614622812f47-414197c6064sm696638b6e.20.2025.07.11.15.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 15:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752274169; x=1752878969; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d2EtIwYhWBdunEnHZqFFjPpeIhDqDk+A7MtfcXFRuII=; b=PfDOkud/4TKpgDnaztEFd/Fwhk2EFXCdE67D5oHWDXsbGAXt+QN6+bgKRD51U10zph k8nBNgyM+VIKDaa1g78+6L/XWL6fWEyAJ99SIzzXo5VLvQ3OZex5FBshEJFPcwObvUED XhRpNUfQ2BezdmHvWDXlysIaKDSZuTHcw7hv45fuuwmutxvhtGQxQe8RMSPtw7liMiWU DBeyHrTKnJjuycNzKKiA4mvrEiTEzl0zf2j0c8GV/R7woDpGN8V+hgRB5f93/LAI7G5o CXwJ2L5fYyNMj3rCwDtjKl25fOe3vTHS5kOaIdkkL/H3Wm/GhQkocWmY7THgQM5LiMEe Bokg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752274169; x=1752878969; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d2EtIwYhWBdunEnHZqFFjPpeIhDqDk+A7MtfcXFRuII=; b=iyILhyEC/vjRE7IDaXPt8OgqfoS+2hNd4RAhZG1R7NkcssVTNxNbnycjWf6xcRzYcO 230y1fuKd/YTlaxSNUY3b76l0TzvqDwbCGDnxQy+64vtvgRYFFwrrl20OrEe25o3bu1i FshHPpBdzu3bscQX2lqg7fJOsGh3wsDiWMouXgnfctUvfVaBmvsw+sE9sXebyFx5oXfc mZfXruSwpSSRg2W5bgkAqKPdVqmBK4no+9viLCjrv++3LfCkODa8ZrOFZoShX7R9sOrq SQqjHiqZupiG08oUum0envXCnK40oG0RKJakzQkUE+vwXyaemcUenZCzr7E9HHqRezHK 00vg== X-Gm-Message-State: AOJu0Yym1mAVnNFfmQPMYsd6cUAlqHVC/Gq/BrV5+5H9t8wDPFP+UYi9 S7iXAwoOVs847NbP1JH5F2NS3J2xiFatD2E62APkAladW7tQeG3pds8DeM863IEahpQk1Z9vl35 3rsbvmz0= X-Gm-Gg: ASbGnctiG6/pZ9fErnXOFiHZwc3lUfj6fXVMpG/UaSdYMje4EWRY0IPzfX1kRUcFl2A wQ3LRVbqSQVrPuJC6a9Gv7CgupUuqC6fUBOqx+i8qiUN2h48oPLaQDhk17rmaxN31oOFQCx94ll CmzvPSMraGkfc1N4a7e8sYOkd0uPmOj9WA4HL0BBtcSt+95IywVrjutixKvjejZkgt5DZnA5nLl kPW8Wtwpi3BoLQxPu+LY3mostYkTYf5P96mYvMGX8luFyY/YR1cexfjS5ivA7Sb/DvweuSEsNwe d/NTb4nDHgiuMNMnLc2KBC+ScAbCwtDGh/G9ZjeWTHOH7q0LtnyeBHVUrvSfOd/iMCfWMZEnHT2 XG2/apBfDEidOVNQPPxIyh8gs8oOIkDQ9XGChPmEn8kpsRfM9uhJ+P6/hRvUFXybsPtIvx0Ae7C jOMVn8zZXb X-Google-Smtp-Source: AGHT+IEn/PA3k57CrwemTqq2CSfrbk3qBl1ec7azLVYMydFm5oq1w6HJu3mW8OigkDbfRVb/jEA7qg== X-Received: by 2002:a05:6808:3505:b0:401:16e:918e with SMTP id 5614622812f47-4150d645624mr4272202b6e.8.1752274168766; Fri, 11 Jul 2025 15:49:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 9/9] target/arm: Implement FEAT_ATS1A Date: Fri, 11 Jul 2025 16:49:15 -0600 Message-ID: <20250711224915.62369-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250711224915.62369-1-richard.henderson@linaro.org> References: <20250711224915.62369-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::22f; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22f.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752274365772116600 Content-Type: text/plain; charset="utf-8" Implement FEAT_ATS1A and enable for -cpu max. Signed-off-by: Richard Henderson --- target/arm/cpregs.h | 1 + target/arm/cpu-features.h | 5 ++++ target/arm/tcg/cpregs-at.c | 44 +++++++++++++++++++++++++++++++++++ target/arm/tcg/cpu64.c | 1 + docs/system/arm/emulation.rst | 1 + 5 files changed, 52 insertions(+) diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index 1d103b577f..2a4826f5c4 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -854,6 +854,7 @@ typedef enum FGTBit { DO_BIT(HFGITR, DVPRCTX), DO_BIT(HFGITR, CPPRCTX), DO_BIT(HFGITR, DCCVAC), + DO_BIT(HFGITR, ATS1E1A), } FGTBit; =20 #undef DO_BIT diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h index 9579d93cec..7f2ca51b4c 100644 --- a/target/arm/cpu-features.h +++ b/target/arm/cpu-features.h @@ -609,6 +609,11 @@ static inline bool isar_feature_aa64_lut(const ARMISAR= egisters *id) return FIELD_EX64_IDREG(id, ID_AA64ISAR2, LUT); } =20 +static inline bool isar_feature_aa64_ats1a(const ARMISARegisters *id) +{ + return FIELD_EX64_IDREG(id, ID_AA64ISAR2, ATS1A); +} + static inline bool isar_feature_aa64_fp_simd(const ARMISARegisters *id) { /* We always set the AdvSIMD and FP fields identically. */ diff --git a/target/arm/tcg/cpregs-at.c b/target/arm/tcg/cpregs-at.c index bebf168997..0e8f229aa7 100644 --- a/target/arm/tcg/cpregs-at.c +++ b/target/arm/tcg/cpregs-at.c @@ -488,6 +488,47 @@ static const ARMCPRegInfo ats1cp_reginfo[] =3D { .writefn =3D ats_write }, }; =20 +static void ats_s1e1a(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t v= alue) +{ + uint64_t hcr_el2 =3D arm_hcr_el2_eff(env); + bool regime_e20 =3D (hcr_el2 & (HCR_E2H | HCR_TGE)) =3D=3D (HCR_E2H | = HCR_TGE); + ARMMMUIdx mmu_idx =3D regime_e20 ? ARMMMUIdx_E20_2 : ARMMMUIdx_Stage1_= E1; + ARMSecuritySpace ss =3D arm_security_space_below_el3(env); + + env->cp15.par_el[1] =3D do_ats_write(env, value, 0, mmu_idx, ss); +} + +static void ats_s1e2a(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t v= alue) +{ + uint64_t hcr_el2 =3D arm_hcr_el2_eff(env); + ARMMMUIdx mmu_idx =3D hcr_el2 & HCR_E2H ? ARMMMUIdx_E20_2 : ARMMMUIdx_= E2; + ARMSecuritySpace ss =3D arm_security_space_below_el3(env); + + env->cp15.par_el[1] =3D do_ats_write(env, value, 0, mmu_idx, ss); +} + +static void ats_s1e3a(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t v= alue) +{ + env->cp15.par_el[1] =3D do_ats_write(env, value, 0, ARMMMUIdx_E3, + arm_security_space(env)); +} + +static const ARMCPRegInfo ats1a_reginfo[] =3D { + { .name =3D "AT_S1E1A", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 1, .opc1 =3D 0, .crn =3D 7, .crm =3D 9, .opc2 =3D 2, + .access =3D PL1_W, .type =3D ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, + .fgt =3D FGT_ATS1E1A, + .accessfn =3D at_s1e01_access, .writefn =3D ats_s1e1a }, + { .name =3D "AT_S1E2A", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 1, .opc1 =3D 4, .crn =3D 7, .crm =3D 9, .opc2 =3D 2, + .access =3D PL2_W, .type =3D ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, + .accessfn =3D at_s1e2_access, .writefn =3D ats_s1e2a }, + { .name =3D "AT_S1E3A", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 1, .opc1 =3D 6, .crn =3D 7, .crm =3D 9, .opc2 =3D 2, + .access =3D PL3_W, .type =3D ARM_CP_NO_RAW | ARM_CP_RAISES_EXC, + .writefn =3D ats_s1e3a }, +}; + void define_at_insn_regs(ARMCPU *cpu) { CPUARMState *env =3D &cpu->env; @@ -509,4 +550,7 @@ void define_at_insn_regs(ARMCPU *cpu) if (cpu_isar_feature(aa32_ats1e1, cpu)) { define_arm_cp_regs(cpu, ats1cp_reginfo); } + if (cpu_isar_feature(aa64_ats1a, cpu)) { + define_arm_cp_regs(cpu, ats1a_reginfo); + } } diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index c54aa528c6..22ccc4f697 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -1178,6 +1178,7 @@ void aarch64_max_tcg_initfn(Object *obj) t =3D FIELD_DP64(t, ID_AA64ISAR2, MOPS, 1); /* FEAT_MOPS */ t =3D FIELD_DP64(t, ID_AA64ISAR2, BC, 1); /* FEAT_HBC */ t =3D FIELD_DP64(t, ID_AA64ISAR2, WFXT, 2); /* FEAT_WFxT */ + t =3D FIELD_DP64(t, ID_AA64ISAR2, ATS1A, 1); /* FEAT_ATS1A */ SET_IDREG(isar, ID_AA64ISAR2, t); =20 t =3D GET_IDREG(isar, ID_AA64PFR0); diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst index d207a9f266..1489c262b8 100644 --- a/docs/system/arm/emulation.rst +++ b/docs/system/arm/emulation.rst @@ -23,6 +23,7 @@ the following architecture extensions: - FEAT_AFP (Alternate floating-point behavior) - FEAT_Armv9_Crypto (Armv9 Cryptographic Extension) - FEAT_ASID16 (16 bit ASID) +- FEAT_ATS1A (Address Translation operations that ignore stage 1 permissio= ns) - FEAT_BBM at level 2 (Translation table break-before-make levels) - FEAT_BF16 (AArch64 BFloat16 instructions) - FEAT_BTI (Branch Target Identification) --=20 2.43.0