]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
The Intel 2200BG NDIS driver does an alloca() of about 5000 bytes
authorwpaul <wpaul@FreeBSD.org>
Mon, 22 Mar 2004 00:41:41 +0000 (00:41 +0000)
committerwpaul <wpaul@FreeBSD.org>
Mon, 22 Mar 2004 00:41:41 +0000 (00:41 +0000)
commite7b058478d636902088f5a1b282ed707c6b8af70
tree47b063ef427401aac5ceaaf95eb4af806cb59c9f
parente3bae61eeded23dcd28e10872a88650bb92eca50
The Intel 2200BG NDIS driver does an alloca() of about 5000 bytes
when it associates with a net. Because FreeBSD's kstack size is only
2 pages by default, this blows the stack and causes a double fault.

To deal with this, we now create all our kthreads with 8 stack pages.
Also, we now run all timer callouts in the ndis swi thread (since
they would otherwise run in the clock ithread, whose stack is too
small). It happens that the alloca() in this case was occuring within
the interrupt handler, which was already running in the ndis swi
thread, but I want to deal with the callouts too just to be extra
safe.

NOTE: this will only work if you update vm_machdep.c with the change
I just committed. If you don't include this fix, setting the number
of stack pages with kthread_create() has essentially no effect.
sys/compat/ndis/kern_ndis.c
sys/compat/ndis/ntoskrnl_var.h
sys/compat/ndis/subr_ntoskrnl.c