On 11/1/22 18:32, Song Gao wrote:
When the address is invalid address, We should set exception_index
according to MMUAccessType, and EXCCODE_ADEF need't update badinstr.
Otherwise, The system enters an infinite loop. e.g:
run test.c on system mode
test.c:
     #include<stdio.h>

     void (*func)(int *);

     int main()
     {
         int i = 8;
         void *ptr = (void *)0x4000000000000000;
         func = ptr;
         func(&i);
         return 0;
     }

Signed-off-by: Song Gao<[email protected]>
---
  target/loongarch/cpu.c        | 1 +
  target/loongarch/tlb_helper.c | 5 +++--
  2 files changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <[email protected]>

r~

Reply via email to