> That's true. We need to make it in such a way that if the
> argument to ioctl() is 0, then it runs forever until it needs
> to have something handled. The nice thing about being able to
> give a number of quanta is that if you know something shouldn't
> take too long, you can put a timeout on it this way. Who knows
> when that'll come in handy :)
I'd prefer to just have the user mode app set up a timer if it needs
a timeout; the kernel loop will exit automatically as soon as the
SIGALRM is to be delivered ... This way, we don't bother the kernel
with irrelevant stuff, plus we actually have exact timing.
> > Argh. Are you really sure this is worth all that effort? Just to
> > avoid an additional fault in the unlikely case that the guest OS uses
> > a software interrupt that doesn't overlap with hardware vectors?
>
> Let's say we run linux in the virtual machine. If we do it the
> economic way (the way it is now) then linux system call interrupt
> will directly jump to the system call entry point, without any
> hassle in the monitor --> fast. Your way such an oft-used interrupt
> is slowed down immensely. I'd rather slow down things only if
> there's no other choice...
But in the Linux int 0x80 case we must fault to the monitor anyway,
because this interrupt involves a privilege level transition. This
means we'll have to at least note in the monitor structures that the
real guest CPL is now 0, and whatever other stuff the virtualization
layer will need to do on privilege transitions ...
We can let an interrupt run through only if it doesn't involve
privilege transitions *and* doesn't collide with an host hardware IRQ.
I'm not aware of any example in any of the intended guest OSes that
would match both criteria.
> I've been thinking of other ways to find out what interrupts are
> allocated without having access to structures that I'm not supposed
> to access (I assume that all the unused interrupts have a spcific
> kind of IDT entry... we could try to loop through the IDT to
> figure out which interrupts are actually in use.)
If it is like in 2.0, they have a default interrupt handler routine
(which just prints out "unknown interrupt" or so) that is entered
into all otherwise unused IDT slots.
> I'm still looking
> into that. OTOH, for such a little thing like exporting a symbol,
> we might as well ask the linux guys to add an extra line to their
> kernel :)
The thing is that they probably deliberately *don't* want to export
such implementation details to modules, so that they can change it
without fearing to break modules all over the place ;-)
Bye,
Ulrich
--
Ulrich Weigand,
IMMD 1, Universitaet Erlangen-Nuernberg,
Martensstr. 3, D-91058 Erlangen, Phone: +49 9131 85-7688