From patchwork Mon Apr 7 20:40:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 337532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0011E140098 for ; Tue, 8 Apr 2014 06:42:27 +1000 (EST) Received: from localhost ([::1]:36655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXGN7-0001hl-PK for incoming@patchwork.ozlabs.org; Mon, 07 Apr 2014 16:42:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXGMM-00019R-8u for qemu-devel@nongnu.org; Mon, 07 Apr 2014 16:41:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXGMG-0002EC-01 for qemu-devel@nongnu.org; Mon, 07 Apr 2014 16:41:38 -0400 Received: from mout.web.de ([212.227.17.11]:61423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXGM2-0002D1-G6; Mon, 07 Apr 2014 16:41:18 -0400 Received: from envy.site ([84.148.57.50]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0MAvGa-1WhByi17fY-009uZh; Mon, 07 Apr 2014 22:40:44 +0200 Message-ID: <53430D4A.7070308@web.de> Date: Mon, 07 Apr 2014 22:40:42 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= , Alexander Graf References: <1395272166-687-1-git-send-email-andreas.faerber@web.de> <1395272166-687-3-git-send-email-andreas.faerber@web.de> <53402437.7030400@web.de> <53406704.7060705@reactos.org> <5342FD5B.1020203@web.de> In-Reply-To: <5342FD5B.1020203@web.de> X-Provags-ID: V03:K0:eEs/hDvNckrd/fEyUKJVivtfGGrlO3ZiKY6v6d+7UPMjacHQ/3O 6sSYdi1FoY6ZHifAPSVY3afrLLJ2fKEt7cc8YlUcCcCNbAMoitPkD1H3iRq5PaYeZbyVKDx Je5+vxI0fFzCsz4yWndGm3hK2iJCRXaTfx190UQTZAxdLdoUNJH//AHVyx3ewk9/tjKCWNy AfjQoceLd4AWahjcLiEtA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.11 Cc: Peter Maydell , Bruce Rogers , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Paolo Bonzini Subject: Re: [Qemu-devel] [PULL for-2.0 2/7] raven: Implement non-contiguous I/O region X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Am 07.04.2014 21:32, schrieb Andreas Färber: > Am 05.04.2014 22:26, schrieb Hervé Poussineau: >> Hi Andreas, >> >> Le sam. 05 avril 2014 17:41:43 CEST, Andreas Färber a écrit : >>> Hi Hervé, >>> >>> Am 20.03.2014 00:36, schrieb Andreas Färber: >>>> From: Hervé Poussineau >>>> >>>> Remove now duplicated code from prep board. >>>> >>>> Signed-off-by: Hervé Poussineau >>>> Signed-off-by: Andreas Färber >>>> --- >>>> hw/pci-host/prep.c | 85 >>>> ++++++++++++++++++++++++++++++++++++++++++++++++ >>>> hw/ppc/prep.c | 94 >>>> ++---------------------------------------------------- >>>> 2 files changed, 88 insertions(+), 91 deletions(-) >>> >>> I'm facing endianness-test failures in -rc1 on both openSUSE ppc/ppc64 >>> and OSX ppc64 (below) as well as "broken pipe" on OSX ppc. >>> >>> $ make check-qtest-ppc V=1 >>> [...] >>> /ppc/endianness/prep: ** >>> ERROR:/Users/andreas/QEMU/tests/endianness-test.c:131:test_endianness: >>> assertion failed (isa_inw(test, 0xe2) == 0x8765): (0x00004321 == >>> 0x00008765) >>> FAIL >>> [...] >>> /ppc/endianness/split/prep: ** >>> ERROR:/Users/andreas/QEMU/tests/endianness-test.c:206:test_endianness_split: >>> >>> assertion failed (isa_inw(test, 0xe2) == 0x8765): (0x00004321 == >>> 0x00008765) >>> FAIL >>> [...] >>> /ppc/endianness/combine/prep: ** >>> ERROR:/Users/andreas/QEMU/tests/endianness-test.c:253:test_endianness_combine: >>> >>> assertion failed (isa_inw(test, 0xea) == 0x8765): (0x00004321 == >>> 0x00008765) >>> FAIL >>> [...] >>> FAIL: tests/endianness-test >>> >>> On x86 everything is fine. git-bisect points to this commit. >>> >>> There is one "FIXME: handle endianness switch" in here, but I don't spot >>> such code where it's being moved from either. >>> >>> My suspect is the cpu_inw() -> ldl_p() change, but I'm unsure whether >>> the code or the test is wrong... >> >> Code removed in this commit was using DEVICE_NATIVE_ENDIAN, and then >> using cpu_inl, which does a ldl_p. >> Code added in this commit is using DEVICE_LITTLE_ENDIAN, and then is >> using ldl_p. >> So, yes, it seems that endianness of memory region does change things. >> Native endian means native endian of the guest of of the host? >> >> I also checked tests/endianness-test.c. >> The failing test is: >> isa_outl(test, 0xe0, 0x87654321); >> g_assert_cmphex(isa_inl(test, 0xe0), ==, 0x87654321); >> g_assert_cmphex(isa_inw(test, 0xe2), ==, 0x8765); >> g_assert_cmphex(isa_inw(test, 0xe0), ==, 0x4321); >> which seems perfectly valid as ISA is little-endian. >> >> However, PReP is marked as bswap= true in this file, which means that >> values are inverted before writing and after reading them. > > I tested .bswap = false - that fixes ppc64 host but breaks x86_64 host. Same results for the following patch (x86_64 broken, ppc64 fixed): Andreas diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index d3e746c..fd3956f 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -177,7 +177,7 @@ static void raven_io_write(void *opaque, hwaddr addr, static const MemoryRegionOps raven_io_ops = { .read = raven_io_read, .write = raven_io_write, - .endianness = DEVICE_LITTLE_ENDIAN, + .endianness = DEVICE_NATIVE_ENDIAN, .impl.max_access_size = 4, .valid.unaligned = true, };