From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Eugenio Perez Martin <eperezma@redhat.com>
Cc: Konstantin Shkolnyy <kshk@linux.ibm.com>,
mst@redhat.com, sgarzare@redhat.com, mjrosato@linux.ibm.com,
qemu-devel@nongnu.org
Subject: Re: [PATCH v2] vdpa: Fix endian bugs in shadow virtqueue
Date: Thu, 13 Feb 2025 13:24:50 +0100 [thread overview]
Message-ID: <ca2813d4-c1f3-4653-b854-0397fe4bf26d@linaro.org> (raw)
In-Reply-To: <CAJaqyWeOY9+UwyjokOJmFjabJpGvo=zDhyZPzYh2e_gEmzHpPg@mail.gmail.com>
On 13/2/25 07:43, Eugenio Perez Martin wrote:
> On Wed, Feb 12, 2025 at 7:11 PM Philippe Mathieu-Daudé
> <philmd@linaro.org> wrote:
>>
>> On 12/2/25 17:49, Konstantin Shkolnyy wrote:
>>> VDPA didn't work on a big-endian machine due to missing/incorrect
>>> CPU<->LE data format conversions.
>>>
>>> Signed-off-by: Konstantin Shkolnyy <kshk@linux.ibm.com>
>>> ---
>>> Changes in v2: Change desc_next[] from LE format to "CPU".
>>>
>>> hw/virtio/vhost-shadow-virtqueue.c | 18 ++++++++++--------
>>> 1 file changed, 10 insertions(+), 8 deletions(-)
>>
>>
>>> @@ -228,10 +228,12 @@ static void vhost_svq_kick(VhostShadowVirtqueue *svq)
>>> smp_mb();
>>>
>>> if (virtio_vdev_has_feature(svq->vdev, VIRTIO_RING_F_EVENT_IDX)) {
>>> - uint16_t avail_event = *(uint16_t *)(&svq->vring.used->ring[svq->vring.num]);
>>> + uint16_t avail_event = le16_to_cpu(
>>> + *(uint16_t *)(&svq->vring.used->ring[svq->vring.num]));
>>
>> Nitpicking, sometimes using the ld/st API is cleaner (here lduw_le_p).
>>
>
> I'm not sure if it is right in SVQ, as it is not accessing guest
> memory but QEMU memory that has been mapped to a device. But if you
> think it is still a valid use case for ld* and st* family I'd be
> totally ok with that usage.
No need to change, better use a consistent API over the file.
Regards,
Phil.
next prev parent reply other threads:[~2025-02-13 12:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 16:49 [PATCH v2] vdpa: Fix endian bugs in shadow virtqueue Konstantin Shkolnyy
2025-02-12 18:11 ` Philippe Mathieu-Daudé
2025-02-13 6:43 ` Eugenio Perez Martin
2025-02-13 12:24 ` Philippe Mathieu-Daudé [this message]
2025-02-13 6:49 ` Eugenio Perez Martin
2025-02-14 2:24 ` Lei Yang
2025-02-14 13:01 ` Konstantin Shkolnyy
2025-02-14 13:02 ` Konstantin Shkolnyy
2025-02-15 8:21 ` Lei Yang
2025-02-25 9:30 ` Michael Tokarev
2025-02-25 12:39 ` Konstantin Shkolnyy
2025-02-27 6:33 ` Michael Tokarev
2025-02-27 20:05 ` Konstantin Shkolnyy
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=ca2813d4-c1f3-4653-b854-0397fe4bf26d@linaro.org \
--to=philmd@linaro.org \
--cc=eperezma@redhat.com \
--cc=kshk@linux.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--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).