>This has something to do with the TIOCCONS ioctl.  tputchar() is the
>output function for the TOTTY case, and the TOTTY flag is only set for
>kernel printfs if TIOCCONS has set constty to non-NULL.  I'm not sure
>what uses TIOCCONS (I think it is intended for use with X, but it
>doesn't seem to be used on my systems).  

IIRC, xconsole uses this to capture console output.

>TIOCCONS is almost unimplementable
>(printing to a terminal is not reentrant enough to work in all contexts,
>and is supposed to be protected by spltty(), but kernel printfs must
>work in all contexts), so the correct fix may be to remove it.  TIOCCONS
>is broken in all versions of FreeBSD.  The brokenness is just more
>obvious now that there are more locks to trip over.
>
>The output function for the TOLOG case (i.e., msglogchar()) also seems to
>be broken in all versions of FreeBSD.  It operates on the circular message
>buffer, but doesn't have any locking.

I discussed this with jhb. We even had a test patch. Jhb told me
that someone else was working on providing proper locking in
kernel printf(). 

>The output function for the TOCONS case (i.e., cnputc()) is also
>problematic.  Only the serial console output routine even attempts to
>be reentrant, and (per-cpu) reentrancy is not enough under SMP.
>Syscons' output routine was easy to panic by mixing kernel printfs with
>user-mode output the last time I checked.

Syscons' sccnputc() is not reentrant.  I was trying to improbe this,
but decided that I would wait until I see further development in 
tty locking and kernel printf() area by jhb.

Kazu








To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to