diff mbox series

[v2,01/28] target/xtensa: Use probe_access for itlb_hit_test

Message ID 20191216221158.29572-2-richard.henderson@linaro.org
State Superseded
Headers show
Series cputlb: Remove support for MMU_MODE*_SUFFIX | expand

Commit Message

Richard Henderson Dec. 16, 2019, 10:11 p.m. UTC
We don't actually need the result of the read, only to probe that the
memory mapping exists.  This is exactly what probe_access does.

This is also the only user of any cpu_ld*_code_ra function.
Removing this allows the interface to be removed shortly.

Acked-by: Max Filippov <jcmvbkbc@gmail.com>

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

---
 target/xtensa/mmu_helper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.20.1

Comments

Philippe Mathieu-Daudé Dec. 17, 2019, 3:51 a.m. UTC | #1
On 12/16/19 11:11 PM, Richard Henderson wrote:
> We don't actually need the result of the read, only to probe that the

> memory mapping exists.  This is exactly what probe_access does.

> 

> This is also the only user of any cpu_ld*_code_ra function.

> Removing this allows the interface to be removed shortly.

> 

> Acked-by: Max Filippov <jcmvbkbc@gmail.com>

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

> ---

>   target/xtensa/mmu_helper.c | 5 +++--

>   1 file changed, 3 insertions(+), 2 deletions(-)

> 

> diff --git a/target/xtensa/mmu_helper.c b/target/xtensa/mmu_helper.c

> index f15bff306f..b01ff9399a 100644

> --- a/target/xtensa/mmu_helper.c

> +++ b/target/xtensa/mmu_helper.c

> @@ -63,10 +63,11 @@

>   void HELPER(itlb_hit_test)(CPUXtensaState *env, uint32_t vaddr)

>   {

>       /*

> -     * Attempt the memory load; we don't care about the result but

> +     * Probe the memory; we don't care about the result but

>        * only the side-effects (ie any MMU or other exception)

>        */

> -    cpu_ldub_code_ra(env, vaddr, GETPC());

> +    probe_access(env, vaddr, 1, MMU_INST_FETCH,

> +                 cpu_mmu_index(env, true), GETPC());


TIL probe_access

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


>   }

>   

>   void HELPER(wsr_rasid)(CPUXtensaState *env, uint32_t v)

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

> We don't actually need the result of the read, only to probe that the

> memory mapping exists.  This is exactly what probe_access does.

>

> This is also the only user of any cpu_ld*_code_ra function.

> Removing this allows the interface to be removed shortly.

>

> Acked-by: Max Filippov <jcmvbkbc@gmail.com>

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


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


> ---

>  target/xtensa/mmu_helper.c | 5 +++--

>  1 file changed, 3 insertions(+), 2 deletions(-)

>

> diff --git a/target/xtensa/mmu_helper.c b/target/xtensa/mmu_helper.c

> index f15bff306f..b01ff9399a 100644

> --- a/target/xtensa/mmu_helper.c

> +++ b/target/xtensa/mmu_helper.c

> @@ -63,10 +63,11 @@

>  void HELPER(itlb_hit_test)(CPUXtensaState *env, uint32_t vaddr)

>  {

>      /*

> -     * Attempt the memory load; we don't care about the result but

> +     * Probe the memory; we don't care about the result but

>       * only the side-effects (ie any MMU or other exception)

>       */

> -    cpu_ldub_code_ra(env, vaddr, GETPC());

> +    probe_access(env, vaddr, 1, MMU_INST_FETCH,

> +                 cpu_mmu_index(env, true), GETPC());

>  }

>  

>  void HELPER(wsr_rasid)(CPUXtensaState *env, uint32_t v)



-- 
Alex Bennée
diff mbox series

Patch

diff --git a/target/xtensa/mmu_helper.c b/target/xtensa/mmu_helper.c
index f15bff306f..b01ff9399a 100644
--- a/target/xtensa/mmu_helper.c
+++ b/target/xtensa/mmu_helper.c
@@ -63,10 +63,11 @@ 
 void HELPER(itlb_hit_test)(CPUXtensaState *env, uint32_t vaddr)
 {
     /*
-     * Attempt the memory load; we don't care about the result but
+     * Probe the memory; we don't care about the result but
      * only the side-effects (ie any MMU or other exception)
      */
-    cpu_ldub_code_ra(env, vaddr, GETPC());
+    probe_access(env, vaddr, 1, MMU_INST_FETCH,
+                 cpu_mmu_index(env, true), GETPC());
 }
 
 void HELPER(wsr_rasid)(CPUXtensaState *env, uint32_t v)