qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eugenio Perez Martin <eperezma@redhat.com>
To: Konstantin Shkolnyy <kshk@linux.ibm.com>
Cc: mst@redhat.com, sgarzare@redhat.com, mjrosato@linux.ibm.com,
	 qemu-devel@nongnu.org
Subject: Re: [PATCH] vdpa: Fix endian bugs in shadow virtqueue
Date: Wed, 12 Feb 2025 16:53:00 +0100	[thread overview]
Message-ID: <CAJaqyWeG9TC9sr6_j_9KK+ksJviUJKOr9vHzw_BzmBxCLaYepA@mail.gmail.com> (raw)
In-Reply-To: <8a5e0e25-4fda-45d9-9315-9649e8560f38@linux.ibm.com>

On Wed, Feb 12, 2025 at 4:37 PM Konstantin Shkolnyy <kshk@linux.ibm.com> wrote:
>
> On 2/12/2025 09:06, Eugenio Perez Martin wrote:
> >> -        i = cpu_to_le16(svq->desc_next[i]);
> >> +        i = le16_to_cpu(svq->desc_next[i]);
> >
> > Both svq->desc_next and "i" are in QEMU. We can skip the conversion
> > and assign directly.
>
> Are you saying that desc_next[] should be in "CPU" and not LE format?
>
> The original code contained statements (below) that led me to think that
> desc_next[] was designed to be LE...
>
> vhost_svq_last_desc_of_chain()
>          i = le16_to_cpu(svq->desc_next[i]);
>
> vhost_svq_start()
>          svq->desc_next[i] = cpu_to_le16(i + 1);
>

Yes, I did a mess with the endianness back then :(. But we can remove
both conversions, and add the conversion at
vhost_svq_vring_write_descs instead.



      reply	other threads:[~2025-02-12 15:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 16:20 [PATCH] vdpa: Fix endian bugs in shadow virtqueue Konstantin Shkolnyy
2025-02-12 15:06 ` Eugenio Perez Martin
2025-02-12 15:37   ` Konstantin Shkolnyy
2025-02-12 15:53     ` Eugenio Perez Martin [this message]

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=CAJaqyWeG9TC9sr6_j_9KK+ksJviUJKOr9vHzw_BzmBxCLaYepA@mail.gmail.com \
    --to=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).