You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When NEMU is running as shared library, it could detect misaligned memory access and trap into address misaligned, which is good.
But when NEMU is running standalone, it is no longer able to detect misaligned memory access:
Using By host CPU (AC_HOST): NEMU would crash and report "BUS ERROR (core dumped)"
Using By software emulation (AC_SOFT): Nothing would happen.
Check macro AC_SOFT, we could find isa_misalign_data_addr_check(). This function shows up at three place:
isa_mmu_check(): This function seems to be called rarely and only at AMO or ifetch.
vaddr_read_internal(): isa_misalign_data_addr_check() is only called when enable CONFIG_SHARE and it works well when NEMU is using as ref.
vaddr_write(): isa_misalign_data_addr_check() is only called when enable CONFIG_SHARE and it works well when NEMU is using as ref.
In Summary, there is no misalign check at normal loads and stores when NEMU is running standalone.
I have tried to remove #ifdef CONFIG_SHARE of isa_misalign_data_addr_check() in vaddr_read_internal() and vaddr_write(). It worked well if PERF_OPT is off, but crashed if PERF_OPT is on.
The text was updated successfully, but these errors were encountered:
When NEMU is running as shared library, it could detect misaligned memory access and trap into address misaligned, which is good.
But when NEMU is running standalone, it is no longer able to detect misaligned memory access:
By host CPU
(AC_HOST
): NEMU would crash and report "BUS ERROR (core dumped)"By software emulation
(AC_SOFT
): Nothing would happen.Check macro
AC_SOFT
, we could findisa_misalign_data_addr_check()
. This function shows up at three place:isa_mmu_check()
: This function seems to be called rarely and only at AMO or ifetch.vaddr_read_internal()
:isa_misalign_data_addr_check()
is only called when enableCONFIG_SHARE
and it works well when NEMU is using as ref.vaddr_write()
:isa_misalign_data_addr_check()
is only called when enableCONFIG_SHARE
and it works well when NEMU is using as ref.In Summary, there is no misalign check at normal loads and stores when NEMU is running standalone.
I have tried to remove
#ifdef CONFIG_SHARE
ofisa_misalign_data_addr_check()
invaddr_read_internal()
andvaddr_write()
. It worked well ifPERF_OPT
is off, but crashed ifPERF_OPT
is on.The text was updated successfully, but these errors were encountered: