From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWKZ7-00052a-3M for qemu-devel@nongnu.org; Fri, 13 Mar 2015 04:03:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWKZ2-0003Iw-0b for qemu-devel@nongnu.org; Fri, 13 Mar 2015 04:03:29 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:53400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWKZ1-0003Ih-MI for qemu-devel@nongnu.org; Fri, 13 Mar 2015 04:03:23 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Mar 2015 08:03:21 -0000 Date: Fri, 13 Mar 2015 09:03:12 +0100 From: Greg Kurz Message-ID: <20150313090312.742d135c@bahia.local> In-Reply-To: <5501BDEB.5080603@redhat.com> References: <20150311180212.8119.14734.stgit@bahia.local> <20150311210322-mutt-send-email-mst@redhat.com> <20150311230314.08e51843@bahia.local> <20150312075922-mutt-send-email-mst@redhat.com> <5501BDEB.5080603@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-pci: fix host notifiers on bi-endian architectures List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Cedric Le Goater , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, "Michael S. Tsirkin" On Thu, 12 Mar 2015 17:25:15 +0100 Paolo Bonzini wrote: > > > On 12/03/2015 08:08, Michael S. Tsirkin wrote: > > But common header format is simple, it's always LE. > > It does not depend on target. > > To me this looks like a bug in memory_region_add_eventfd, > > it should do the right thing depending on device > > endian-ness. > > I agree it seems to be a QEMU bug. > > Paolo > Yes you're right ! QEMU swaps the virtqueue id (adjust_endianness) according to TARGET_WORDS, like it was coming from the guest but in fact it comes from the host. The id should be fixed according to HOST_WORDS instead. Of course this went unnoticed until TARGET_WORDS_BIGENDIAN != HOST_WORDS_BIGENDIAN, which we have now with ppc64le hosts. Patches to follow. Thanks. -- Greg