[ipxe-devel] [PATCH 2/4] [virtio] Remove virtio 1.0 workaround for old QEMU

Ladi Prosek lprosek at redhat.com
Mon Dec 19 16:03:05 UTC 2016


On Mon, Dec 19, 2016 at 3:54 PM, Stefan Hajnoczi <stefanha at redhat.com> wrote:
> On Fri, Dec 16, 2016 at 03:30:03PM +0100, Ladi Prosek wrote:
>> QEMU properly reverts queue_enable to 0 on device reset as of:
>>
>>   commit 75fd6f13af8513f1e14add754549141e415f8704
>>   Author: Gerd Hoffmann <kraxel at redhat.com>
>>   Date:   Thu Jan 28 16:08:07 2016 +0100
>>
>>   virtio-pci: call pci reset variant when guest requests reset.
>
> What about new iPXE on old QEMU?

I don't have a good sense of what new-old dependencies are acceptable.
Obviously we don't want to break users of older QEMU. But leaving the
iPXE code commented out and referencing a QEMU bug forever would be
lame also.

For what it's worth, Michael suggested posting this patch back in April:

http://lists.ipxe.org/pipermail/ipxe-devel/2016-April/004872.html

>> Signed-off-by: Ladi Prosek <lprosek at redhat.com>
>> ---
>>  src/drivers/bus/virtio-pci.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/src/drivers/bus/virtio-pci.c b/src/drivers/bus/virtio-pci.c
>> index 1fcf9ba..89c4512 100644
>> --- a/src/drivers/bus/virtio-pci.c
>> +++ b/src/drivers/bus/virtio-pci.c
>> @@ -347,10 +347,7 @@ int vpm_find_vqs(struct virtio_pci_modern_device *vdev,
>>
>>          /* Check if queue is either not available or already active. */
>>          size = vpm_ioread16(vdev, &vdev->common, COMMON_OFFSET(queue_size));
>> -        /* QEMU has a bug where queues don't revert to inactive on device
>> -         * reset. Skip checking the queue_enable field until it is fixed.
>> -         */
>> -        if (!size /*|| vpm_ioread16(vdev, &vdev->common.queue_enable)*/)
>> +        if (!size || vpm_ioread16(vdev, &vdev->common, COMMON_OFFSET(queue_enable)))
>>              return -ENOENT;
>>
>>          if (size & (size - 1)) {
>> --
>> 2.7.4
>>



More information about the ipxe-devel mailing list