From patchwork Sun Jul 3 08:23:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 586827 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2923623mab; Sun, 3 Jul 2022 01:55:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1se3MvdLWzNqq+LZdTIseoY9HFUpRjWB+8bqOdPvcOVXXq7yt0NPNgjOc1n495Iy0P0fRBN X-Received: by 2002:a81:4bc7:0:b0:318:3409:27db with SMTP id y190-20020a814bc7000000b00318340927dbmr27925704ywa.414.1656838550934; Sun, 03 Jul 2022 01:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656838550; cv=none; d=google.com; s=arc-20160816; b=CRXvYxJwDUhVjO93sY7Al6AX0DqA35C8r3OqJBxH/h0mYtZ1W0vaYQUvGKRX4qjcmy x3ka8bd0WGkHgPC5WqSuC4X5iANNAc5RyGNwfsI1TxcwfMWIXf8tnUPT3cMGcnDWBE+F +e753wZX11tYHuNyC6OxYojRaKscm4vqh5p85kNNGeQPvUA75KnsVoNn+Zhmo65r4yuD T5dVv/xBUnDhyQaTU75p0vWJTETfcEKhcnX/JL+NXjRw7A6VZTo3AEc5s49LnYum9uUF sXJYK9Kbq/WnOifuZv1T4vRZOyV9KIVnk0It3IqomNjP5auG+5q+claEyPYjQj+3fU6G gFWA== 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:cc:to :from:dkim-signature; bh=nKGjUZfBkhVbWA12ORMzUOT3YB96l6xmhnKiB3/6fQo=; b=gjJIfAEEEoZfrEZQMcxaRtDp0awJ3lOWH2P7fORwKonE09OLSDtVo3NjRLO3QwoE9R T4hKu5AleElf+5zaQifUI+QqJylRgF/zRyXYE8zUz+qRjBzjZWKP9fnDPlXA3QQ1NXOK B3tgeRLccedPtWNok1bvW/eunlHc2mG3dtXxJSrTysLPJjM+GNmfX8L1vdvhYXsN9TLz JYwjVXP8nbNma5F4nMGdhi6cLlAMHW00fxSpCIJlGm/yPdUwZ0jNq1kGrDDxb2WKqB4i /yK3V7f8ig3JMMyyNux/O4uYNa/vnDU1xLs2BSouSNsDJkjkd5BvprhfychqXQgE8QkY 3SBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=agMKJwUK; 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 17-20020a810111000000b0030fb172aa27si36139070ywb.37.2022.07.03.01.55.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Jul 2022 01:55:50 -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=agMKJwUK; 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]:53470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7vOQ-0002q3-D9 for patch@linaro.org; Sun, 03 Jul 2022 04:55:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7uvU-0000Es-VK for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:56 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:47057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7uvT-0006DS-DN for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:56 -0400 Received: by mail-pf1-x42b.google.com with SMTP id a15so6322421pfv.13 for ; Sun, 03 Jul 2022 01:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nKGjUZfBkhVbWA12ORMzUOT3YB96l6xmhnKiB3/6fQo=; b=agMKJwUKdHCinJ3LQndFn5l7HYb5kNt5zEtXit1Bs8CM6lSvIuDBcoGL0faYcNnLb5 Sf58nAskBLQTKf8hLR6YUTczfFgiBvV0HfU9N2BEAVEnEG+kygvaOHEPaxMAqMVurRtB zL+zHLGZcZuWHwaRd/L1K1pXtvcH8gNDqsbbNlojzJuv7JXsw84n/bk0KXYraLCGU+px jprBkcniHGacEDQcGUtVXubpTEBitJ7UBC9B+jh60wQQfx7PpBJbzUOZXy6isIoizwgE GaAhqoodT47e5EX+c0rFPsv2R9rcVmvthZcDhZbfEVdYexL+bhL3wsDYKbVZMRbNCs4d bCtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nKGjUZfBkhVbWA12ORMzUOT3YB96l6xmhnKiB3/6fQo=; b=caJoduq9hE+BiivdeKIpOJ1w0d29yn8aDsFB/Kl353iS4mUFXfrrA1dX7LOez+4OT7 XDTuuOO8dyLwhqOCXrH6cTwPfp7zRUZ8/BFiGEz74wAjv1FO0tCc/k5o1yGsC/YiJ7v7 Pfe31xDyytFjCbZk+ytc0ptL0/t670h+iJ8l2Rf/l+rd5KFwIQsomwvVSd1a6Jr+Ikx/ q2r3Hp0JzZ5fBmJE1vUvxGuSuSNBgCZhLzy+3OrUaQBCB3vsSoZ9JVKLCnv3mZX1++M/ xgRH2hAVGPEgwaBLxeQpC3qO4ksaOj2qdyfvkxHvVHqRjgrPu5W2vO1DxIWDfeXiE3WT YAhg== X-Gm-Message-State: AJIora+JD+MBEkxnC/QYDpoh1uSmBVwegAXzDF7Ba8NSHF9dj4pltS35 aiZF6sy+LTddQUBIKRcnvWm6NMx0OQF+KfoG X-Received: by 2002:a63:e648:0:b0:412:22fa:6fbb with SMTP id p8-20020a63e648000000b0041222fa6fbbmr3330126pgj.24.1656836754099; Sun, 03 Jul 2022 01:25:54 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id im22-20020a170902bb1600b0016a3f9e528asm13569112plb.57.2022.07.03.01.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 01:25:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 29/62] target/arm: Add is_secure parameter to v7m_read_half_insn Date: Sun, 3 Jul 2022 13:53:46 +0530 Message-Id: <20220703082419.770989-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220703082419.770989-1-richard.henderson@linaro.org> References: <20220703082419.770989-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Remove the use of regime_is_secure from v7m_read_half_insn. As it happens, both callers pass true, but that is a detail of v7m_handle_execute_nsc we need not expose to the callee. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- target/arm/m_helper.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 5ee4ee15b3..203ba411f6 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -1981,7 +1981,7 @@ static bool do_v7m_function_return(ARMCPU *cpu) return true; } -static bool v7m_read_half_insn(ARMCPU *cpu, ARMMMUIdx mmu_idx, +static bool v7m_read_half_insn(ARMCPU *cpu, ARMMMUIdx mmu_idx, bool secure, uint32_t addr, uint16_t *insn) { /* @@ -2003,8 +2003,7 @@ static bool v7m_read_half_insn(ARMCPU *cpu, ARMMMUIdx mmu_idx, ARMMMUFaultInfo fi = {}; MemTxResult txres; - v8m_security_lookup(env, addr, MMU_INST_FETCH, mmu_idx, - regime_is_secure(env, mmu_idx), &sattrs); + v8m_security_lookup(env, addr, MMU_INST_FETCH, mmu_idx, secure, &sattrs); if (!sattrs.nsc || sattrs.ns) { /* * This must be the second half of the insn, and it straddles a @@ -2109,7 +2108,7 @@ static bool v7m_handle_execute_nsc(ARMCPU *cpu) /* We want to do the MPU lookup as secure; work out what mmu_idx that is */ mmu_idx = arm_v7m_mmu_idx_for_secstate(env, true); - if (!v7m_read_half_insn(cpu, mmu_idx, env->regs[15], &insn)) { + if (!v7m_read_half_insn(cpu, mmu_idx, true, env->regs[15], &insn)) { return false; } @@ -2125,7 +2124,7 @@ static bool v7m_handle_execute_nsc(ARMCPU *cpu) goto gen_invep; } - if (!v7m_read_half_insn(cpu, mmu_idx, env->regs[15] + 2, &insn)) { + if (!v7m_read_half_insn(cpu, mmu_idx, true, env->regs[15] + 2, &insn)) { return false; }