[SeaBIOS] [PATCH v2 07/22] virtio: find version 1.0 virtio capabilities

Gerd Hoffmann kraxel at redhat.com
Wed Jul 1 14:24:02 CEST 2015


  Hi,

> Hmm this seems to violate this rule in the spec:
> 
> 
> 	The driver SHOULD use the first instance of each virtio structure type
> 	they can support.
> 
> "can support" here means that bios was able to allocate
> it during enumeration.
> 
> For example there could be both IO and memory, in this order
> you need to check that IO/memory got enabled (in theory,
> also that they are within parent bridge's windows - used
> by some guests, but
> seabios doesn't disable memmory/io in this strange way).

Yes, seabios always allocates both mem and io.
So this incremental fix ...

@@ -234,7 +234,7 @@ void vp_init_simple(struct vp_device *vp, struct
pci_device *pci)
             vp_cap = NULL;
             break;
         }
-        if (vp_cap) {
+        if (vp_cap && !vp_cap->cap) {
             vp_cap->cap = cap;
             vp_cap->bar = pci_config_readb(pci->bdf, cap +
                                            offsetof(struct
virtio_pci_cap, bar));

... makes seabios use the first not the last and should do the trick,
right?

cheers,
  Gerd





More information about the SeaBIOS mailing list