From nobody Sat Nov 15 01:04:44 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=1758046442; cv=none; d=zohomail.com; s=zohoarc; b=jtT5hRNZoHO9G/7fGvhVNudG/5lqoYZLgAvrDPJveaTUIYLOd9ytc1elsl45ji3xect1D16DO7zapjokO9TIyg5LGSUpt1OFno45YvjCvciZOAdm2Kzk9mNUfG5QDOcdI1BeKt8muDgN2EXsX4iHqHIvCp3UJbeVdNtKAMTjApM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758046442; h=Content-Transfer-Encoding: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:Cc; bh=2jY99sznuAdHkjwdN7SRLmA+n/jUeQ2zxUjbOwbHyAU=; b=OK8AJN4qqebDp0F/FF9oCRdmkTfD2OytdLv8EU2cpf6b5yXlZGXXacLN5otkX3QWWKWkQNyhE0sT92b2w/JtFGGAkOZEHqyaGo07bpwfPyTTzyq+pC5BLnMUfmR9zz9Y2GaK6JeKnsgNxY0czXuQtNhUQK5VyIoBqB8eQmXgICI= 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 1758046442402854.5151401835326; Tue, 16 Sep 2025 11:14:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uya4V-00034G-5G; Tue, 16 Sep 2025 14:06:31 -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 1uya4R-00030F-ID for qemu-devel@nongnu.org; Tue, 16 Sep 2025 14:06:27 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uya4P-0001aB-NY for qemu-devel@nongnu.org; Tue, 16 Sep 2025 14:06:27 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-45f31adf368so12705325e9.3 for ; Tue, 16 Sep 2025 11:06:25 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3e760775880sm23033286f8f.2.2025.09.16.11.06.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Sep 2025 11:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1758045984; x=1758650784; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=2jY99sznuAdHkjwdN7SRLmA+n/jUeQ2zxUjbOwbHyAU=; b=kYlf8WCHb3KpkrT0X7cFidAsyOHXLc8ITYDgjsIAwDJvsQ2yARtJjAPAOiul5IsXnC 1LmcihtUgK8dQ8fsScAF0OmNhVHyecSKGBDDulwqfihk7/LE0dav7FgpbzSyTaoHuij8 2PAHiD18WE6MNKjnqJsISOM0iNPLSo30AAYZSjT+VFXGjN7aCvzpXNxgsIL+gIywRi9G o3JPCu9rmSJFXCGn8cuhkaUnIZs+kecZM6k9Y0t+kwDY02lR8TWvVUULXEyJ93QFHUIc 801Qj0/wEYaQmXHPBwQ4MHWvelw4H36CPFqLK6l132OHjS7cln1SUTs6GrrobNhqLKk0 HQlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758045984; x=1758650784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2jY99sznuAdHkjwdN7SRLmA+n/jUeQ2zxUjbOwbHyAU=; b=fBMz1PDnb5t8e73mDo5wFTyxC8zdAwo/DBL7gxi7K5Q+CbifWuhzaXen5HLveWydsQ 5vsHt3PIQAiOiyezKh5Jq1oFZ59oMLhgpw/7apcBkzl7mRrIhNBW5e/tAidDK1PV7FmG G/7ef5/T5Wg6AwSXTZ+FXa8A/5tQVAEg1V+IsS4kWQbbYOBTpVVBJDbacH9YSBKd4rm2 bA+4kxzjtgbAFrHaN9/duu6Hk1hRhOVRLP39WA8yAC406VZHFaEEM0CA5EIE3E4aryyl DSFiYBDkwFwcIJrreP5Yi5IbdG/6XfeR5mANvD00rZyO2KfwoTuxVe8xLe/fu8eBDvNl 9wpw== X-Gm-Message-State: AOJu0YyjJWXJOQtZNo5uSA+LN58BGbjKDWqb7+i9Ja8nAjTJBF7qEux3 s/U4p0JDDMZ7BDDjVocfIe31COVfEtBakves4ZQmbDGMRKHccEMSnGpBN393d7hn2vjoPIo0sth P+dnu X-Gm-Gg: ASbGncuQrpX5qkcuqHiJs8E1CaYVL4ZcgWxsWxdvHykk2ApOR86fM2YHTAhmlErIx7E wtc32N5ViMAHRkX1J03qhIQRiscToJ0AroOqhoxIlJfBfQUFQcaO46OQ9gnhCmT2rPkoKdYe3gS 7v5+cckFLUU2ge7cMZcV5jTdRKxTgqbQtp+mIi7N/bK1N7JK88mEqaOLFN+BKHGGxL4Ky87y09t wWXi+6CMF6AyCS6nxHiJS11CjBMBZfrl1SuyWEKzxnJwagvh7SEN89XEY9L07hXM6aGE9HQ+Wa0 /aCxDMuF6j8FLcbOx+dSNSEOj3BkYGoVinO1yAHoCz5fmDIIyVxPq4rGKsgZpMtalyTcykVdVAT pYJSyp0WWH70O2lWKyImbngmJbkgv X-Google-Smtp-Source: AGHT+IGIiQzM3MEcLTPK1QcUscwu4wnT5ho7kLIFRtXE8WbBDU9xnKjuYghFvVDDQnOkXeN44G4IKg== X-Received: by 2002:a5d:5886:0:b0:3e4:64b0:a776 with SMTP id ffacd0b85a97d-3e7659fcbc7mr19051832f8f.52.1758045983714; Tue, 16 Sep 2025 11:06:23 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/36] target/arm: Add prot_check parameter to do_ats_write Date: Tue, 16 Sep 2025 19:05:44 +0100 Message-ID: <20250916180611.1481266-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250916180611.1481266-1-peter.maydell@linaro.org> References: <20250916180611.1481266-1-peter.maydell@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=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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: 1758046442842116600 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Separate protection check from access type, in preparation for skipping the protection check altogether. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson Message-id: 20250830054128.448363-10-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- 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 2ff0b3e76f7..bebf1689970 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