From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uy4IL-0002QR-GP for qemu-devel@nongnu.org; Sat, 13 Jul 2013 14:11:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uy4IK-0006wD-8F for qemu-devel@nongnu.org; Sat, 13 Jul 2013 14:11:45 -0400 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]:54767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uy4IJ-0006vc-Li for qemu-devel@nongnu.org; Sat, 13 Jul 2013 14:11:44 -0400 Message-ID: <51E1984D.2090802@reactos.org> Date: Sat, 13 Jul 2013 20:11:25 +0200 From: =?ISO-8859-1?Q?Herv=E9_Poussineau?= MIME-Version: 1.0 References: <51C75FA6.6080903@reactos.org> <51C7E21A.9090005@web.de> <8A36D64D-0625-49E1-9E59-391DAEEBD1FC@suse.de> <51DEA91B.40903@suse.de> <51E16683.1040304@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [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 , qemu-devel , Alexander Graf , Jan Kiszka , Paolo Bonzini , =?ISO-8859-1?Q?Andreas_F=E4rbe?= =?ISO-8859-1?Q?r?= Anthony Liguori a =E9crit : > On Sat, Jul 13, 2013 at 9:38 AM, Paolo Bonzini wr= ote: >> Il 11/07/2013 14:46, Andreas F=E4rber ha scritto: >>> sPAPR has its MemoryRegion marked Little Endian: >>> >>> http://git.qemu.org/?p=3Dqemu.git;a=3Dblobdiff;f=3Dhw/spapr_pci.c;h=3D= a08ed11166595bdc493065beb64d4ce5b7b0dded;hp=3Dc2c3079d21d5be2647faf85a8c6= 08ac995d2ca62;hb=3Da3cfa18eb075c7ef78358ca1956fe7b01caa1724;hpb=3D286d52e= bfc0d0d53c2a878e454292fea14bad41b >>> >>> Possibly we can now apply Herv=E9's patches on top to remove that hac= k again? >> I can post a pull request with Herve's patch, if we agree that it's th= e >> right thing. >=20 > http://permalink.gmane.org/gmane.comp.emulators.qemu/221950 >=20 > Here's what's happening: >=20 > 1) MMIO request goes to sPAPR PIO area, the vCPU was in BE mode but by > the time the handler is called, the value is in host byte order. >=20 > 2) sPAPR (incorrectly) byte swaps by marking the region as little > endian (data is now garbage) >=20 > 3) The portio layer (incorrectly) byte swaps because it is marked as > little endian (data is now good) >=20 > 4) Dispatch happens to VGA device which (incorrectly) byte swaps > because it is marked as little endian (data is now bad) >=20 > (2), (3), and (4) are all wrong. By removing either (2) or (3) we can > "fix" the regression but that's just because two wrongs make a right > in this situation. >=20 > We should remove *all* of the LE markings from ISA devices, remove the > portio mark, and the sPAPR mark. That's the right fix. OK for that if that fixes sPAPR. Herv=E9