Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Sep 2021 13:53:23 GMT
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 273405015492 - main - arm64: Handle 32bits breakpoint exception.
Message-ID:  <202109211353.18LDrNKW048561@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by cognet:

URL: https://cgit.FreeBSD.org/src/commit/?id=2734050154927eaa63d3b65de5d46d05569b3a5b

commit 2734050154927eaa63d3b65de5d46d05569b3a5b
Author:     Olivier Houchard <cognet@FreeBSD.org>
AuthorDate: 2021-09-21 13:49:45 +0000
Commit:     Olivier Houchard <cognet@FreeBSD.org>
CommitDate: 2021-09-21 13:52:42 +0000

    arm64: Handle 32bits breakpoint exception.
    
    A different exception is raised when we hit a 32bits breakpoint, rather than
    a 64bits one, so handle those as well when COMPAT_FREEBSD32 is defined.
    This should fix SIGBUS at least when using breakpoints with thumb2 code.
    
    PR:             256468
    MFC After:      1 week
---
 sys/arm64/arm64/trap.c     | 3 +++
 sys/arm64/include/armreg.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c
index 40bad51e8513..af17a6a2951e 100644
--- a/sys/arm64/arm64/trap.c
+++ b/sys/arm64/arm64/trap.c
@@ -555,6 +555,9 @@ do_el0_sync(struct thread *td, struct trapframe *frame)
 		break;
 	case EXCP_BRKPT_EL0:
 	case EXCP_BRK:
+#ifdef COMPAT_FREEBSD32
+	case EXCP_BRKPT_32:
+#endif /* COMPAT_FREEBSD32 */
 		call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_elr,
 		    exception);
 		userret(td, frame);
diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h
index bc6d34cb3c1a..bcbe9d13863d 100644
--- a/sys/arm64/include/armreg.h
+++ b/sys/arm64/include/armreg.h
@@ -238,6 +238,7 @@
 #define	 EXCP_SOFTSTP_EL1	0x33	/* Software Step, from same EL */
 #define	 EXCP_WATCHPT_EL0	0x34	/* Watchpoint, from lower EL */
 #define	 EXCP_WATCHPT_EL1	0x35	/* Watchpoint, from same EL */
+#define	 EXCP_BRKPT_32		0x38    /* 32bits breakpoint */
 #define	 EXCP_BRK		0x3c	/* Breakpoint */
 
 /* ICC_CTLR_EL1 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109211353.18LDrNKW048561>