git: f7c733e4fe5d - main - amd64: Convert a cheap DIAGNOSTIC check to a KASSERT
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 17 Sep 2023 10:37:25 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=f7c733e4fe5d55fd78cd2b0c27483eeaff3f79a3
commit f7c733e4fe5d55fd78cd2b0c27483eeaff3f79a3
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-08-11 15:54:34 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-09-17 10:27:31 +0000
amd64: Convert a cheap DIAGNOSTIC check to a KASSERT
MFC after: 1 week
---
sys/amd64/amd64/trap.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 0d9a660abdb8..4d5887369207 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -1188,12 +1188,9 @@ amd64_syscall(struct thread *td, int traced)
kmsan_mark(td->td_frame, sizeof(*td->td_frame), KMSAN_STATE_INITED);
-#ifdef DIAGNOSTIC
- if (!TRAPF_USERMODE(td->td_frame)) {
- panic("syscall");
- /* NOT REACHED */
- }
-#endif
+ KASSERT(TRAPF_USERMODE(td->td_frame),
+ ("%s: not from user mode", __func__));
+
syscallenter(td);
/*