From patchwork Thu Sep 22 16:35:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 608235 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp475820pvb; Thu, 22 Sep 2022 10:31:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70Nji7CcAKRVg0AkB6sZUf3MQyu/zPLeWWuf2IGpLeYkAo2Nab6uPms9pYrutubw+vKeqZ X-Received: by 2002:a05:622a:134d:b0:35c:e289:f62e with SMTP id w13-20020a05622a134d00b0035ce289f62emr3849396qtk.596.1663867892624; Thu, 22 Sep 2022 10:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663867892; cv=none; d=google.com; s=arc-20160816; b=DMFnBE71LtI3gMu6ZFZXGMcvHSiFGNrvHdMSC8F0bFHI7rInQMsaJWKCVuO06qCb5e YR0z89exELBp4sTNZNuskI805rgwXsJhdZcmfcnE68oqt6ib7V0c7r2ZCZJRz51ybwsc h2+2S8dFtj4pwN0SM+t8h4n8U+zXaj1S4GrPowyB5o08Su+WZrd8keVmZ0PZe0psxyvx MBjljIyuu3r7o3d0zG0Ef3pUEdGqP2nY1G+hv8pkwpQ5y3jkbhoDVEoxD7BRHSEAgEXP YXyK3UFjSGg7MhZjsOivVVt9yNlTGwB41BwgGrWoflCdlxyYmNplAKzICskxGNzio/oI /8pg== 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=S7xMDGIoF+c3kK5sdvwsAuiDPlnfpu+Z56njaQYlxFw=; b=Slb/QNldtFjzaTb8BQcpXnnYiQSDRBbXl1Umtkt1L1iRqDJI1C+uDJn7xHhhh4ElD7 EnEHyDj1ikFS2AnWdDjH6S0zG2TluTHJgpdAjd+/wUG4F1HoxeJcjaW7ZjjBI6lNCUdN kK2JGJoicWKIhxNdU4Hrc9GSTsXnaEobZY2vgxbsVmWoI6xT5XVkVVYlXBeaBPZbHDdq 0HOE1ta0N4+6rvCPqR2OSupopsxcMvGLIugN1z4C28dL+lJlZl313uESxKFLAUeO4fmA QeIQQiiw8SXEZkuVwhDehTGXheXKNBJfMRJrjy3/eoVeGcsLdgUBHvQoJijlmPPpRDw9 90UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Qw7S/BuJ"; 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 n10-20020ac81e0a000000b0035d160d7405si970003qtl.110.2022.09.22.10.31.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Sep 2022 10:31:32 -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="Qw7S/BuJ"; 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]:48542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQ2u-0005u1-5s for patch@linaro.org; Thu, 22 Sep 2022 13:31:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPB0-0002Ay-JV for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:59 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:37751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAy-0005Ps-U6 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:50 -0400 Received: by mail-wr1-x431.google.com with SMTP id bq9so16458338wrb.4 for ; Thu, 22 Sep 2022 09:35:48 -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; bh=S7xMDGIoF+c3kK5sdvwsAuiDPlnfpu+Z56njaQYlxFw=; b=Qw7S/BuJ0JGisSaJjPXDNh3J63eWA3pZiSUVRcGDCGReZpKK/YHIceoMHj50KCWHfL ZfZnHtnpn6qZESePGmmjh2FvgduZ53YdnmmhrYg3XXdhgCI8iuR3pIUXBLU496qZev6n 8t/umVAoDSWZLZEOIUvn6/1gd2mTiWllMUsBOkpSO070pWiMOI8IHIeuUj72neY95W9x yyLbFewUciaLiKuFDNJiLrM+ux97W3Ws1P1jA3X4ryxB1Z1MqkpWvpUKSvCuKF7fgWBv 134+z1Ve3HPZvX36fJWnboTKUXSu3LHxDU5Qc5TZV+RyIOKUnX2Ys/eHF/7dh0YT4leS dK7A== 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; bh=S7xMDGIoF+c3kK5sdvwsAuiDPlnfpu+Z56njaQYlxFw=; b=B8UL4uCHjcLuVvwpk3GXOVO91Rcm1zhjnU7OHkw7qlYSlG5oUN7mic4XqWQceLaxDB BtPiWtKnFezDGquPc14X3QrRvS23VoWPQ09U3q7+xgGnPmHHJIBHRTfXiXteIQVZ0OJl dCADNbDwjwMOVbHc32tOC9tZVsx5U6ROFhEF7B6etmP7UBBli1T7M5rXj0CuYUg8sZ5s kuVKEN9Qr2u7csTEsFkwGMSKHdwqw+Q3+0S0nu/hns5JklAsvi065tSmWfQ0QJ5Ug5TL IyEANejy2H9JvAQ10ROZ0ygyTYIpjjvdioJ7VS9jspWH0QrRKIGXhz9rydgtapvVrWwD Yezw== X-Gm-Message-State: ACrzQf0c2z4/qPkheHW0HBneowlpU7yk3tcmAfZBFi7/oDxh4J9+hfzx c5P7zvcGwZhXSBrJ6gsg1cgBOlYDcGpCdA== X-Received: by 2002:a5d:4a48:0:b0:22a:e55d:535d with SMTP id v8-20020a5d4a48000000b0022ae55d535dmr2633093wrs.308.1663864547527; Thu, 22 Sep 2022 09:35:47 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:47 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/39] target/arm: Add secure parameter to pmsav8_mpu_lookup Date: Thu, 22 Sep 2022 17:35:10 +0100 Message-Id: <20220922163536.1096175-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-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 Remove the use of regime_is_secure from pmsav8_mpu_lookup, passing the new parameter to the lookup instead. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-13-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/internals.h | 4 ++-- target/arm/m_helper.c | 2 +- target/arm/ptw.c | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index e97f5c3d47e..307a5965053 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1152,8 +1152,8 @@ bool get_phys_addr(CPUARMState *env, target_ulong address, bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, ARMMMUFaultInfo *fi, - uint32_t *mregion); + bool is_secure, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi, uint32_t *mregion); void arm_log_exception(CPUState *cs); diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 45fbf195590..5ee4ee15b36 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -2810,7 +2810,7 @@ uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t addr, uint32_t op) ARMMMUFaultInfo fi = {}; /* We can ignore the return value as prot is always set */ - pmsav8_mpu_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, + pmsav8_mpu_lookup(env, addr, MMU_DATA_LOAD, mmu_idx, targetsec, &res, &fi, &mregion); if (mregion == -1) { mrvalid = false; diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 74d2f63359f..308a9cc3ac9 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1701,8 +1701,8 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address, bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, ARMMMUFaultInfo *fi, - uint32_t *mregion) + bool secure, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi, uint32_t *mregion) { /* * Perform a PMSAv8 MPU lookup (without also doing the SAU check @@ -1716,7 +1716,6 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, */ ARMCPU *cpu = env_archcpu(env); bool is_user = regime_is_user(env, mmu_idx); - uint32_t secure = regime_is_secure(env, mmu_idx); int n; int matchregion = -1; bool hit = false; @@ -2035,7 +2034,7 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, uint32_t address, } } - ret = pmsav8_mpu_lookup(env, address, access_type, mmu_idx, + ret = pmsav8_mpu_lookup(env, address, access_type, mmu_idx, secure, result, fi, NULL); if (sattrs.subpage) { result->page_size = 1;