The problem is the ABI. We can either require that PCI configuration
values are accessed with natural instructions, or it makes very little
sense to use the PCI configuration space for virtio configuration
information. If we really can't find a way to do this (and I think my
current implementation is the best compromise since it hides this from
everything else), then I think I'll switch over to just writing a PFN
into a PCI configuration slot and then have that page store the virtio
configuration information (much like is done with lguest).
Either virtio config looks like a shared memory area (as lguest
currently implements it), or it looks like hardware registers (like
virtio-pci implements it). After thinking about it for a while, I don't
think the two can be reconciled. There are subtle differences between
the two that can't be hidden in the virtio interface. For instance, in
the PCI model, you get notified when values are read/written whereas in
the lguest model, you don't and need explicit status bits.
If you're very against the switch() magic, then I'll switch over to just
using a shared memory area.
Regards,
Anthony Liguori
-