qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] target/loongarch: Fix raise_mmu_exception() set wrong ex


From: Richard Henderson
Subject: Re: [PATCH 2/2] target/loongarch: Fix raise_mmu_exception() set wrong exception_index
Date: Wed, 2 Nov 2022 16:53:31 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

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<gaosong@loongson.cn>
---
  target/loongarch/cpu.c        | 1 +
  target/loongarch/tlb_helper.c | 5 +++--
  2 files changed, 4 insertions(+), 2 deletions(-)

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

r~



reply via email to

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