[v2,25/28] target/s390x: Use cpu_*_mmuidx_ra instead of MMU_MODE*_SUFFIX

Message ID 20191216221158.29572-26-richard.henderson@linaro.org
State New
Headers show
Series
  • cputlb: Remove support for MMU_MODE*_SUFFIX
Related show

Commit Message

Richard Henderson Dec. 16, 2019, 10:11 p.m.
The generated functions aside from *_real are unused.
The *_real functions have a couple of users in mem_helper.c;
use *_mmuidx_ra instead, with MMU_REAL_IDX.

Reviewed-by: David Hildenbrand <david@redhat.com>

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
v2: Use *_mmuidx_ra directly, without intermediate macros.
---
 target/s390x/cpu.h        |  5 -----
 target/s390x/mem_helper.c | 21 ++++++++++++---------
 2 files changed, 12 insertions(+), 14 deletions(-)

-- 
2.20.1

Comments

Alex Bennée Dec. 20, 2019, 7:39 p.m. | #1
Richard Henderson <richard.henderson@linaro.org> writes:

> The generated functions aside from *_real are unused.

> The *_real functions have a couple of users in mem_helper.c;

> use *_mmuidx_ra instead, with MMU_REAL_IDX.

>

> Reviewed-by: David Hildenbrand <david@redhat.com>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


FYI there is a merge conflict with master as some of the helpers have
been replaced with inline code (by you ;-).

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


> ---

> v2: Use *_mmuidx_ra directly, without intermediate macros.

> ---

>  target/s390x/cpu.h        |  5 -----

>  target/s390x/mem_helper.c | 21 ++++++++++++---------

>  2 files changed, 12 insertions(+), 14 deletions(-)

>

> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h

> index aa829e954c..cfa8a81265 100644

> --- a/target/s390x/cpu.h

> +++ b/target/s390x/cpu.h

> @@ -36,11 +36,6 @@

>  

>  #define TARGET_INSN_START_EXTRA_WORDS 2

>  

> -#define MMU_MODE0_SUFFIX _primary

> -#define MMU_MODE1_SUFFIX _secondary

> -#define MMU_MODE2_SUFFIX _home

> -#define MMU_MODE3_SUFFIX _real

> -

>  #define MMU_USER_IDX 0

>  

>  #define S390_MAX_CPUS 248

> diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c

> index 57ce17c252..6f4a16b9b2 100644

> --- a/target/s390x/mem_helper.c

> +++ b/target/s390x/mem_helper.c

> @@ -2026,7 +2026,7 @@ uint32_t HELPER(testblock)(CPUS390XState *env, uint64_t real_addr)

>      real_addr = wrap_address(env, real_addr) & TARGET_PAGE_MASK;

>  

>      for (i = 0; i < TARGET_PAGE_SIZE; i += 8) {

> -        cpu_stq_real_ra(env, real_addr + i, 0, ra);

> +        cpu_stq_mmuidx_ra(env, real_addr + i, 0, MMU_REAL_IDX, ra);

>      }

>  

>      return 0;

> @@ -2260,11 +2260,11 @@ void HELPER(idte)(CPUS390XState *env, uint64_t r1, uint64_t r2, uint32_t m4)

>          for (i = 0; i < entries; i++) {

>              /* addresses are not wrapped in 24/31bit mode but table index is */

>              raddr = table + ((index + i) & 0x7ff) * sizeof(entry);

> -            entry = cpu_ldq_real_ra(env, raddr, ra);

> +            entry = cpu_ldq_mmuidx_ra(env, raddr, MMU_REAL_IDX, ra);

>              if (!(entry & REGION_ENTRY_I)) {

>                  /* we are allowed to not store if already invalid */

>                  entry |= REGION_ENTRY_I;

> -                cpu_stq_real_ra(env, raddr, entry, ra);

> +                cpu_stq_mmuidx_ra(env, raddr, entry, MMU_REAL_IDX, ra);

>              }

>          }

