All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 17/39] target/arm: Add is_secure parameter to pmsav7_use_background_region
Date: Thu, 22 Sep 2022 17:35:14 +0100	[thread overview]
Message-ID: <20220922163536.1096175-18-peter.maydell@linaro.org> (raw)
In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org>

From: Richard Henderson <richard.henderson@linaro.org>

Remove the use of regime_is_secure from pmsav7_use_background_region,
using the new parameter instead.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220822152741.1617527-17-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 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 6a73f16e092..9e1f60d10b4 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -1489,7 +1489,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
@@ -1502,8 +1502,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;
     }
@@ -1516,6 +1515,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;
@@ -1618,7 +1618,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;
@@ -1739,7 +1739,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;
         }
 
-- 
2.25.1



  parent reply	other threads:[~2022-09-22 16:59 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 16:34 [PULL 00/39] target-arm queue Peter Maydell
2022-09-22 16:34 ` [PULL 01/39] hw/net/can: fix Xilinx ZynqMP CAN RX FIFO logic Peter Maydell
2022-09-22 16:34 ` [PULL 02/39] target/arm: Fix alignment for VLD4.32 Peter Maydell
2022-09-22 16:35 ` [PULL 03/39] target/arm: Create GetPhysAddrResult Peter Maydell
2022-09-22 16:35 ` [PULL 04/39] target/arm: Use GetPhysAddrResult in get_phys_addr_lpae Peter Maydell
2022-09-22 16:35 ` [PULL 05/39] target/arm: Use GetPhysAddrResult in get_phys_addr_v6 Peter Maydell
2022-09-22 16:35 ` [PULL 06/39] target/arm: Use GetPhysAddrResult in get_phys_addr_v5 Peter Maydell
2022-09-22 16:35 ` [PULL 07/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav5 Peter Maydell
2022-09-22 16:35 ` [PULL 08/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav7 Peter Maydell
2022-09-22 16:35 ` [PULL 09/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav8 Peter Maydell
2022-09-22 16:35 ` [PULL 10/39] target/arm: Use GetPhysAddrResult in pmsav8_mpu_lookup Peter Maydell
2022-09-22 16:35 ` [PULL 11/39] target/arm: Remove is_subpage argument to pmsav8_mpu_lookup Peter Maydell
2022-09-22 16:35 ` [PULL 12/39] target/arm: Add is_secure parameter to v8m_security_lookup Peter Maydell
2022-09-22 16:35 ` [PULL 13/39] target/arm: Add secure parameter to pmsav8_mpu_lookup Peter Maydell
2022-09-22 16:35 ` [PULL 14/39] target/arm: Add is_secure parameter to get_phys_addr_v5 Peter Maydell
2022-09-22 16:35 ` [PULL 15/39] target/arm: Add is_secure parameter to get_phys_addr_v6 Peter Maydell
2022-09-22 16:35 ` [PULL 16/39] target/arm: Add secure parameter to get_phys_addr_pmsav8 Peter Maydell
2022-09-22 16:35 ` Peter Maydell [this message]
2022-09-22 16:35 ` [PULL 18/39] target/arm: Add secure parameter to get_phys_addr_pmsav7 Peter Maydell
2022-09-22 16:35 ` [PULL 19/39] target/arm: Add is_secure parameter to get_phys_addr_pmsav5 Peter Maydell
2022-09-22 16:35 ` [PULL 20/39] hw/acpi: Add ospm_status hook implementation for acpi-ged Peter Maydell
2022-09-22 16:35 ` [PULL 21/39] hw/net/lan9118: Signal TSFL_INT flag when TX FIFO reaches specified level Peter Maydell
2022-09-22 16:35 ` [PULL 22/39] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions Peter Maydell
2022-09-22 16:35 ` [PULL 23/39] chardev/baum: Use definitions to avoid dynamic stack allocation Peter Maydell
2022-09-22 16:35 ` [PULL 24/39] chardev/baum: Avoid " Peter Maydell
2022-09-22 16:35 ` [PULL 25/39] io/channel-websock: Replace strlen(const_str) by sizeof(const_str) - 1 Peter Maydell
2022-09-22 16:35 ` [PULL 26/39] hw/net/e1000e_core: Use definition to avoid dynamic stack allocation Peter Maydell
2022-09-22 16:35 ` [PULL 27/39] hw/ppc/pnv: Avoid " Peter Maydell
2022-09-22 16:35 ` [PULL 28/39] hw/intc/xics: " Peter Maydell
2022-09-22 16:35 ` [PULL 29/39] hw/i386/multiboot: " Peter Maydell
2022-09-22 16:35 ` [PULL 30/39] hw/usb/hcd-ohci: Use definition to avoid " Peter Maydell
2022-09-22 16:35 ` [PULL 31/39] ui/curses: Avoid " Peter Maydell
2022-09-22 16:35 ` [PULL 32/39] tests/unit/test-vmstate: " Peter Maydell
2022-09-22 16:35 ` [PULL 33/39] configure: Remove unused python_version variable Peter Maydell
2022-09-22 16:35 ` [PULL 34/39] configure: Remove unused meson_args variable Peter Maydell
2022-09-22 16:35 ` [PULL 35/39] configure: Add missing quoting for some easy cases Peter Maydell
2022-09-22 16:35 ` [PULL 36/39] configure: Add './' on front of glob of */config-devices.mak.d Peter Maydell
2022-09-22 16:35 ` [PULL 37/39] configure: Remove use of backtick `...` syntax Peter Maydell
2022-09-22 16:35 ` [PULL 38/39] configure: Check mkdir result directly, not via $? Peter Maydell
2022-09-22 16:35 ` [PULL 39/39] configure: Avoid use of 'local' as it is non-POSIX Peter Maydell
2022-09-26 19:22 ` [PULL 00/39] target-arm queue Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220922163536.1096175-18-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.