On Sat, 21 Aug 2021 at 21:03, Richard Henderson <richard.hender...@linaro.org> wrote: > > Pull the fault information from where we placed it, in > arm_cpu_tlb_fill and arm_cpu_do_unaligned_access. > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > Pulled out from the larger unaligned data patch set. > For short-form FSC, pc misalignment is reported in the same way. > --- > linux-user/arm/cpu_loop.c | 39 ++++++++++++++++++++++++++++++++++----- > 1 file changed, 34 insertions(+), 5 deletions(-) > > diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c
> + case 0x3: /* Access flag fault, level 1 */ > + case 0x6: /* Access flag fault, level 2 */ > + case 0x9: /* Domain fault, level 1 */ > + case 0xb: /* Domain fault, level 2 */ > + case 0xd: /* Permision fault, level 1 */ > + case 0xf: /* Permision fault, level 2 */ "Permission" > + si_signo = TARGET_SIGSEGV; > + si_code = TARGET_SEGV_ACCERR; > + break; > + case 0x5: /* Translation fault, level 1 */ > + case 0x7: /* Translation fault, level 2 */ > + si_signo = TARGET_SIGSEGV; > + si_code = TARGET_SEGV_MAPERR; > + break; Side note: for cases like this where we can tell MAPERR from ACCERR based on info the exception handler passes to us, should we prefer that or the "check the page flags" approach that force_sigsegv_for_addr() takes ? I feel like the former is nicer, because in a multithreaded program some other thread might have changed whether the page is mapped between our taking the fault and getting here. But maybe that's always racy... Anyway, other than the typo, Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM