Re: SMP & /sbin/clock past 1.3.72

Paul Gortmaker (gpg109@rsphy1.anu.edu.au)
Tue, 16 Apr 1996 23:21:24 +1000 (EST)


>From "Ulrich Windl" at Apr 16, 96 12:57:34 pm

I wrote:

> [...]
> > iopl(3) which is what kills you. Using the current /sbin/clock on an
> > SMP box is about as intelligent as doing "cat /dev/urandom > /dev/port".
>
> This is true for every program that uses I/O ports? I'm thinking of
> Superprobe, X, svgalib, (what else?)...

What is missing from the context of the above is that /sbin/clock does
cli/sti from user space. It is not the actual iopl() call, but the dirty
things that it is allowed to do after that call.

Besides, unless you use ports above 0x3ff, you should be using ioperm()
and not iopl(). It is better to have you application SEGV than scribble
into random ports if it happens to have a bug. Quoting Alan's seat-belt
analogy from a previous thread on this topic:

cli in user space is illegal (yes iopl(3) lets you do it but
thats because iopl(3) is "I am root, I am doing funky hardware
stuff please remove the seatbelts, turn off the ABS and go to
manual controls"). If the clock binary takes a page fault with
interrupts off your box will die. The new driver looks very nice.

Paul.