diff mbox series

[1/9] target/arm: Restrict v7-M MMU helpers to sysemu TCG

Message ID 20230206121714.85084-2-philmd@linaro.org
State New
Headers show
Series target/arm: Housekeeping around NVIC | expand

Commit Message

Philippe Mathieu-Daudé Feb. 6, 2023, 12:17 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/arm/helper.c   | 2 +-
 target/arm/m_helper.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Richard Henderson Feb. 6, 2023, 6:48 p.m. UTC | #1
On 2/6/23 02:17, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/arm/helper.c   | 2 +-
>   target/arm/m_helper.c | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)

This seems like it would break linux-user with -cpu cortex-m3, which is used for gcc 
testing, iirc.

(Real m-profile can't run linux, but using the same thumb abi makes testing easier than 
using semihosting and initializing a board model.)

OTOH, we should be able to hard-code the mmuidx for user-only:

     mprofile ? ARMMMUIdx_MUser : ARMMMUIdx_E10_0


r~
diff mbox series

Patch

diff --git a/target/arm/helper.c b/target/arm/helper.c
index c62ed05c12..5dbeade787 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -11774,7 +11774,7 @@  int arm_mmu_idx_to_el(ARMMMUIdx mmu_idx)
     }
 }
 
-#ifndef CONFIG_TCG
+#if !defined(CONFIG_TCG) || defined(CONFIG_USER_ONLY)
 ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *env, bool secstate)
 {
     g_assert_not_reached();
diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c
index e7e746ea18..1e7e4e33bd 100644
--- a/target/arm/m_helper.c
+++ b/target/arm/m_helper.c
@@ -2854,8 +2854,6 @@  uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t addr, uint32_t op)
     return tt_resp;
 }
 
-#endif /* !CONFIG_USER_ONLY */
-
 ARMMMUIdx arm_v7m_mmu_idx_all(CPUARMState *env,
                               bool secstate, bool priv, bool negpri)
 {
@@ -2892,3 +2890,5 @@  ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *env, bool secstate)
 
     return arm_v7m_mmu_idx_for_secstate_and_priv(env, secstate, priv);
 }
+
+#endif /* !CONFIG_USER_ONLY */