qemu-riscv
[Top][All Lists]
Advanced

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

Question for misaligned exception(load/store/fetch) in qemu


From: Eric Chan
Subject: Question for misaligned exception(load/store/fetch) in qemu
Date: Mon, 6 Feb 2023 13:46:45 +0800

Hi qemu-riscv,

I'm a riscv amateur.
I want to generate misaligned exception but it doesn't work.
I test qemu v6.2 and v7.2, both of them can't work.
qemu-system-riscv32 -version
QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.6)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

/home/eric/qemu/build_v7.2/qemu-system-riscv32 --version 
QEMU emulator version 7.2.0 (v7.2.0)
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers 
 
 

for fetch misalgiend exception, I refer Volume I: RISC-V User-Level ISA V2.2
「An instruction address misaligned exception is generated on a taken branch or unconditional jump if the target
address is not four-byte aligned.」
ec0fb4e2-0341-46fb-8fb6-030df43e4100.png
So I use jr with a unaligned target address but it seem automatically align address.
image.png

for load/store misaligned exception, I use lw, sw for a unaligned address,
but it can read/write unaligned memory...
image.png
image.png
image.png
image.png

Thanks,
Eric Chan

reply via email to

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