git: d92ebde76430 - main - amd64: move code to clear PSL_T on debug exception into a helper
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 13 Mar 2026 22:51:07 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=d92ebde76430e99f78156fb1d865a18916380aed
commit d92ebde76430e99f78156fb1d865a18916380aed
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-03-12 09:40:44 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-03-13 22:47:13 +0000
amd64: move code to clear PSL_T on debug exception into a helper
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55827
---
sys/amd64/amd64/trap.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index a4676f156431..4bf56226d076 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -242,6 +242,17 @@ trap_check_efirt(struct thread *td, struct trapframe *frame)
return (false);
}
+static void
+trap_clear_step(struct thread *td, struct trapframe *frame)
+{
+ PROC_LOCK(td->td_proc);
+ if ((td->td_dbgflags & TDB_STEP) != 0) {
+ td->td_frame->tf_rflags &= ~PSL_T;
+ td->td_dbgflags &= ~TDB_STEP;
+ }
+ PROC_UNLOCK(td->td_proc);
+}
+
/*
* Table of handlers for various segment load faults.
*/
@@ -388,14 +399,8 @@ trap(struct trapframe *frame)
signo = SIGTRAP;
ucode = TRAP_TRACE;
dr6 = rdr6();
- if ((dr6 & DBREG_DR6_BS) != 0) {
- PROC_LOCK(td->td_proc);
- if ((td->td_dbgflags & TDB_STEP) != 0) {
- td->td_frame->tf_rflags &= ~PSL_T;
- td->td_dbgflags &= ~TDB_STEP;
- }
- PROC_UNLOCK(td->td_proc);
- }
+ if ((dr6 & DBREG_DR6_BS) != 0)
+ trap_clear_step(td, frame);
break;
case T_ARITHTRAP: /* arithmetic trap */