git: 7c567fcc5650 - main - i386 kstack_contains(): account for pcb/fpu save area

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Wed, 01 Feb 2023 23:41:34 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=7c567fcc56508aa31ae58779e8633e25e8077acd

commit 7c567fcc56508aa31ae58779e8633e25e8077acd
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-01-31 23:43:23 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-02-01 22:59:26 +0000

    i386 kstack_contains(): account for pcb/fpu save area
    
    Reviewed by:    jhb
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D38320
---
 sys/i386/include/stack.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/i386/include/stack.h b/sys/i386/include/stack.h
index 773aca1c66d9..3bc1e1a3997f 100644
--- a/sys/i386/include/stack.h
+++ b/sys/i386/include/stack.h
@@ -21,7 +21,7 @@ static __inline bool
 kstack_contains(struct thread *td, vm_offset_t va, size_t len)
 {
 	return (va >= td->td_kstack && va + len >= va &&
-	    va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE);
+	    va + len <= (vm_offset_t)get_pcb_td(td));
 }
 
 #endif	/* _SYS_PROC_H_ */