From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rkm77-0000U9-H2 for qemu-devel@nongnu.org; Tue, 10 Jan 2012 19:32:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rkm76-0002hy-AT for qemu-devel@nongnu.org; Tue, 10 Jan 2012 19:32:25 -0500 Message-ID: <1326241935.23910.79.camel@pasglop> From: Benjamin Herrenschmidt Date: Wed, 11 Jan 2012 11:32:15 +1100 In-Reply-To: <60A0E6EF-8B22-4340-9EB1-88AE10D32B68@suse.de> References: <1326240442-22915-1-git-send-email-agraf@suse.de> <4F0CD2C2.6040909@codemonkey.ws> <60A0E6EF-8B22-4340-9EB1-88AE10D32B68@suse.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] virtio-pci: Fix endianness of virtio config List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-ppc@nongnu.org, "qemu-devel@nongnu.org Developers" On Wed, 2012-01-11 at 01:08 +0100, Alexander Graf wrote: > On 11.01.2012, at 01:07, Anthony Liguori wrote: > > > On 01/10/2012 06:07 PM, Alexander Graf wrote: > >> From: Benjamin Herrenschmidt > >> > >> The virtio config area in PIO space is a bit special. The initial > >> header is little endian but the rest (device specific) is guest > >> native endian. > >> > >> The PIO accessors for PCI on machines that don't have native IO ports > >> assume that all PIO is little endian, which works fine for everything > >> except the above. > >> > >> A complicated way to fix it would be to split the BAR into two memory > >> regions with different endianess settings, but this isn't practical > >> to do, besides, the PIO code doesn't honor region endianness anyway > >> (I have a patch for that too but it isn't necessary at this stage). > >> > >> So I decided to go for the quick fix instead which consists of > >> reverting the swap in virtio-pci in selected places, hoping that when > >> we eventually do a "v2" of the virtio protocols, we sort that out once > >> and for all using a fixed endian setting for everything. > >> > >> Unfortunately, that mean moving virtio-pci from Makefile.objs to > >> Makefile.target so we can use TARGET_WORDS_BIGENDIAN which would > >> otherwise be poisoned. > >> > >> Signed-off-by: Benjamin Herrenschmidt > >> Signed-off-by: Alexander Graf > >> [agraf: keep virtio in libhw and determine endianness through a > >> helper function in exec.c] > > > > Both: > > > > Reviewed-by: Anthony Liguori > > Cool :). Queued up in ppc-next. Fix the commit log, you aren't moving it to Makefile.target anymore :-) Cheers, Ben.