From nobody Tue Feb 10 18:55:39 2026 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=1661186854; cv=none; d=zohomail.com; s=zohoarc; b=hmfUHU48QBcpUcAJhGjE+5k3JdFIaE3KaMRrWcUdr59rubZUmmvz5Rm12KHb1GxatQIP2KEcWVzCzk8ut0+0Tv5o6dcZg54OEc5RHBzQ7hjmHV8k6oqVEcrAdOTDpyooE3Ed9yorvIpT9wqYyFFfEkBFMd0f6Xm9Rh/+A/YwP28= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661186854; 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=Zb+z0FjSLpuiqB1QCemcMh6uuV1Mpuz70yGjsr65duc=; b=Gqi45ZaBoC13yvFeWsKGbYdzhm+egYiajqT+hikqlERQyg9B/ofVuaQEmDmTpu/utt5FLPFDWQ5UFNloLpgdA5QV3JehQsfxiSX+cerX41rVURvWzYyheo/l4smU6u9tCxvbh6i00H7ZhjVn4xAEs3o0HKS8jXPQukwHuqMlcNI= 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 1661186854689684.4028687856865; Mon, 22 Aug 2022 09:47:34 -0700 (PDT) Received: from localhost ([::1]:54376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQAaL-0008Dv-GS for importer@patchew.org; Mon, 22 Aug 2022 12:47:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQ9Lr-0000Vu-Jj for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:28:31 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:42981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQ9LZ-0000nY-P1 for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:28:31 -0400 Received: by mail-pg1-x529.google.com with SMTP id 73so9668111pgb.9 for ; Mon, 22 Aug 2022 08:28:13 -0700 (PDT) Received: from stoup.. ([71.212.157.236]) by smtp.gmail.com with ESMTPSA id q7-20020a17090311c700b0016bffc59718sm8665222plh.58.2022.08.22.08.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 08:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Zb+z0FjSLpuiqB1QCemcMh6uuV1Mpuz70yGjsr65duc=; b=E9rcRkjr7AHEk9+4lfY3HJ7xUVpDDndz0I28JYB4KuTCO3BGfUrDrjZmGhqZQS3vCF ekMP6jOxLfzNXDIv0Mr0qJjVB2uPz4xhTv/YDjSMbtQn5eYBoy8gB34DvlurJDtW6LC/ d1cPXxyHABiXBFp7C4EqqN5JbNTu6Z8VzjopZeCiSz3sLVzVCwiyIU9diDUjj8IKxAZG 9Lw6tBf9L8qS8qFu0kL4Ybb++Dw5FVelTL5ubKNqw1+oZXg/X2d+xzGpgbSctdzjkmw1 FkuYIANe33u0j56IGZp3m8tZDf10W18xjYZJnn45pUlYbShnFD+ewE7w6d+QNiRIQ19V sVrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=Zb+z0FjSLpuiqB1QCemcMh6uuV1Mpuz70yGjsr65duc=; b=lZr9kCdI442Jo9zafE76zjxsQhtDtQP/bPjxeYbtRA0qsiF+Z3FTcEk4GIPvFjcAEx KGtvdp3HXCzmZ461vSSwxMdgMT6I0OEojryYp41LmQRwiwrq8+YAaGXIhDhtb1LIXyWR V9ksYLmnW2B7eyTn6DDE2DA6f59iuc7DWaTvnSPTNZu5KNkkITEhOt8TiImvIx4I2xTu GGT9wlKvt7NYVUbxumEK+HZD63MqqqrVAku0DmFBr9Mj/omNxW5SYyc9ufgMPQClbMsf 2oOZb1NneoSPXGmUGHGRSqBpMJSHpO/8GglJZi3JOQQu7m5OHes01Iiz06ZweNUKNv+N +Yaw== X-Gm-Message-State: ACgBeo3oi1+VPaH/K5JYqbLzKomVOsDgs0y+FXOc/xaBSACwoDJxPGlY 0qK+kUcLJ2m0LPg5SIUd36ExJWsX++Wumg== X-Google-Smtp-Source: AA6agR4j08DMw9QFKgs2ydM7KjwRLzaElgfRdAV0+jgq+Fl5W/uzAIIsxqOZkU+feB837A5hYqTlpw== X-Received: by 2002:a63:1a18:0:b0:419:aa0d:4f9c with SMTP id a24-20020a631a18000000b00419aa0d4f9cmr16693722pga.389.1661182092906; Mon, 22 Aug 2022 08:28:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 34/66] target/arm: Fix ATS12NSO* from S PL1 Date: Mon, 22 Aug 2022 08:27:09 -0700 Message-Id: <20220822152741.1617527-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220822152741.1617527-1-richard.henderson@linaro.org> References: <20220822152741.1617527-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::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1661186855835100001 Content-Type: text/plain; charset="utf-8" Use arm_hcr_el2_eff_secstate instead of arm_hcr_el2_eff, so that we use is_state instead of the currend security state. These AT* operations have been broken since arm_hcr_el2_eff gained a check for "el2 enabled" for Secure EL2. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/ptw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index fe06bb032b..4da932b464 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -146,7 +146,7 @@ static bool regime_translation_disabled(CPUARMState *en= v, ARMMMUIdx mmu_idx, } } =20 - hcr_el2 =3D arm_hcr_el2_eff(env); + hcr_el2 =3D arm_hcr_el2_eff_secstate(env, is_secure); =20 switch (mmu_idx) { case ARMMMUIdx_Stage2: @@ -230,7 +230,7 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMU= Idx mmu_idx, return ~0; } =20 - hcr =3D arm_hcr_el2_eff(env); + hcr =3D arm_hcr_el2_eff_secstate(env, is_secure); if ((hcr & HCR_PTW) && ptw_attrs_are_device(hcr, s2.cacheattrs)) { /* * PTW set and S1 walk touched S2 Device memory: @@ -2360,7 +2360,7 @@ bool get_phys_addr_with_secure(CPUARMState *env, targ= et_ulong address, } =20 /* Combine the S1 and S2 cache attributes. */ - hcr =3D arm_hcr_el2_eff(env); + hcr =3D arm_hcr_el2_eff_secstate(env, is_secure); if (hcr & HCR_DC) { /* * HCR.DC forces the first stage attributes to @@ -2493,7 +2493,7 @@ bool get_phys_addr_with_secure(CPUARMState *env, targ= et_ulong address, result->page_size =3D TARGET_PAGE_SIZE; =20 /* Fill in cacheattr a-la AArch64.TranslateAddressS1Off. */ - hcr =3D arm_hcr_el2_eff(env); + hcr =3D arm_hcr_el2_eff_secstate(env, is_secure); result->cacheattrs.shareability =3D 0; result->cacheattrs.is_s2_format =3D false; if (hcr & HCR_DC) { --=20 2.34.1