git: c91bf3cb34f0 - stable/13 - epoch: replace hand coded assertion
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Jan 2023 23:26:28 UTC
The branch stable/13 has been updated by brooks:
URL: https://cgit.FreeBSD.org/src/commit/?id=c91bf3cb34f0c1238a70e674bf23f89cccddfaec
commit c91bf3cb34f0c1238a70e674bf23f89cccddfaec
Author: Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-01-20 18:03:39 +0000
Commit: Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-01-24 22:46:31 +0000
epoch: replace hand coded assertion
The assertion is equivalent to kstack_contains() so use that rather
than spelling it out.
Suggested by: jhb
Reviewed by: jhb
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D38107
(cherry picked from commit fa1d803c0f652d72840a3c59139baf9d30792860)
---
sys/kern/subr_epoch.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c
index 651fd8b419f0..7d4457428bc8 100644
--- a/sys/kern/subr_epoch.c
+++ b/sys/kern/subr_epoch.c
@@ -443,9 +443,7 @@ _epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et EPOCH_FILE_LINE)
MPASS(cold || epoch != NULL);
td = curthread;
- MPASS((vm_offset_t)et >= td->td_kstack &&
- (vm_offset_t)et + sizeof(struct epoch_tracker) <=
- td->td_kstack + td->td_kstack_pages * PAGE_SIZE);
+ MPASS(kstack_contains(td, (vm_offset_t)et, sizeof(*et)));
INIT_CHECK(epoch);
MPASS(epoch->e_flags & EPOCH_PREEMPT);