[ipxe-devel] [ipxe/ipxe] virtio changes 5/2016 (#55)

Michael Brown mcb30 at ipxe.org
Mon Jun 20 15:48:14 UTC 2016

On 20/06/16 16:30, Gerd Hoffmann wrote:
> On Mo, 2016-06-20 at 15:44 +0100, Michael Brown wrote:
>> On 20/06/16 15:37, Ladi Prosek wrote:
>>> Thanks - virtio devices may be configured to expose both I/O and memory
>>> BARs, with either type being enough to drive the device. It is basically
>>> a back-compat setup where older drivers can still use I/O ports and
>>> newer may choose to use the so called "modern" interface.
>>> We would like to avoid enabling PCI_COMMAND_IO / PCI_COMMAND_MEM if the
>>> driver is not going to use it.
>> Why?
> It is nice to have.  It will make sure the driver will only use the
> interface it intends to use and doesn't mix IO-based legacy device
> access and MMIO-based modern device access by accident.

OK.  If that kind of safety check is wanted, it should probably be 
ensured at compile time, e.g. by having some kind of operations table 
instead of scattered "if (is_modern) {}" tests.

I don't think this "nice to have" justifies the code size increase, but 
I'll merge it if both you and Ladi disagree with me.


More information about the ipxe-devel mailing list