From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGaix-0001qQ-Tl for qemu-devel@nongnu.org; Mon, 02 Sep 2013 16:27:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGaip-0001j9-GK for qemu-devel@nongnu.org; Mon, 02 Sep 2013 16:27:47 -0400 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]:35313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGaig-0001UJ-Rh for qemu-devel@nongnu.org; Mon, 02 Sep 2013 16:27:39 -0400 Message-ID: <5224F473.2060208@reactos.org> Date: Mon, 02 Sep 2013 22:26:27 +0200 From: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= MIME-Version: 1.0 References: <1377283973-9320-1-git-send-email-hpoussin@reactos.org> <1377283973-9320-4-git-send-email-hpoussin@reactos.org> <5217BE5F.5000708@twiddle.net> In-Reply-To: <5217BE5F.5000708@twiddle.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/3] prep: improve Raven PCI host emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , qemu-devel@nongnu.org Richard Henderson a =C3=A9crit : > On 08/23/2013 11:52 AM, Herv=C3=A9 Poussineau wrote: >> + uint8_t buf[4]; >> + uint64_t val; >> + >> + if (s->contiguous_map =3D=3D 0) { >> + /* 64 KB contiguous space for IOs */ >> + addr &=3D 0xFFFF; >> + } else { >> + /* 8 MB non-contiguous space for IOs */ >> + addr =3D (addr & 0x1F) | ((addr & 0x007FFF000) >> 7); >> + } >> + >> + address_space_read(&s->pci_io_as, addr + 0x80000000, buf, size); >> + memcpy(&val, buf, size); >> + return val; >=20 > This memcpy can't be right, especially for big-endian host. pci_io_as is supposed to contain words/longs in little-endian mode (PCI=20 is always little-endian). prep_io_ops endianness is DEVICE_LITTLE_ENDIAN, so, AFAIK, this means=20 that returned val should be LE. Why should it break on big-endian hosts? Regards, Herv=C3=A9