cvs commit: src/sys/i386/i386 trap.c

John Baldwin jhb at FreeBSD.org
Tue Apr 22 11:50:49 PDT 2003


On 22-Apr-2003 David Xu wrote:
> davidxu     2003/04/22 00:45:47 PDT
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/i386/i386        trap.c 
>   Log:
>   Fix some problems for cpu_switch_load_gs. when fault address is at
>   cpu_switch_load_gs, cpu is in context switch, so don't enable interrupt.
>   because it is in context switch, it is expected sched_lock was held,
>   so don't PROC_LOCK(p) and psignal, it is LOR, probably we can
>   set a P_XSIGBUS like flag in p_sflags, and set TDF_ASTPENDING in
>   td_flags, in ast(), post a SIGBUS to process if P_XSIGBUS was set.

If we are in cpu_switch(), then PCPU_GET(spinlocks) should not be NULL.
Oh, hmm, that only works when witness is on. :(  Probably that should
be 'td->td_critnest != 0'.  That should remove the need for the eip
check at least.

Using an ast flag for to defer the SIGBUS might be the best thing to
do in that case, yes.

-- 

John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


More information about the cvs-src mailing list