>      }

> @@ -2291,9 +2291,9 @@ void HELPER(ipte)(CPUS390XState *env, uint64_t pto, uint64_t vaddr,

>      pte_addr += VADDR_PAGE_TX(vaddr) * 8;

>  

>      /* Mark the page table entry as invalid */

> -    pte = cpu_ldq_real_ra(env, pte_addr, ra);

> +    pte = cpu_ldq_mmuidx_ra(env, pte_addr, MMU_REAL_IDX, ra);

>      pte |= PAGE_ENTRY_I;

> -    cpu_stq_real_ra(env, pte_addr, pte, ra);

> +    cpu_stq_mmuidx_ra(env, pte_addr, pte, MMU_REAL_IDX, ra);

>  

>      /* XXX we exploit the fact that Linux passes the exact virtual

>         address here - it's not obliged to! */

> @@ -2333,18 +2333,21 @@ void HELPER(purge)(CPUS390XState *env)

>  /* load using real address */

>  uint64_t HELPER(lura)(CPUS390XState *env, uint64_t addr)

>  {

> -    return cpu_ldl_real_ra(env, wrap_address(env, addr), GETPC());

> +    return cpu_ldl_mmuidx_ra(env, wrap_address(env, addr),

> +                             MMU_REAL_IDX, GETPC());

>  }

>  

>  uint64_t HELPER(lurag)(CPUS390XState *env, uint64_t addr)

>  {

> -    return cpu_ldq_real_ra(env, wrap_address(env, addr), GETPC());

> +    return cpu_ldq_mmuidx_ra(env, wrap_address(env, addr),

> +                             MMU_REAL_IDX, GETPC());

>  }

>  

>  /* store using real address */

>  void HELPER(stura)(CPUS390XState *env, uint64_t addr, uint64_t v1)

>  {

> -    cpu_stl_real_ra(env, wrap_address(env, addr), (uint32_t)v1, GETPC());

> +    cpu_stl_mmuidx_ra(env, wrap_address(env, addr), (uint32_t)v1,

> +                      MMU_REAL_IDX, GETPC());

>  

>      if ((env->psw.mask & PSW_MASK_PER) &&

>          (env->cregs[9] & PER_CR9_EVENT_STORE) &&

> @@ -2357,7 +2360,7 @@ void HELPER(stura)(CPUS390XState *env, uint64_t addr, uint64_t v1)

>  

>  void HELPER(sturg)(CPUS390XState *env, uint64_t addr, uint64_t v1)

>  {

> -    cpu_stq_real_ra(env, wrap_address(env, addr), v1, GETPC());

> +    cpu_stq_mmuidx_ra(env, wrap_address(env, addr), v1, MMU_REAL_IDX, GETPC());

>  

>      if ((env->psw.mask & PSW_MASK_PER) &&

>          (env->cregs[9] & PER_CR9_EVENT_STORE) &&



-- 
Alex Bennée

Patch

diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index aa829e954c..cfa8a81265 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -36,11 +36,6 @@ 
 
 #define TARGET_INSN_START_EXTRA_WORDS 2
 
-#define MMU_MODE0_SUFFIX _primary
-#define MMU_MODE1_SUFFIX _secondary
-#define MMU_MODE2_SUFFIX _home
-#define MMU_MODE3_SUFFIX _real
-
 #define MMU_USER_IDX 0
 
 #define S390_MAX_CPUS 248
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
index 57ce17c252..6f4a16b9b2 100644
--- a/target/s390x/mem_helper.c
+++ b/target/s390x/mem_helper.c
@@ -2026,7 +2026,7 @@  uint32_t HELPER(testblock)(CPUS390XState *env, uint64_t real_addr)
     real_addr = wrap_address(env, real_addr) & TARGET_PAGE_MASK;
 
     for (i = 0; i < TARGET_PAGE_SIZE; i += 8) {
-        cpu_stq_real_ra(env, real_addr + i, 0, ra);
+        cpu_stq_mmuidx_ra(env, real_addr + i, 0, MMU_REAL_IDX, ra);
     }
 
     return 0;
@@ -2260,11 +2260,11 @@  void HELPER(idte)(CPUS390XState *env, uint64_t r1, uint64_t r2, uint32_t m4)
         for (i = 0; i < entries; i++) {
             /* addresses are not wrapped in 24/31bit mode but table index is */
             raddr = table + ((index + i) & 0x7ff) * sizeof(entry);
-            entry = cpu_ldq_real_ra(env, raddr, ra);
+            entry = cpu_ldq_mmuidx_ra(env, raddr, MMU_REAL_IDX, ra);
             if (!(entry & REGION_ENTRY_I)) {
                 /* we are allowed to not store if already invalid */
                 entry |= REGION_ENTRY_I;
-                cpu_stq_real_ra(env, raddr, entry, ra);
+                cpu_stq_mmuidx_ra(env, raddr, entry, MMU_REAL_IDX, ra);
             }
         }
     }
@@ -2291,9 +2291,9 @@  void HELPER(ipte)(CPUS390XState *env, uint64_t pto, uint64_t vaddr,
     pte_addr += VADDR_PAGE_TX(vaddr) * 8;
 
     /* Mark the page table entry as invalid */
-    pte = cpu_ldq_real_ra(env, pte_addr, ra);
+    pte = cpu_ldq_mmuidx_ra(env, pte_addr, MMU_REAL_IDX, ra);
     pte |= PAGE_ENTRY_I;
-    cpu_stq_real_ra(env, pte_addr, pte, ra);
+    cpu_stq_mmuidx_ra(env, pte_addr, pte, MMU_REAL_IDX, ra);
 
     /* XXX we exploit the fact that Linux passes the exact virtual
        address here - it's not obliged to! */
@@ -2333,18 +2333,21 @@  void HELPER(purge)(CPUS390XState *env)
 /* load using real address */
 uint64_t HELPER(lura)(CPUS390XState *env, uint64_t addr)
 {
-    return cpu_ldl_real_ra(env, wrap_address(env, addr), GETPC());
+    return cpu_ldl_mmuidx_ra(env, wrap_address(env, addr),
+                             MMU_REAL_IDX, GETPC());
 }
 
 uint64_t HELPER(lurag)(CPUS390XState *env, uint64_t addr)
 {
-    return cpu_ldq_real_ra(env, wrap_address(env, addr), GETPC());
+    return cpu_ldq_mmuidx_ra(env, wrap_address(env, addr),
+                             MMU_REAL_IDX, GETPC());
 }
 
 /* store using real address */
 void HELPER(stura)(CPUS390XState *env, uint64_t addr, uint64_t v1)
 {
-    cpu_stl_real_ra(env, wrap_address(env, addr), (uint32_t)v1, GETPC());
+    cpu_stl_mmuidx_ra(env, wrap_address(env, addr), (uint32_t)v1,
+                      MMU_REAL_IDX, GETPC());
 
     if ((env->psw.mask & PSW_MASK_PER) &&
         (env->cregs[9] & PER_CR9_EVENT_STORE) &&
@@ -2357,7 +2360,7 @@  void HELPER(stura)(CPUS390XState *env, uint64_t addr, uint64_t v1)
 
 void HELPER(sturg)(CPUS390XState *env, uint64_t addr, uint64_t v1)
 {
-    cpu_stq_real_ra(env, wrap_address(env, addr), v1, GETPC());
+    cpu_stq_mmuidx_ra(env, wrap_address(env, addr), v1, MMU_REAL_IDX, GETPC());
 
     if ((env->psw.mask & PSW_MASK_PER) &&
         (env->cregs[9] & PER_CR9_EVENT_STORE) &&