qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Jason Wang <jasowang@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] memory: allow zero size for adjust_endianness()
Date: Thu, 27 Aug 2015 15:10:32 +0200	[thread overview]
Message-ID: <20150827151032.3daebb92@bahia.local> (raw)
In-Reply-To: <20150827152902-mutt-send-email-mst@redhat.com>

On Thu, 27 Aug 2015 15:30:55 +0300
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Thu, Aug 27, 2015 at 01:27:54PM +0100, Peter Maydell wrote:
> > On 27 August 2015 at 13:25, Michael S. Tsirkin <mst@redhat.com> wrote:
> > > On Thu, Aug 27, 2015 at 01:20:52PM +0100, Peter Maydell wrote:
> > >> On 27 August 2015 at 13:17, Michael S. Tsirkin <mst@redhat.com> wrote:
> > >> > Basically the point is that ABI is extended to make
> > >> > ioeventfd with len = 0 mean "any length".
> > >> > 0 is thus not meaningless anymore.
> > >>
> > >> But how can you do adjustment for incorrect endianness
> > >> if you don't know the size of the data that you're
> > >> trying to work with? That's why this switch insists
> > >> that the size is 1, 2, 4 or 8.
> > 
> > > For kvm at least, "any length" implies "any data".
> > > So data is eventually discarded, we don't really need
> > > to adjust it for endian-ness.
> > 
> > I'm still confused. If you have data it needs to be
> > adjusted. If we're not actually doing anything with
> > the data why are we calling this function in the first
> > place?
> > 
> > -- PMM
> 
> I guess you could skip calls to adjust_endianness when len == 0,
> that should work just as well.
> 

adjust_endianness() is called from 4 different locations:
 - memory_region_dispatch_read()
 - memory_region_dispatch_write()
 - memory_region_add_eventfd()
 - memory_region_del_eventfd()

Since the issue was raised for the eventfd ones, it makes more sense to check
in the caller indeed... and to preserve other paths.

Cheers.

--
Greg

  reply	other threads:[~2015-08-27 13:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 10:04 [Qemu-devel] [PATCH 1/2] memory: allow zero size for adjust_endianness() Jason Wang
2015-08-26 10:04 ` [Qemu-devel] [PATCH 2/2] pci: test-dev: try to test fast mmio bus for wildcard mmio event Jason Wang
2015-08-27 10:28   ` Michael S. Tsirkin
2015-08-26 14:21 ` [Qemu-devel] [PATCH 1/2] memory: allow zero size for adjust_endianness() Peter Maydell
2015-08-26 14:51   ` Greg Kurz
2015-08-27  4:50     ` Jason Wang
2015-08-27 10:49       ` Peter Maydell
2015-08-27 10:53         ` Michael S. Tsirkin
2015-08-27 11:04           ` Peter Maydell
2015-08-27 11:08             ` Michael S. Tsirkin
2015-08-27 12:12               ` Peter Maydell
2015-08-27 12:17                 ` Michael S. Tsirkin
2015-08-27 12:20                   ` Peter Maydell
2015-08-27 12:25                     ` Michael S. Tsirkin
2015-08-27 12:27                       ` Peter Maydell
2015-08-27 12:30                         ` Michael S. Tsirkin
2015-08-27 13:10                           ` Greg Kurz [this message]
2015-08-28  2:23                             ` Jason Wang

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=20150827151032.3daebb92@bahia.local \
    --to=gkurz@linux.vnet.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@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 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).