From patchwork Sun Jul 3 08:23:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 586806 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2916401mab; Sun, 3 Jul 2022 01:39:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1se6fMPzx9y1Lu4/6z5k60g+ABBPRkB8K2cmT+4HROyspda6CkIqv7utoasEQXT3K9sP/vO X-Received: by 2002:a0d:cb13:0:b0:318:39b9:89fc with SMTP id n19-20020a0dcb13000000b0031839b989fcmr28016358ywd.413.1656837560336; Sun, 03 Jul 2022 01:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656837560; cv=none; d=google.com; s=arc-20160816; b=ellrkxuqM3lTKSXM5KrHrmXqByUMyUZlawqz8E7/Mx/i3kZCY34GruIrMQiIGwRg6W wVuEJnMPO4f3FujduHEAHDUAiME7nDRN0zBivjmPt1CugMV+5n7fWQZzBJgyUmScrZsZ b6H3kY/SzOpJdMF7ljnbMeTT+NXqjMlOOEeimskIYn9o2YpOSLEOK03JubZeikMBubZF sPl28K+wI9fGzpBmwp9GSk5AkQ+5P/M1KRQdAWVmGHEL/9qGdTbyAhI4Jr/FPKxctJ+U PAig0Dzd4wbPyv21BEZpWRe8IcQMiEF+B+vFqGaBKxPyrANd90pIh164MF+SiDkappq8 eJGg== 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=5cg/L7Tmrf48Jc3I5pInXguHqlazi2G1pFqTrme/O8Y=; b=p8O14CvrLKw2MpRBuWWJOgtcitonLDavV1R415Wr/kl57KCl/EFxNEJsmP1C77Pe1z UpwYY/tD6GjBQCSmAltrhv1AIe8Tnjs9KVX2KxzjP8tLpGwVK6twLSxdOMuFaa00IjYh JCseMDS8ul8Rg4yavQhXw00gZAUkqhXiS/8GBZjvkl87Igg5yizvPXXR78l5UT4f8GvJ MBHblqvRCzMQiQsgaCBulVS/kPPKAheaZHIhL+ucxAM6ACvZFi03SQduD8STOZEaFyur DlYJ6oQv+UEOemwMA+fBsn0LImN09T5A7G/Tdzgtn2m55PHhMseXsA+OnRmk7mG6GBzF 6QVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R4FWNolk; 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 187-20020a2518c4000000b0066e2ce49ea9si3897753yby.251.2022.07.03.01.39.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Jul 2022 01:39:20 -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=R4FWNolk; 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]:36370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7v8R-0005QT-Qm for patch@linaro.org; Sun, 03 Jul 2022 04:39:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7uvD-00084O-Qg for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:41 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:45905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7uvC-0006As-8l for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:39 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 145so6225248pga.12 for ; Sun, 03 Jul 2022 01:25:37 -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=5cg/L7Tmrf48Jc3I5pInXguHqlazi2G1pFqTrme/O8Y=; b=R4FWNolkFHLurp/p1MbyFMuSYbN/xvZHkEjc57l+62NxjB8Z43ZfWJDYxNWeRqAOY8 nZvs23xS5TNnrvOrjLlWHkunGnEBLInJ2NUjt/bTzMx9Sw/RzYg8OmxERVEp4ATbLmLR Ih13P6gXfViD485ac8WGjnygxwJa4LGALXAByPUByAeRdp7PxvvP/s1FV2/hCrwFao9g kLYJtgNB7EcML2QAXYoBkQO36pgXSj659/QAOhV7FBZ3dW59rch3gcts/Cp7VpKJ+oPC nBcKyQ8tPY6HPxK4zeIOEnzGbZpopu43g3x4Gk3OXa6MlQMlsDky8q0c7NwpEMg9q8LJ uzVw== 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=5cg/L7Tmrf48Jc3I5pInXguHqlazi2G1pFqTrme/O8Y=; b=b6Tn2sL+/g5wpQx0w1YZyZc7XHtma9kFhzTbdqnySnisQvDQ6frjVRxZC334q5zfaH tePChNVsIBgGQCjnMrLZGp/Pt7CQyiJ083nIBE4jXc7JEGlsclAGVYg2NnJJvmW9vpU+ 0tDh95MZ3144HIUQxGZD39HQlRa7BPvVu6SnLJYEUkbxMFiiKCAbwk8rYLjZvqJIWuEY l72Lw7xjqUCKecD//k7bBpdMOmpLqCtQowyFugniDJVI5AnbofK6rDkXvpCMzXVS5YWw A+dUcRLo55HmqGCKaW5+KmLkldF78nZyUqN6L+WvEkZ6H7ue0spF2zijEMT7YpUGpw8W fJpQ== X-Gm-Message-State: AJIora8g0r40JnJZxx+SDihNzulQzlz3iGB8I7ia4uakY11nFQOeLsM3 Q4Kd8nYX0i7HK8ZZ/BKQQK4RhzY7X2p8rUF+ X-Received: by 2002:a05:6a00:4295:b0:528:49a0:131 with SMTP id bx21-20020a056a00429500b0052849a00131mr6658273pfb.70.1656836736353; Sun, 03 Jul 2022 01:25:36 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id im22-20020a170902bb1600b0016a3f9e528asm13569112plb.57.2022.07.03.01.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 01:25:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 23/62] target/arm: Add is_secure parameter to pmsav7_use_background_region Date: Sun, 3 Jul 2022 13:53:40 +0530 Message-Id: <20220703082419.770989-24-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::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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 pmsav7_use_background_region. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- target/arm/ptw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index f7892a0c48..23cfccce6c 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1485,7 +1485,7 @@ static bool m_is_system_region(CPUARMState *env, uint32_t address) } static bool pmsav7_use_background_region(ARMCPU *cpu, ARMMMUIdx mmu_idx, - bool is_user) + bool is_secure, bool is_user) { /* * Return true if we should use the default memory map as a @@ -1498,8 +1498,7 @@ static bool pmsav7_use_background_region(ARMCPU *cpu, ARMMMUIdx mmu_idx, } if (arm_feature(env, ARM_FEATURE_M)) { - return env->v7m.mpu_ctrl[regime_is_secure(env, mmu_idx)] - & R_V7M_MPU_CTRL_PRIVDEFENA_MASK; + return env->v7m.mpu_ctrl[is_secure] & R_V7M_MPU_CTRL_PRIVDEFENA_MASK; } else { return regime_sctlr(env, mmu_idx) & SCTLR_BR; } @@ -1512,6 +1511,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address, { ARMCPU *cpu = env_archcpu(env); int n; + bool secure = regime_is_secure(env, mmu_idx); bool is_user = regime_is_user(env, mmu_idx); result->phys = address; @@ -1614,7 +1614,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address, } if (n == -1) { /* no hits */ - if (!pmsav7_use_background_region(cpu, mmu_idx, is_user)) { + if (!pmsav7_use_background_region(cpu, mmu_idx, secure, is_user)) { /* background fault */ fi->type = ARMFault_Background; return true; @@ -1734,7 +1734,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address, } else if (m_is_ppb_region(env, address)) { hit = true; } else { - if (pmsav7_use_background_region(cpu, mmu_idx, is_user)) { + if (pmsav7_use_background_region(cpu, mmu_idx, secure, is_user)) { hit = true; }