From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hollis Blanchard Date: Thu, 13 Mar 2008 02:59:16 +0000 Subject: Re: [kvm-ppc-devel] [Qemu-devel] Re: [PATCH] e1000: fix endianness Message-Id: <1205377156.9736.41.camel@basalt> List-Id: References: <1204910632.2876.12.camel@basalt> <20080308135946.GA7387@hall.aurel32.net> <1204996128.5742.21.camel@basalt> <20080311224925.GA8753@volta.aurel32.net> <1205329920.16914.20.camel@diesel> <20080312143855.GA10824@hall.aurel32.net> <20080312220755.GA12033@volta.aurel32.net> In-Reply-To: <20080312220755.GA12033@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Aurelien Jarno Cc: kvm-ppc-devel , qemu-devel@nongnu.org On Wed, 2008-03-12 at 23:07 +0100, Aurelien Jarno wrote: > > We finally found the problem with rtl8139 emulation. The byteswapping > depending on the target was not done for all registers. The 8139too > driver was able to cope with that, but not the 8139cp. In his patch > Hollis addressed the issue by byteswapping accesses to all registers, > but depending the host endianness (cpu_to_ and _to_cpu functions) > instead of the target endianness. This was working correctly in his > case, as he tested it on both big endian target and hosts. > > Byte swapping does not depend on host endianness nor target endianness > but on the path from the CPU to the device, which is currently and > *wrongly* implemented in Qemu as a byteswap on big endian targets. > This > has to be fixed by providing a layer modeling the endianness. It has > to > maintain a bus network/tree, so it can invert the endianness of all > the > devices behind a PCI host controller or a PCI bridge. It also has to > be > dynamic, as some chipsets (e.g. gt64xxx) have a configurable bit that > can be changed at runtime to control the endianness. > > Before it is implemented correctly, please find attached two patches > to > fix the rtl8139 and e1000 emulations on big endian hosts and big > endian > targets, using the current and *wrong* Qemu implementation with regard > to endianness. Hopefully that works as all the systems we support > happen > to do the same thing. Thanks for pursuing this Aurelien. Although patches that replace cpu_to_* with TARGET_WORDS_BIGENDIAN usage make me cringe, these patches do indeed seem to fix BE/BE host/target behavior right now. -- Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ kvm-ppc-devel mailing list kvm-ppc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel