qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 14/23] target/arm: Use MMU_INDEX() helper


From: Richard Henderson
Subject: Re: [PATCH v2 14/23] target/arm: Use MMU_INDEX() helper
Date: Sun, 6 Aug 2023 07:31:57 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 8/6/23 05:17, Helge Deller wrote:
Use the new MMU_INDEX() helper to specify the index of the CPUTLB which
should be used.  Additionally, in a follow-up patch this helper allows
then to optimize the tcg code generation.

Signed-off-by: Helge Deller <deller@gmx.de>
---
  target/arm/cpu.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 88e5accda6..16e18fb22a 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -2930,7 +2930,7 @@ typedef enum ARMMMUIdxBit {

  #undef TO_CORE_BIT

-#define MMU_USER_IDX 0
+#define MMU_USER_IDX MMU_INDEX(0)

  /* Indexes used when registering address spaces with cpu_address_space_init */
  typedef enum ARMASIdx {
@@ -3166,7 +3166,7 @@ FIELD(TBFLAG_A64, NAA, 30, 1)
   */
  static inline int cpu_mmu_index(CPUARMState *env, bool ifetch)
  {
-    return EX_TBFLAG_ANY(env->hflags, MMUIDX);
+    return MMU_INDEX(EX_TBFLAG_ANY(env->hflags, MMUIDX));
  }

This cannot possibly work, since you've not changed any of the real mmu idx 
(ARMMMUIdx).


r~




reply via email to

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