Re: [PATCH v3 16/27] linux-user/nios2: Properly emulate EXCP_TRAP

2021-09-27 Thread Richard Henderson
On 9/27/21 9:23 AM, Peter Maydell wrote: Loading the insn and fishing out the imm5 field is about 2 lines of code, isn't it? It's how we handle similar cases for other targets. And we actively get it wrong, e.g. mips. So I have patches to move that code *out* of linux-user. We have macros in

Re: [PATCH v3 16/27] linux-user/nios2: Properly emulate EXCP_TRAP

2021-09-27 Thread Peter Maydell
On Fri, 24 Sept 2021 at 17:59, Richard Henderson wrote: > > The real kernel has to load the instruction and extract > the imm5 field; for qemu, modify the translator to do this. > > The use of R_AT for this in cpu_loop was a bug. Handle > the other trap numbers as per the kernel's trap_table. >

[PATCH v3 16/27] linux-user/nios2: Properly emulate EXCP_TRAP

2021-09-24 Thread Richard Henderson
The real kernel has to load the instruction and extract the imm5 field; for qemu, modify the translator to do this. The use of R_AT for this in cpu_loop was a bug. Handle the other trap numbers as per the kernel's trap_table. Signed-off-by: Richard Henderson --- target/nios2/cpu.h |