From: Sahil Siddiq <icegambit91@gmail.com>
To: Eugenio Perez Martin <eperezma@redhat.com>
Cc: sgarzare@redhat.com, mst@redhat.com, qemu-devel@nongnu.org,
Sahil Siddiq <sahilcdq@proton.me>
Subject: Re: [RFC v3 3/3] vhost: Allocate memory for packed vring
Date: Fri, 6 Dec 2024 02:08:44 +0530 [thread overview]
Message-ID: <6909a543-872a-4b92-ae6f-53a605317974@gmail.com> (raw)
In-Reply-To: <CAJaqyWedOSc-jm5DnxyPNfmFNcuxnaUNt3jK6MoKB+Gyr2ZQ+Q@mail.gmail.com>
Hi,
On 11/13/24 5:00 PM, Eugenio Perez Martin wrote:
> On Wed, Nov 13, 2024 at 6:11 AM Sahil Siddiq <icegambit91@gmail.com> wrote:
>>
>> Hi,
>>
>> On 10/28/24 11:07 AM, Sahil Siddiq wrote:
>>> [...]
>>> The payload that VHOST_SET_VRING_BASE accepts depends on whether
>>> split virtqueues or packed virtqueues are used [6]. In hw/virtio/vhost-
>>> vdpa.c:vhost_vdpa_svq_setup() [7], the following payload is used which is
>>> not suitable for packed virtqueues:
>>>
>>> struct vhost_vring_state s = {
>>> .index = vq_index,
>>> };
>>>
>>> Based on the implementation in the linux kernel, the payload needs to
>>> be as shown below for the ioctl to succeed for packed virtqueues:
>>>
>>> struct vhost_vring_state s = {
>>> .index = vq_index,
>>> .num = 0x80008000,
>>> };
>>>
>>> After making these changes, it looks like QEMU is able to set up the
>>> virtqueues and shadow virtqueues are enabled as well.
>>>
>>> Unfortunately, before the L2 VM can finish booting the kernel crashes.
>>> The reason is that even though packed virtqueues are to be used, the
>>> kernel tries to run
>>> drivers/virtio/virtio_ring.c:virtqueue_get_buf_ctx_split() [8]
>>> (instead of virtqueue_get_buf_ctx_packed) and throws an "invalid vring
>>> head" error. I am still investigating this issue.
>>
>> I made a mistake here. "virtqueue_get_buf_ctx_packed" [1] in the linux
>> kernel also throws the same error. I think the issue might be because
>> hw/virtio/vhost-vdpa.c:vhost_vdpa_svq_map_rings [2] does not handle
>> mapping packed virtqueues at the moment.
>>
>> Probably because of this, vq->packed.desc_state[id].data [1] is NULL in the
>> kernel.
>>
>> Regarding one of the earlier reviews in the same thread [3]:
>>
>
> I think it is a good first step, yes. Looking forward to your findings!
I faced a few more issues while testing my changes. Instead of explaining
the issues here, I thought I would explain them in a new thread along with
the next version of the patch series in case that helps with troubleshooting.
Thanks,
Sahil
next prev parent reply other threads:[~2024-12-05 20:39 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 11:21 [RFC v3 0/3] Add packed virtqueue to shadow virtqueue Sahil Siddiq
2024-08-02 11:21 ` [RFC v3 1/3] vhost: Introduce packed vq and add buffer elements Sahil Siddiq
2024-08-07 16:40 ` Eugenio Perez Martin
2024-08-02 11:21 ` [RFC v3 2/3] vhost: Data structure changes to support packed vqs Sahil Siddiq
2024-08-02 11:21 ` [RFC v3 3/3] vhost: Allocate memory for packed vring Sahil Siddiq
2024-08-07 16:22 ` Eugenio Perez Martin
2024-08-11 15:37 ` Sahil
2024-08-11 17:20 ` Sahil
2024-08-12 6:31 ` Eugenio Perez Martin
2024-08-12 19:32 ` Sahil
2024-08-13 6:53 ` Eugenio Perez Martin
2024-08-21 12:19 ` Sahil
2024-08-27 15:30 ` Eugenio Perez Martin
2024-08-30 10:20 ` Sahil
2024-08-30 10:48 ` Eugenio Perez Martin
2024-09-08 19:46 ` Sahil
2024-09-09 12:34 ` Eugenio Perez Martin
2024-09-11 19:36 ` Sahil
2024-09-12 9:54 ` Eugenio Perez Martin
2024-09-16 4:34 ` Sahil
2024-09-24 5:31 ` Sahil
2024-09-24 10:46 ` Eugenio Perez Martin
2024-09-30 5:34 ` Sahil
2024-10-28 5:37 ` Sahil Siddiq
2024-10-28 8:10 ` Eugenio Perez Martin
2024-10-31 5:10 ` Sahil Siddiq
2024-11-13 5:10 ` Sahil Siddiq
2024-11-13 11:30 ` Eugenio Perez Martin
2024-12-05 20:38 ` Sahil Siddiq [this message]
2024-08-07 16:41 ` [RFC v3 0/3] Add packed virtqueue to shadow virtqueue Eugenio Perez Martin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6909a543-872a-4b92-ae6f-53a605317974@gmail.com \
--to=icegambit91@gmail.com \
--cc=eperezma@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sahilcdq@proton.me \
--cc=sgarzare@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).