Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2021 14:09:32 GMT
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 0fd0e98e50f3 - stable/12 - arm64: don't pass user trapframe to kdb_trap()
Message-ID:  <202101251409.10PE9Whu049799@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=0fd0e98e50f3332c9f57c4046070237647da2ef9

commit 0fd0e98e50f3332c9f57c4046070237647da2ef9
Author:     mhorne <mhorne@FreeBSD.org>
AuthorDate: 2020-12-18 18:43:52 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2021-01-25 13:55:25 +0000

    arm64: don't pass user trapframe to kdb_trap()
    
    Reviewed by:    jhb (slightly earlier version)
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit e9bb4ce3d0e714d35b12ffdc7ecb56cade01f4a0)
---
 sys/arm64/arm64/trap.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c
index cfd90e425593..5d14052d7789 100644
--- a/sys/arm64/arm64/trap.c
+++ b/sys/arm64/arm64/trap.c
@@ -271,7 +271,6 @@ print_registers(struct trapframe *frame)
 void
 do_el1h_sync(struct thread *td, struct trapframe *frame)
 {
-	struct trapframe *oframe;
 	uint32_t exception;
 	uint64_t esr, far;
 
@@ -288,18 +287,6 @@ do_el1h_sync(struct thread *td, struct trapframe *frame)
 	    "do_el1_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", td,
 	    esr, frame->tf_elr, frame);
 
-	oframe = td->td_frame;
-
-	switch (exception) {
-	case EXCP_BRK:
-	case EXCP_WATCHPT_EL1:
-	case EXCP_SOFTSTP_EL1:
-		break;
-	default:
-		td->td_frame = frame;
-		break;
-	}
-
 	switch(exception) {
 	case EXCP_FP_SIMD:
 	case EXCP_TRAP_FP:
@@ -330,18 +317,15 @@ do_el1h_sync(struct thread *td, struct trapframe *frame)
 		}
 #endif
 #ifdef KDB
-		kdb_trap(exception, 0,
-		    (td->td_frame != NULL) ? td->td_frame : frame);
+		kdb_trap(exception, 0, frame);
 #else
 		panic("No debugger in kernel.\n");
 #endif
-		frame->tf_elr += 4;
 		break;
 	case EXCP_WATCHPT_EL1:
 	case EXCP_SOFTSTP_EL1:
 #ifdef KDB
-		kdb_trap(exception, 0,
-		    (td->td_frame != NULL) ? td->td_frame : frame);
+		kdb_trap(exception, 0, frame);
 #else
 		panic("No debugger in kernel.\n");
 #endif
@@ -355,8 +339,6 @@ do_el1h_sync(struct thread *td, struct trapframe *frame)
 		panic("Unknown kernel exception %x esr_el1 %lx\n", exception,
 		    esr);
 	}
-
-	td->td_frame = oframe;
 }
 
 void



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