[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 0/4] linux-user: Fix siginfo_t contents when jumping to no
From: |
Ilya Leoshkevich |
Subject: |
Re: [PATCH v5 0/4] linux-user: Fix siginfo_t contents when jumping to non-readable pages |
Date: |
Thu, 18 Aug 2022 20:28:39 +0200 |
User-agent: |
Evolution 3.42.4 (3.42.4-2.fc35) |
On Fri, 2022-08-19 at 00:55 +0800, Vivian Wang wrote:
> 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.
> Could this fix be extended be extended to targets/riscv?
> dram
> [1]: https://gitlab.com/qemu-project/qemu/-/issues/1155
Yes, this looks quite similar.
I'm not too familiar with riscv, but I just googled [1].
If the following is correct:
---
However, the instruction set reserves enough opcode space to make it
possible to differentiate between 16-bit, 32-bit, 48-bit, and 64-bit
instructions. Instructions that start with binary 11 (in the lowest
bit position of the instruction) are 32-bit sized instructions (but one
pattern is reserved: so they cannot start with 11111). The compact
instructions use 00, 01, and 10 in that same position. 48-bit
instructions use starting sequence 011111, and 64-bit instructions
start with 0111111.
---
then we can fix this the same way s390x is being fixed here.
[1]
https://stackoverflow.com/questions/56874101/how-does-risc-v-variable-length-of-instruction-work-in-detail
- [PATCH v5 0/4] linux-user: Fix siginfo_t contents when jumping to non-readable pages, Ilya Leoshkevich, 2022/08/17
- [PATCH v5 3/4] target/i386: Make translator stop before the end of a page, Ilya Leoshkevich, 2022/08/17
- [PATCH v5 4/4] tests/tcg: Test siginfo_t contents when jumping to non-readable pages, Ilya Leoshkevich, 2022/08/17
- [PATCH v5 1/4] linux-user: Clear tb_jmp_cache on mprotect(), Ilya Leoshkevich, 2022/08/17
- [PATCH v5 2/4] target/s390x: Make translator stop before the end of a page, Ilya Leoshkevich, 2022/08/17
- Re: [PATCH v5 0/4] linux-user: Fix siginfo_t contents when jumping to non-readable pages, Richard Henderson, 2022/08/17
- Re: [PATCH v5 0/4] linux-user: Fix siginfo_t contents when jumping to non-readable pages, Vivian Wang, 2022/08/18