From patchwork Mon Oct 10 14:27:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 613752 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2025939pvb; Mon, 10 Oct 2022 07:55:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM58gjL7UdazIMym+FgU6EzVJCmurOxzbeDCLr3EL0bBzPekv9uwQVfCgvTOGlgHjaKgCrgJ X-Received: by 2002:a05:620a:4054:b0:6ec:5735:2e20 with SMTP id i20-20020a05620a405400b006ec57352e20mr4642114qko.321.1665413710324; Mon, 10 Oct 2022 07:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665413710; cv=none; d=google.com; s=arc-20160816; b=W25JKePXL29hz7SGid8sZH1SMuRXh24UEo60XGilFWAUjk0Eu4orDpGY0Uo+nQul0D hY50HMIBDlNeQQCoN9B7I/8q4uNppQpSfE9Caubhrvb7Nzz2gv7Flvtml75mXrdGDklj OvbU8z4zm2K96xz4c9EmUfYXIP9lTVCZFvqGI+sobN1vOoCZ1f0xUv63Yw8NYsBMeWSK ANRz31Kckk+2vbwEMy8Y7guviIvE3re1+Ai2vKoLlgE+gDR2tvdSVirqWjwam0AtQqMs fv1C+Gt3Ba/qn6vVn9kadlb1MuPlLLTp27yvQOFlNpNdyUWo+T4R5ZcnUuUXTdv+isxX uR7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=LdE7Yti6FxQSUdCITEyW9uuJhLKh/sdf2KHare74vR0=; b=WllxB+HL9EnUdA909Jsfeyv5RTsseFy61Zeto62G/YWPZuX5PZedpk4dqHOZR2o0aS Ykeaj+Xw5cYZUP/qVxfuW/zId/vennqnuUNhZLrW7ASUEQaVRzG4ar6NKsvDh0rSF0Fq pIJ6dhLDDxEiByERlJHz+Tsy5fbPblkBeRK2smQYkP8hNyaI8ZTnwpZgN2Mg2eOTjkBi P1GeQHUWjC4rAVJC6ewpzG0cHcEW3JQkIrnJk9oRJDwQVwwzY0q/onj5C2laGs+/0bII eCkYozOZx4AJx9cbiSGCi6YLrlKt11DORToVwkt9h+l7+K4LTk8BBNFObFFqH5Ly+6af VE8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aFQEuFHi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dv21-20020a05620a1b9500b006e94ff8a14dsi4693442qkb.419.2022.10.10.07.55.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Oct 2022 07:55:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aFQEuFHi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohuBR-0006tV-R5 for patch@linaro.org; Mon, 10 Oct 2022 10:55:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohtl6-0006Ra-U0 for qemu-devel@nongnu.org; Mon, 10 Oct 2022 10:27:57 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:33696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohtl5-0005Xa-F2 for qemu-devel@nongnu.org; Mon, 10 Oct 2022 10:27:56 -0400 Received: by mail-wr1-x431.google.com with SMTP id a3so17363477wrt.0 for ; Mon, 10 Oct 2022 07:27:54 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LdE7Yti6FxQSUdCITEyW9uuJhLKh/sdf2KHare74vR0=; b=aFQEuFHisonfMCGI5FQjrVwCx5akThnTiL3cOTUP6MDy+JwuaY9vxnbq7nYuljtg2g PgR1iQNV/lbwaVqbcV2oPzwgbgWVullEjVE16qqq1H/d+RcnwF+FdP65Hmnugyo6aBgV 3entSGfjdvDpVY4Fi1zEgMabgppWAfoTelY2TvW+oL+6tscFlTzN4awbqOWZDq3dLc8i rj8VwKBbzsNmaQKmY/Ms64zL5mb4/32QjTwCUhxPHtF1P4Bw7rmkcJH5V/6yyCx7BW9y L0DiREGwBf3TNPmJiFEvI/EMqtLntnrs4rslqsBz6JCSEGofcyV7P5Q+giDWikP8r0Td aiLA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LdE7Yti6FxQSUdCITEyW9uuJhLKh/sdf2KHare74vR0=; b=yin5HEQw0gEDvGxkXAcvLig+xDo2VQ7ajEHd0HFjbedbypi0/xOVyZM4gGZMiRYhEq askGKFOAMc0ovh41hbPgAVnIm9r8XJnd6WKGks3Q4sl28/58q7D6peqyIJfuzCkaAjsr wTg6dcLfddymi2y5Xa0ijm9ZFaVD+GsHYE6V71o0qcwwQHmHiGqFS0gA/zukIUOTix4D eAHcC3f7FWZvjgx2WivKAIZPgWQtsvVMvBm/mXoI5WXnrPk5f8OVGjILOceooYdF/0dF QSwBz+BLmAokxmaJ/2A00vyxxdsB9RQ7oVV8FmecMNoJDxTOhRAXSZsEw7sUfgOM/BVV /8Lg== X-Gm-Message-State: ACrzQf3cXkP1cE9/EOqtsvMRJto1VelOuzCTmo2rhPdRGt16DFw5FRIf Qo8ZEotJ3QIND13EJeEsy5lKJuyYwQb0LA== X-Received: by 2002:a05:6000:186e:b0:22e:5dd3:e32a with SMTP id d14-20020a056000186e00b0022e5dd3e32amr11749231wri.167.1665412074389; Mon, 10 Oct 2022 07:27:54 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id u6-20020adfed46000000b0022e04bfa661sm9037054wro.59.2022.10.10.07.27.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 07:27:53 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/28] target/arm: Fix ATS12NSO* from S PL1 Date: Mon, 10 Oct 2022 15:27:23 +0100 Message-Id: <20221010142730.502083-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221010142730.502083-1-peter.maydell@linaro.org> References: <20221010142730.502083-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Use arm_hcr_el2_eff_secstate instead of arm_hcr_el2_eff, so that we use is_secure instead of the current security state. These AT* operations have been broken since arm_hcr_el2_eff gained a check for "el2 enabled" for Secure EL2. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20221001162318.153420-18-richard.henderson@linaro.org Signed-off-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 b4fd4d3fac1..a589cec8e36 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -146,7 +146,7 @@ static bool regime_translation_disabled(CPUARMState *env, ARMMMUIdx mmu_idx, } } - hcr_el2 = arm_hcr_el2_eff(env); + hcr_el2 = arm_hcr_el2_eff_secstate(env, is_secure); switch (mmu_idx) { case ARMMMUIdx_Stage2: @@ -230,7 +230,7 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx, return ~0; } - hcr = arm_hcr_el2_eff(env); + hcr = 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: @@ -2341,7 +2341,7 @@ bool get_phys_addr_with_secure(CPUARMState *env, target_ulong address, } /* Combine the S1 and S2 cache attributes. */ - hcr = arm_hcr_el2_eff(env); + hcr = arm_hcr_el2_eff_secstate(env, is_secure); if (hcr & HCR_DC) { /* * HCR.DC forces the first stage attributes to @@ -2473,7 +2473,7 @@ bool get_phys_addr_with_secure(CPUARMState *env, target_ulong address, result->page_size = TARGET_PAGE_SIZE; /* Fill in cacheattr a-la AArch64.TranslateAddressS1Off. */ - hcr = arm_hcr_el2_eff(env); + hcr = arm_hcr_el2_eff_secstate(env, is_secure); result->cacheattrs.shareability = 0; result->cacheattrs.is_s2_format = false; if (hcr & HCR_DC) {