I have to say, after applying this patch, my test still fails while fetching the instructions from this _small_ region. Although there is no MMU_DATA_LOAD anymore, a few iterations later (while guest code has just jumped to the beginning of the executable region), QEmu segfaults (call stack is attached):
r = mr->ops->read_with_attrs(mr->opaque, addr, &tmp, size, attrs);
...
}
--------
Here, "read_with_attrs" is null. The call stack looks like:
---
#0 memory_region_read_with_attrs_accessor at memory.c:465
#1 access_with_adjusted_size at memory.c:568
#2 memory_region_dispatch_read1 at memory.c:1425
#3 memory_region_dispatch_read at memory.c:1446
#4 io_readx at accel/tcg/cputlb.c:909
#5 io_readw at accel/tcg/softmmu_template.h:106
#6 helper_le_ldw_cmmu at accel/tcg/softmmu_template.h:146
#7 cpu_lduw_code_ra at include/exec/cpu_ldst_template.h:102
#8 cpu_lduw_code at include/exec/cpu_ldst_template.h:114
#9 read_and_decode_context at target/arc/arc-decoder.c:1479
#10 arc_decode at target/arc/arc-decoder.c:1736
#11 decode_opc at target/arc/translate.c:313
#12 arc_tr_translate_insn at target/arc/translate.c:335
#13 translator_loop at accel/tcg/translator.c:107
#14 gen_intermediate_code at target/arc/translate.c:413
#15 tb_gen_code at accel/tcg/translate-all.c:1723
#16 tb_find at accel/tcg/cpu-exec.c:407
#17 cpu_exec at accel/tcg/cpu-exec.c:729
#18 tcg_cpu_exec at cpus.c:1430
---
more detailed call stack is attached.
I have to say, after applying this patch, my test still fails while fetching the instructions from this _small_ region. Although there is no MMU_DATA_LOAD anymore, a few iterations later (while guest code has just jumped to the beginning of the executable region), QEmu segfaults (call stack is attached):
memory.c region_ read_with_ attrs_accessor( MemoryRegion *mr,
... )
--------
static MemTxResult
memory_
{
uint64_t tmp = 0;
MemTxResult r;
r = mr->ops- >read_with_ attrs(mr- >opaque, addr, &tmp, size, attrs);
...
}
--------
Here, "read_with_attrs" is null. The call stack looks like: region_ read_with_ attrs_accessor at memory.c:465 with_adjusted_ size at memory.c:568 region_ dispatch_ read1 at memory.c:1425 region_ dispatch_ read at memory.c:1446 cputlb. c:909 softmmu_ template. h:106 softmmu_ template. h:146 exec/cpu_ ldst_template. h:102 exec/cpu_ ldst_template. h:114 decode_ context at target/ arc/arc- decoder. c:1479 arc/arc- decoder. c:1736 arc/translate. c:313 translate_ insn at target/ arc/translate. c:335 translator. c:107 e_code at target/ arc/translate. c:413 translate- all.c:1723 cpu-exec. c:407 cpu-exec. c:729
---
#0 memory_
#1 access_
#2 memory_
#3 memory_
#4 io_readx at accel/tcg/
#5 io_readw at accel/tcg/
#6 helper_le_ldw_cmmu at accel/tcg/
#7 cpu_lduw_code_ra at include/
#8 cpu_lduw_code at include/
#9 read_and_
#10 arc_decode at target/
#11 decode_opc at target/
#12 arc_tr_
#13 translator_loop at accel/tcg/
#14 gen_intermediat
#15 tb_gen_code at accel/tcg/
#16 tb_find at accel/tcg/
#17 cpu_exec at accel/tcg/
#18 tcg_cpu_exec at cpus.c:1430
---
more detailed call stack is attached.