On 8/18/22 09:55, Vivian Wang wrote:
On 8/17/22 23:05, Ilya Leoshkevich wrote:
Hi,
I noticed that when we get a SEGV due to jumping to non-readable
memory, sometimes si_addr and program counter in siginfo_t are slightly
off. I tracked this down to the assumption that translators stop before
the end of a page, while in reality they may stop right after it.
Hi,
Could this be related to issue 1155 [1]? On RISC-V, I'm getting incorrect
[m|s]tval/[m|s]epc combinations for page faults in system emulation and incorrect si_addr
and program counter on SIGSEGV in user emulation. Since it seems to only affect
instructions that cross page boundaries, and RISC-V also has variable length instructions,
it seems that I've run into the same problem as what is fixed here.
It seems likely, and the code at the end of riscv_tr_translate_insn is wrong.
Could this fix be extended be extended to targets/riscv?
I'll write up something.
r~