[PATCH 08/24] bsd-user/arm/target_arch_cpu.h: Implement data abort exceptions

Warner Losh posted 24 patches 4 years, 3 months ago
Maintainers: Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, Laurent Vivier <laurent@vivier.eu>, Michael Tokarev <mjt@tls.msk.ru>
There is a newer version of this series
[PATCH 08/24] bsd-user/arm/target_arch_cpu.h: Implement data abort exceptions
Posted by Warner Losh 4 years, 3 months ago
Implement EXCP_PREFETCH_ABORT AND EXCP_DATA_ABORT. Both of these data
exceptions cause a SIGSEGV.

Signed-off-by: Klye Evans <kevans@FreeBSD.org>
Signed-off-by: Olivier Houchard <cognet@ci0.org>
Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
 bsd-user/arm/target_arch_cpu.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h
index f22384676a..62d6ee89b6 100644
--- a/bsd-user/arm/target_arch_cpu.h
+++ b/bsd-user/arm/target_arch_cpu.h
@@ -60,6 +60,17 @@ static inline void target_cpu_loop(CPUARMState *env)
         case EXCP_INTERRUPT:
             /* just indicate that signals should be handled asap */
             break;
+        case EXCP_PREFETCH_ABORT:
+            /* See arm/arm/trap.c prefetch_abort_handler() */
+        case EXCP_DATA_ABORT:
+            /* See arm/arm/trap.c data_abort_handler() */
+            info.si_signo = TARGET_SIGSEGV;
+            info.si_errno = 0;
+            /* XXX: check env->error_code */
+            info.si_code = 0;
+            info.si_addr = env->exception.vaddress;
+            queue_signal(env, info.si_signo, &info);
+            break;
         case EXCP_DEBUG:
             {
 
-- 
2.32.0


Re: [PATCH 08/24] bsd-user/arm/target_arch_cpu.h: Implement data abort exceptions
Posted by Kyle Evans 4 years, 3 months ago
On Tue, Oct 19, 2021 at 11:45 AM Warner Losh <imp@bsdimp.com> wrote:
>
> Implement EXCP_PREFETCH_ABORT AND EXCP_DATA_ABORT. Both of these data
> exceptions cause a SIGSEGV.
>
> Signed-off-by: Klye Evans <kevans@FreeBSD.org>
> Signed-off-by: Olivier Houchard <cognet@ci0.org>
> Signed-off-by: Stacey Son <sson@FreeBSD.org>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
>  bsd-user/arm/target_arch_cpu.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h
> index f22384676a..62d6ee89b6 100644
> --- a/bsd-user/arm/target_arch_cpu.h
> +++ b/bsd-user/arm/target_arch_cpu.h
> @@ -60,6 +60,17 @@ static inline void target_cpu_loop(CPUARMState *env)
>          case EXCP_INTERRUPT:
>              /* just indicate that signals should be handled asap */
>              break;
> +        case EXCP_PREFETCH_ABORT:
> +            /* See arm/arm/trap.c prefetch_abort_handler() */
> +        case EXCP_DATA_ABORT:
> +            /* See arm/arm/trap.c data_abort_handler() */
> +            info.si_signo = TARGET_SIGSEGV;
> +            info.si_errno = 0;
> +            /* XXX: check env->error_code */
> +            info.si_code = 0;
> +            info.si_addr = env->exception.vaddress;
> +            queue_signal(env, info.si_signo, &info);
> +            break;
>          case EXCP_DEBUG:
>              {
>
> --
> 2.32.0
>

Reviewed-by: Kyle Evans <kevans@FreeBSD.org>

Re: [PATCH 08/24] bsd-user/arm/target_arch_cpu.h: Implement data abort exceptions
Posted by Richard Henderson 4 years, 3 months ago
On 10/19/21 9:44 AM, Warner Losh wrote:
> Implement EXCP_PREFETCH_ABORT AND EXCP_DATA_ABORT. Both of these data
> exceptions cause a SIGSEGV.
> 
> Signed-off-by: Klye Evans<kevans@FreeBSD.org>
> Signed-off-by: Olivier Houchard<cognet@ci0.org>
> Signed-off-by: Stacey Son<sson@FreeBSD.org>
> Signed-off-by: Warner Losh<imp@bsdimp.com>
> ---
>   bsd-user/arm/target_arch_cpu.h | 11 +++++++++++
>   1 file changed, 11 insertions(+)

Short-term:
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

I hope to have the patches that make this obsolete go in this week.


r~

Re: [PATCH 08/24] bsd-user/arm/target_arch_cpu.h: Implement data abort exceptions
Posted by Warner Losh 4 years, 3 months ago
On Thu, Oct 28, 2021 at 9:29 AM Richard Henderson <
richard.henderson@linaro.org> wrote:

> On 10/19/21 9:44 AM, Warner Losh wrote:
> > Implement EXCP_PREFETCH_ABORT AND EXCP_DATA_ABORT. Both of these data
> > exceptions cause a SIGSEGV.
> >
> > Signed-off-by: Klye Evans<kevans@FreeBSD.org>
> > Signed-off-by: Olivier Houchard<cognet@ci0.org>
> > Signed-off-by: Stacey Son<sson@FreeBSD.org>
> > Signed-off-by: Warner Losh<imp@bsdimp.com>
> > ---
> >   bsd-user/arm/target_arch_cpu.h | 11 +++++++++++
> >   1 file changed, 11 insertions(+)
>
> Short-term:
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
> I hope to have the patches that make this obsolete go in this week.
>

I both look forward to that and dread it a little. Should we try to order
our PULL requests
to make less work for both of us?

Warner