diff mbox series

[v2,10/27] target/mips: Pass a valid error to raise_mmu_exception for user-only

Message ID 20190509060246.4031-11-richard.henderson@linaro.org
State Superseded
Headers show
Series tcg: Add CPUClass::tlb_fill | expand

Commit Message

Richard Henderson May 9, 2019, 6:02 a.m. UTC
At present we give ret = 0, or TLBRET_MATCH.  This gets matched
by the default case, which falls through to TLBRET_BADADDR.
However, it makes more sense to use a proper value.  All of the
tlb-related exceptions are handled identically in cpu_loop.c,
so TLBRET_BADADDR is as good as any other.  Retain it.

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

---
 target/mips/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.1

Comments

Philippe Mathieu-Daudé May 9, 2019, 9:45 a.m. UTC | #1
On 5/9/19 8:02 AM, Richard Henderson wrote:
> At present we give ret = 0, or TLBRET_MATCH.  This gets matched

> by the default case, which falls through to TLBRET_BADADDR.

> However, it makes more sense to use a proper value.  All of the

> tlb-related exceptions are handled identically in cpu_loop.c,

> so TLBRET_BADADDR is as good as any other.  Retain it.

> 

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

> ---

>  target/mips/helper.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/target/mips/helper.c b/target/mips/helper.c

> index c44cdca3b5..cc7be7703a 100644

> --- a/target/mips/helper.c

> +++ b/target/mips/helper.c

> @@ -884,7 +884,7 @@ int mips_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, int rw,

>      int prot;

>      int access_type;

>  #endif

> -    int ret = 0;

> +    int ret = TLBRET_BADADDR;

>  

>  #if 0

>      log_cpu_state(cs, 0);

> 


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

Patch

diff --git a/target/mips/helper.c b/target/mips/helper.c
index c44cdca3b5..cc7be7703a 100644
--- a/target/mips/helper.c
+++ b/target/mips/helper.c
@@ -884,7 +884,7 @@  int mips_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, int rw,
     int prot;
     int access_type;
 #endif
-    int ret = 0;
+    int ret = TLBRET_BADADDR;
 
 #if 0
     log_cpu_state(cs, 0);