Message ID | 20210729004647.282017-2-richard.henderson@linaro.org |
---|---|
State | New |
Headers | show |
Series | Unaligned accesses for user-only | expand |
On 7/29/21 2:46 AM, Richard Henderson wrote: > We shouldn't be ignoring SIGBUS for user-only. > Move our existing TCGCPUOps hook out from CONFIG_SOFTMMU. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > include/hw/core/tcg-cpu-ops.h | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
On 7/29/21 2:46 AM, Richard Henderson wrote: > We shouldn't be ignoring SIGBUS for user-only. > Move our existing TCGCPUOps hook out from CONFIG_SOFTMMU. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > include/hw/core/tcg-cpu-ops.h | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h > index eab27d0c03..513d6bfe72 100644 > --- a/include/hw/core/tcg-cpu-ops.h > +++ b/include/hw/core/tcg-cpu-ops.h > @@ -60,6 +60,13 @@ struct TCGCPUOps { > /** @debug_excp_handler: Callback for handling debug exceptions */ > void (*debug_excp_handler)(CPUState *cpu); > > + /** > + * @do_unaligned_access: Callback for unaligned access handling > + */ > + void (*do_unaligned_access)(CPUState *cpu, vaddr addr, > + MMUAccessType access_type, > + int mmu_idx, uintptr_t retaddr); Shouldn't it be QEMU_NORETURN?
On Thu, 29 Jul 2021 at 01:50, Richard Henderson <richard.henderson@linaro.org> wrote: > > We shouldn't be ignoring SIGBUS for user-only. > Move our existing TCGCPUOps hook out from CONFIG_SOFTMMU. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
On 7/28/21 8:19 PM, Philippe Mathieu-Daudé wrote: > On 7/29/21 2:46 AM, Richard Henderson wrote: >> We shouldn't be ignoring SIGBUS for user-only. >> Move our existing TCGCPUOps hook out from CONFIG_SOFTMMU. >> >> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> >> --- >> include/hw/core/tcg-cpu-ops.h | 14 +++++++------- >> 1 file changed, 7 insertions(+), 7 deletions(-) >> >> diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h >> index eab27d0c03..513d6bfe72 100644 >> --- a/include/hw/core/tcg-cpu-ops.h >> +++ b/include/hw/core/tcg-cpu-ops.h >> @@ -60,6 +60,13 @@ struct TCGCPUOps { >> /** @debug_excp_handler: Callback for handling debug exceptions */ >> void (*debug_excp_handler)(CPUState *cpu); >> >> + /** >> + * @do_unaligned_access: Callback for unaligned access handling >> + */ >> + void (*do_unaligned_access)(CPUState *cpu, vaddr addr, >> + MMUAccessType access_type, >> + int mmu_idx, uintptr_t retaddr); > > Shouldn't it be QEMU_NORETURN? > I think in system mode we're allowed to return, letting the unaligned access continue. But I'm not sure about that, and it may not even be used. r~
diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index eab27d0c03..513d6bfe72 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -60,6 +60,13 @@ struct TCGCPUOps { /** @debug_excp_handler: Callback for handling debug exceptions */ void (*debug_excp_handler)(CPUState *cpu); + /** + * @do_unaligned_access: Callback for unaligned access handling + */ + void (*do_unaligned_access)(CPUState *cpu, vaddr addr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr); + #ifdef NEED_CPU_H #ifdef CONFIG_SOFTMMU /** @@ -70,13 +77,6 @@ struct TCGCPUOps { unsigned size, MMUAccessType access_type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retaddr); - /** - * @do_unaligned_access: Callback for unaligned access handling - */ - void (*do_unaligned_access)(CPUState *cpu, vaddr addr, - MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr); - /** * @adjust_watchpoint_address: hack for cpu_check_watchpoint used by ARM */
We shouldn't be ignoring SIGBUS for user-only. Move our existing TCGCPUOps hook out from CONFIG_SOFTMMU. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- include/hw/core/tcg-cpu-ops.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.25.1