On 6/18/20 6:31 AM, Peter Maydell wrote: > On Wed, 3 Jun 2020 at 02:13, Richard Henderson > <richard.hender...@linaro.org> wrote: >> >> We need this to raise unaligned exceptions from user mode. >> >> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> >> --- >> v6: Use EXCP_UNALIGNED for user-only and update cpu_loop.c. > > Could you update the comment in cpu.h, maybe something like: > #define EXCP_UNALIGNED 22 /* v7M UNALIGNED UsageFault; also linux-user > */ > > and also update the string printed by arm_log_exception(): > #ifdef CONFIG_USER_ONLY > [EXCP_UNALIGNED] = "linux-user unaligned access fault", > #else > [EXCP_UNALIGNED] = "v7M UNALIGNED UsageFault", > #endif > > Otherwise > Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>
First, this could definitely be delayed to the follow-on linux-user patch set. Second, in the linux-user patch set, I decode the syndrome data to determine what kind of segv to deliver for MTE synchronous faults. It would be easy to extend that just a little to notice the usual syndrome for unaligned accesses. Which may be less confusing than abusing the v7m exception code? r~