qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 3/4] target/arm: Compute TB_FLAGS for TBI for


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 3/4] target/arm: Compute TB_FLAGS for TBI for user-only
Date: Mon, 4 Feb 2019 14:45:43 +0000

On Mon, 4 Feb 2019 at 13:21, Richard Henderson
<address@hidden> wrote:
>
> Enables, but does not turn on, TBI for CONFIG_USER_ONLY.
>
> Reviewed-by: Peter Maydell <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
> ---

This patch turns out to break compilation of the linux-user
targets with clang, which is stricter than gcc about warning about
unused static functions.

I propose to squash in the following fixup patch:

diff --git a/target/arm/helper.c b/target/arm/helper.c
index c99b69074a5..935c6f9bfa7 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -9601,6 +9601,8 @@ static inline uint32_t regime_el(CPUARMState
*env, ARMMMUIdx mmu_idx)
     }
 }

+#ifndef CONFIG_USER_ONLY
+
 /* Return the SCTLR value which controls this address translation regime */
 static inline uint32_t regime_sctlr(CPUARMState *env, ARMMMUIdx mmu_idx)
 {
@@ -9656,6 +9658,22 @@ static inline bool
regime_translation_big_endian(CPUARMState *env,
     return (regime_sctlr(env, mmu_idx) & SCTLR_EE) != 0;
 }

+/* Return the TTBR associated with this translation regime */
+static inline uint64_t regime_ttbr(CPUARMState *env, ARMMMUIdx mmu_idx,
+                                   int ttbrn)
+{
+    if (mmu_idx == ARMMMUIdx_S2NS) {
+        return env->cp15.vttbr_el2;
+    }
+    if (ttbrn == 0) {
+        return env->cp15.ttbr0_el[regime_el(env, mmu_idx)];
+    } else {
+        return env->cp15.ttbr1_el[regime_el(env, mmu_idx)];
+    }
+}
+
+#endif /* !CONFIG_USER_ONLY */
+
 /* Return the TCR controlling this translation regime */
 static inline TCR *regime_tcr(CPUARMState *env, ARMMMUIdx mmu_idx)
 {
@@ -9676,20 +9694,6 @@ static inline ARMMMUIdx
stage_1_mmu_idx(ARMMMUIdx mmu_idx)
     return mmu_idx;
 }

-/* Return the TTBR associated with this translation regime */
-static inline uint64_t regime_ttbr(CPUARMState *env, ARMMMUIdx mmu_idx,
-                                   int ttbrn)
-{
-    if (mmu_idx == ARMMMUIdx_S2NS) {
-        return env->cp15.vttbr_el2;
-    }
-    if (ttbrn == 0) {
-        return env->cp15.ttbr0_el[regime_el(env, mmu_idx)];
-    } else {
-        return env->cp15.ttbr1_el[regime_el(env, mmu_idx)];
-    }
-}
-
 /* Return true if the translation regime is using LPAE format page tables */
 static inline bool regime_using_lpae_format(CPUARMState *env,
                                             ARMMMUIdx mmu_idx)
@@ -9715,6 +9719,7 @@ bool arm_s1_regime_using_lpae_format(CPUARMState
*env, ARMMMUIdx mmu_idx)
     return regime_using_lpae_format(env, mmu_idx);
 }

+#ifndef CONFIG_USER_ONLY
 static inline bool regime_is_user(CPUARMState *env, ARMMMUIdx mmu_idx)
 {
     switch (mmu_idx) {
@@ -9733,7 +9738,6 @@ static inline bool regime_is_user(CPUARMState
*env, ARMMMUIdx mmu_idx)
     }
 }

-#ifndef CONFIG_USER_ONLY
 /* Translate section/page access permissions to page
  * R/W protection flags
  *

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]