From patchwork Sun Jul 3 08:23:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 586805 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2916364mab; Sun, 3 Jul 2022 01:39:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u7X7FOYwxwm5dxWjQY4ClhU210F4zEugZ6r3ScvEMC53qLCGSWBrvOoFiyG+DKqWV/q5FG X-Received: by 2002:a81:6e88:0:b0:31b:d12d:4ed4 with SMTP id j130-20020a816e88000000b0031bd12d4ed4mr27492120ywc.187.1656837555636; Sun, 03 Jul 2022 01:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656837555; cv=none; d=google.com; s=arc-20160816; b=ObERIZYGJjm+pyq8WXbkygqa6vRwhl+cI4bVQr+JkbEu7SpqEwM1VXiM4WkHxrK4qj xLobHXWb9lOSiOTNU5BZLF8AkkS3oC1FHvEY5eP6+CZkpsvGvtArTEaao0MoqkYTJAaC jMfqR9myYIBmOziWpzIPa/Obm+Of9IQkJeMeQaUJB0FzRMZBC/xK4LTkj41doW5x6MtD 8UiEG6gwlwdjS3qT/db3v/v5z5o1Fd3gmuHKnmEjP9/d3bTTcpfwen3UWnOWigEb9s3w r1hwnkDw41DMd5If3ITFQhG1LrwQmrsqOKkJz3m8MnexepcugeDhrvTRVxSgVXhlZpAD raQQ== 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=LaYP+2o95zy27QHmyX20UD82IAVILTEsp61gOqT10lM=; b=GgLcuFSvEkRC1aiS6M0EdCHWG3rNwZILXlMfBD869WIMkcIo6ATpUoYpPDpLS1Br+T h0QwFdpbCFMOR62mF7yhprX2JxHdO0G54Nyus3u1Topj3XSPnhsOuTwoznDE2VvkzSWE l2m72DgiIlLlI66PPvGsDCfJhUZfoT6CzutMO+r3N5smDYxOdXH9pkdIFinE4UqHvwHo 8mzghh0B1ttj80EkbtqhDWjA1Lq3s3fiyJaUy4YHTY78SYJzK4+rAEk/Flm3PjmZrwsS P4Fz08k/lCADxmZj+3sVsjYwiZqSEc7GKMk0iNarbQHSgWGMIwaDWMv+qY6ER3t1HpZu UsRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KChJYuAu; 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 i6-20020a81f206000000b00313aa14f3fdsi35230023ywm.284.2022.07.03.01.39.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Jul 2022 01:39:15 -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=KChJYuAu; 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]:35982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7v8N-00059t-4m for patch@linaro.org; Sun, 03 Jul 2022 04:39:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7uv1-0007f8-Nh for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:27 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:38790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7uv0-000699-1q for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:27 -0400 Received: by mail-pl1-x62e.google.com with SMTP id m14so6030066plg.5 for ; Sun, 03 Jul 2022 01:25:25 -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=LaYP+2o95zy27QHmyX20UD82IAVILTEsp61gOqT10lM=; b=KChJYuAuc0J/uOVFYtz/nSDmIC7VkWWBibHIFC5ktYc1ODj4fRn0SpWq2kqXrwYChA aKNZZLu4uZ4a4bht1JtalhhaBC7XWu+Dp9Qf+n9Yq4mHmhdtlLULNKUZgv1jbr6C3m8B nse3RfprDQUKa7ZCd7zUnNO31YaMpzMsM/X1Ya6+qfajmxiU2oZBDi48PtILIFAYKUxv Us8VW5lqlz1d3lzptSrF5rI0txDLAKicDA22UkHLrS/nuxDOhKG8pKEWH7HJYA1+Gx+M MeuKumCMYwS4OKxaG13JXv2kjYNnWHLlspxPxpBAiarCCrzVd3mLsG6kjSM1XnD7WtSK 0x0w== 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=LaYP+2o95zy27QHmyX20UD82IAVILTEsp61gOqT10lM=; b=x40AB/r6atD2fIj6jKQ9uOhvBDMPSzzOnHnUuGToiEaclnsLOVF8u91IjHlByGOoi4 5/jimG9vSR14pEXLZI7SHCQbpD9y7iaDkY9fvUl+1zXDzpOcZ/S3m/BsrMKwA4s2F9W3 1KrnyDw2BGC16MY1qR3aI558/QYP011fKaLP1ge+VOIkbGqdo1e03jbBSc5m/rhnsEEm TiXahZQUfQeKvQQODv9H9TsnQTuClwj3DPA6ihbsyzawmZ2YvLAaYiu7fok76PrDBsIJ uHmB8t/MP/y4rzAvHIUYATJyuU59B+VtGYT/yvjusROjd2R1Gic7d0qQYollwk0/kGFp OpOA== X-Gm-Message-State: AJIora96ABBQzEeSwE8YfyV2cAHdlxC8ew5nppflODPh+B90ATXAbBmv ItSSgWx/PXrunG0KhadsOI6BlYJAhLlGcwTD X-Received: by 2002:a17:903:120c:b0:167:8847:21f2 with SMTP id l12-20020a170903120c00b00167884721f2mr28391645plh.11.1656836724769; Sun, 03 Jul 2022 01:25:24 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id im22-20020a170902bb1600b0016a3f9e528asm13569112plb.57.2022.07.03.01.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 01:25:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 19/62] target/arm: Add is_secure parameter to pmsav8_mpu_lookup Date: Sun, 3 Jul 2022 13:53:36 +0530 Message-Id: <20220703082419.770989-20-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::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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=unavailable 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 pmsav8_mpu_lookup. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- 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 30bda00a09..f75ac2e1b7 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1143,8 +1143,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 45fbf19559..5ee4ee15b3 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 3b70c423a8..1a0e708d11 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1697,8 +1697,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 @@ -1711,7 +1711,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; @@ -2031,7 +2030,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;