qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Richard Henderson
Subject: Re: [PATCH v3 16/27] linux-user/nios2: Properly emulate EXCP_TRAP
Date: Mon, 27 Sep 2021 10:30:38 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

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 target/nios2/ to do the field decode, and not in linux-user/.

I think I prefer that over putting
linux-user specific fields and handling into the target/nios2
code.

Would you prefer a generic-y named field like error_code, which we include in 
other targets?

The kernel also defines:
  * trap 31 ("breakpoint"), which should wind PC back by 4 and
    send a SIGTRAP/TRAP_BRKPT
  * trap 30 ("KGDB breakpoint"), which we should treat the same
    as the "default" case since we should be acting like "kernel
    with CONFIG_KGDB not defined"

Dang it, how did I miss those?


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]