aboutsummaryrefslogtreecommitdiff
path: root/hw/avr/arduino.c
diff options
context:
space:
mode:
authorBibo Mao <maobibo@loongson.cn>2025-07-14 09:54:46 +0800
committerSong Gao <gaosong@loongson.cn>2025-07-31 16:56:51 +0800
commitcaab7ac83507e3e9a5fe2f37be5cfa759e766ba2 (patch)
treea929ff037f47b7f219c22abbc796ad033a303743 /hw/avr/arduino.c
parent4e06566dbd1b1251c2788af26a30bd148d4eb6c1 (diff)
downloadqemu-caab7ac83507e3e9a5fe2f37be5cfa759e766ba2.zip
qemu-caab7ac83507e3e9a5fe2f37be5cfa759e766ba2.tar.gz
qemu-caab7ac83507e3e9a5fe2f37be5cfa759e766ba2.tar.bz2
target/loongarch: Fix valid virtual address checking
On LoongArch64 system, the high 32 bit of 64 bit virtual address should be 0x00000[0-7]yyy or 0xffff8yyy. The bit from 47 to 63 should be all 0 or all 1. Function get_physical_address() only checks bit 48 to 63, there will be problem with the following test case. On physical machine, there is bus error report and program exits abnormally. However on qemu TCG system emulation mode, the program runs normally. The virtual address 0xffff000000000000ULL + addr and addr are treated the same on TLB entry checking. This patch fixes this issue. void main() { void *addr, *addr1; int val; addr = malloc(100); *(int *)addr = 1; addr1 = 0xffff000000000000ULL + addr; val = *(int *)addr1; printf("val %d \n", val); } Cc: qemu-stable@nongnu.org Signed-off-by: Bibo Mao <maobibo@loongson.cn> Acked-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Song Gao <gaosong@loongson.cn> Message-ID: <20250714015446.746163-1-maobibo@loongson.cn> Signed-off-by: Song Gao <gaosong@loongson.cn>
Diffstat (limited to 'hw/avr/arduino.c')
0 files changed, 0 insertions, 0 deletions