Re: [PATCH v1] s390/virtio_ccw: don't allocate/assign airqs for non-existing queues

From: David Hildenbrand
Date: Mon Apr 07 2025 - 05:08:32 EST


On 07.04.25 10:54, Michael S. Tsirkin wrote:
On Mon, Apr 07, 2025 at 09:18:21AM +0200, David Hildenbrand wrote:
Now I am beginning to think we should leave the spec alone
and fix the drivers ... Ugh ....

We could always say that starting with feature X, queue indexes are fixed
again. E.g., VIRTIO_BALLOON_F_X would have it's virtqueue fixed at index 5,
independent of the other (older) features where the virtqueue indexes are
determined like today.

Won't make the implementation easier, though, I'm afraid.

(I also thought about a way to query the virtqueue index for a feature, but
that's probably overengineering)

The best contract we have is the spec. Sometimes it is hopelessly broken
and we have to fix it, but not in this case.

Let's do a theoretical excercise, assuming we want to fix the drivers,
but we also want to have workarounds in place in qemu and in
drivers to support existing ones. How would we go about it?

QEMU could likely be changed to always offer VIRTIO_BALLOON_F_FREE_PAGE_HINT, but not actually use it unless enabled for QEMU. That should work, because all action is initiated by the device.

That way, all virtqueue indexes would always be according to the spec.

We'll likely need compat machine handling ....


Regarding Linux, I'll have to think about it further ...

Maybe we want a feature bit BALLOON_FIXED and ask everyone
to negotiate it? But if we go this way, we really need to fix
the 48 bit limitation too.

I was thinking about the same, but it's all a mess ...

--
Cheers,

David / dhildenb