From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxm5W-0004Qr-HN for qemu-devel@nongnu.org; Fri, 12 Jul 2013 18:45:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uxm5V-0000MG-1k for qemu-devel@nongnu.org; Fri, 12 Jul 2013 18:45:18 -0400 Message-ID: <1373669098.19894.196.camel@pasglop> From: Benjamin Herrenschmidt Date: Sat, 13 Jul 2013 08:44:58 +1000 In-Reply-To: <878v1bvfaw.fsf@codemonkey.ws> References: <51C75FA6.6080903@reactos.org> <51C7E21A.9090005@web.de> <8A36D64D-0625-49E1-9E59-391DAEEBD1FC@suse.de> <51DEA91B.40903@suse.de> <3FAA7DE1-06A0-45C5-885C-0433BCC0CFE8@suse.de> <5D205309-1154-4730-902E-BF07F5D3B4EB@suse.de> <1373581960.19894.109.camel@pasglop> <02433CA4-954D-4C56-A4A4-7BC0D62638C0@suse.de> <1373628932.19894.158.camel@pasglop> <878v1bvfaw.fsf@codemonkey.ws> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 11/14] ioport: Switch dispatching to memory core layer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Liu Ping Fan , Jan Kiszka , Alexander Graf , qemu-devel Developers , "qemu-ppc@nongnu.org list:PowerPC" , Paolo Bonzini , Andreas =?ISO-8859-1?Q?F=E4rber?= , =?ISO-8859-1?Q?Herv=E9?= Poussineau On Fri, 2013-07-12 at 12:49 -0500, Anthony Liguori wrote: > > > Unless they are completely broken (and those exist, don't get me wrong, > > though mostly they are a thing of a past long gone), bridges and busses > > have no effect on endianness. > > That's simply not true. There are programmable PCI host bridges that > support byte swapping. Some allow this to be done on a per-device basis > too. Those bridges are utterly broken and the result of very sick HW design mind. I've encountered that sort of thing before and the only sane way to use them is to disable that shit. If a bridge swaps, it breaks byte order of non-register accesses (FIFO transfers, DMAs, ...) and hell breaks lose. Unless you confuse with the byte lane swapping that must occur when bridging a processor to a bus when the processor changes its bus byte order. IE. Some processors (generally older, people have grown clues since then) that can support dual endian operations had the bad habit of reversing the location of the low-address and high-address bytes on their bus (or rather didn't properly reverse LSB/MSB and thus requires bridges to do it). Such processors do require the bridge to swap the byte lanes when changing endianness. However I've been told that even ARM doesn't do that any more. In any case, even if you want to model a piece of crap like that, you shouldn't do so by calling the bus "big endian" or "little endian" but something like a byte lane swap attribute, which more precisely describes what the bridge is doing. This is not endianness. > > So I'm not sure what you guys are up to, but from what I read, it's > > wrong, and the fact at this stage is that your broke IO space (and thus > > virtio and VGA) on powerpc (including pseries). > > I'm not sure what this patch was trying to do but it was certainly > wrong. Right :-) Ben.