[Lguest] My vector reserve patches etc. so Plan 9 boots.

ron minnich rminnich at gmail.com
Fri Sep 7 01:41:39 EST 2007


Rusty, what you've done is a big improvement in layout, but I think it
will not work.

The kernel sets up vectors very early in the game, from my reading of
it anyway -- and, also, from my watching what it's doing. The vector
0x40 is allocated long before I get a chance to load a guest. We reuse
it at our peril -- there is no tracking of vectors and their ownership
in the kernel -- hence that static array in io_apic.c, just so the
io_apic can have some idea what's going on -- but we're not going to
get to use 0x40, since the bit will be set by the time we can log in.

After looking at what is going on, I concluded the only safe thing to
do was to get in very early (hence the cmdline parameter) and lock out
certain vectors so that they were never used at all; and, not try to
get fancy and attempt to allocate/free vectors.

The second thing that will burn you is this code in io_apic.c
       if (test_and_set_bit(vector, used_vectors))
                goto next;

I tried that too. You can verify this if you want, but I think what
you'll find is that the kernel won't be happy at all, since it
actually will hit that code with the same vector a few times --
surprised me too. And, in a few cases, it will fail to find a vector
for an irq --- another surprise. There will be a bunch of problems, or
there were on my laptop anyway, since a number of devices end sans
vector ("nobody cared" messages are one result).

So, I think your latest patch is a better layout than mine, but for
the most part is a design that I tried already and it did not work for
a number of reasons. Moving the init code to traps.c was a good move
-- darn it, why didn't I do that? -- but, overall, I don't think this
design will go.

I can try it however if you really want me to :-)

I think the best bet is moving the early parameter and bit set to
traps.c, leave the tests in io_apic.c, i8259.c, and the lguest code;
and never, ever, modify the vector bit map once it is set in trapinit.

thanks

ron



More information about the Lguest mailing list