Hi,
On 4/14/25 8:37 PM, Eugenio Perez Martin wrote:
On Mon, Apr 14, 2025 at 11:38 AM Sahil Siddiq <icegambi...@gmail.com> wrote:
On 3/28/25 1:21 PM, Eugenio Perez Martin wrote:
On Thu, Mar 27, 2025 at 7:42 PM Sahil Siddiq <icegambi...@gmail.com> wrote:
On 3/26/25 1:33 PM, Eugenio Perez Martin wrote:
[...]
I think both approaches should be valid. My advice is to follow
Linux's code and let it be the tail descriptor id. This descriptor id
is pushed and popped from vq->free_head in a stack style.
In addition to that, Linux also sets the same id to all the chain
elements. I think this is useful when dealing with bad devices. In
particular,
Understood. So far, I have implemented this so it matches the
implementation in Linux.
QEMU's packed vq implementation looked at the first
desciptor's id, which is an incorrect behavior.
Are you referring to:
1. svq->desc_state[qemu_head].elem = elem (in vhost_svq_add()), and
2. *head = id (in vhost_svq_add_packed())
I meant "it used to use the first descriptor id by mistake". It was
fixed in commit 33abfea23959 ("hw/virtio: Fix obtain the buffer id
from the last descriptor"). It is better to set the descriptor id in
all the descriptors of the chain, so if QEMU does not contain this
patch in the nested VM case it can still work with this version.
Oh, ok. I have understood this now.
Thanks,
Sahil