From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyFbG-00038Q-Fy for qemu-devel@nongnu.org; Sun, 14 Jul 2013 02:16:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyFbD-0000nd-4M for qemu-devel@nongnu.org; Sun, 14 Jul 2013 02:16:02 -0400 Received: from mail-ea0-x235.google.com ([2a00:1450:4013:c01::235]:56576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyFbC-0000nX-TK for qemu-devel@nongnu.org; Sun, 14 Jul 2013 02:15:59 -0400 Received: by mail-ea0-f181.google.com with SMTP id a15so7155574eae.26 for ; Sat, 13 Jul 2013 23:15:57 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51E24216.4050406@redhat.com> Date: Sun, 14 Jul 2013 08:15:50 +0200 From: Paolo Bonzini 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 Content-Transfer-Encoding: 7bit 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 , =?ISO-8859-1?Q?Herv=E9_Poussineau?= , Jan Kiszka , =?ISO-8859-1?Q?Andreas_F=E4rber?= Il 13/07/2013 17:22, Anthony Liguori ha scritto: > 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. > > 2) sPAPR (incorrectly) byte swaps by marking the region as little > endian (data is now garbage) > > 3) The portio layer (incorrectly) byte swaps because it is marked as > little endian (data is now good) > > 4) Dispatch happens to VGA device which (incorrectly) byte swaps > because it is marked as little endian (data is now bad) > > (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. > > We should remove *all* of the LE markings from ISA devices, remove the > portio mark, and the sPAPR mark. That's the right fix. So the bug here is that we have multiple levels of dispatch. Byte swapping in the dispatch level only works as long as every dispatch is merged, which is not the case. However, I do suspect that you have broken PREP again, because PREP has 1/3/4 but not 2. Removing (2) IIUC amounts to re-applying commit a178274efabcbbc5d44805b51def874e47051325, and I think that's a better fix. Also, what devices exactly would have a non-native byte order?!? I'm confused... Paolo