diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index a4decc4976dc..f4f6e7109a16 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -205,8 +205,7 @@ trap_check_kstack(void) stk = read_esp(); if (stk >= PMAP_TRM_MIN_ADDRESS) panic("td %p stack %#x in trampoline", td, stk); - if (stk < td->td_kstack || stk >= td->td_kstack + - ptoa(td->td_kstack_pages)) + if (!kstack_contains(td, stk, 0)) panic("td %p stack %#x not in kstack VA %#x %d", td, stk, td->td_kstack, td->td_kstack_pages); }