All of lore.kernel.org
 help / color / mirror / Atom feed
From: "André Silva" <afscoelho@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO
Date: Wed, 8 Jan 2020 16:37:27 -0300	[thread overview]
Message-ID: <CAGTcC7yDmpo843uQEQ9=nyqW-wc=XE+dLvqiLmDf6eHuAxeivg@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA9v-x31y0CraXkfAN3PVQs+Oyo3F+mTA593Duf0t1Wb0A@mail.gmail.com>

Yes, it looks like. virtio_pci_config_read is called via a pointer
from memory_region_read_accessor and memory_region_write_accessor
calls virtio_pci_config_write.
I tested the patch in a linux/ppc64 host with a FreeBSD/ppc64 guest
and VirtIO 0.9 (legacy) driver and from what I saw the config area is
accessed only in these functions.

Thanks!
andré

On Wed, Jan 8, 2020 at 2:51 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Wed, 8 Jan 2020 at 16:20, Andre Silva <afscoelho@gmail.com> wrote:
> >
> > Remove the bswap function calls after reading and before writing
> > memory bytes in virtio_pci_config_read and virtio_pci_config_write
> > because they are reverting back an already swapped bytes
>
> Is "because we wrote it via virtio_pci_config_write" really
> the only way that the data read by virtio_pci_config_read
> is ever set or updated ?
>
> thanks
> -- PMM


  reply	other threads:[~2020-01-08 19:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 16:16 [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO Andre Silva
2020-01-08 17:51 ` Peter Maydell
2020-01-08 19:37   ` André Silva [this message]
2020-01-09 10:50 ` Michael S. Tsirkin
2020-01-09 12:25   ` André Silva
2020-01-09 12:39     ` Michael S. Tsirkin
2020-01-09 16:06       ` Greg Kurz
2020-01-09 21:18         ` André Silva
2020-01-10  8:55           ` Greg Kurz
2020-01-10 12:00             ` André Silva
2020-01-10 14:50               ` Greg Kurz
2020-01-10 17:09                 ` André Silva
  -- strict thread matches above, loose matches on Subject: below --
2020-01-08 12:56 Andre Silva
2020-01-08 12:56 ` Andre Silva
2020-01-08 15:49   ` no-reply

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='CAGTcC7yDmpo843uQEQ9=nyqW-wc=XE+dLvqiLmDf6eHuAxeivg@mail.gmail.com' \
    --to=afscoelho@gmail.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.