|
From: | Hervé Poussineau |
Subject: | Re: [Qemu-devel] [PATCH 3/3] prep: improve Raven PCI host emulation |
Date: | Mon, 02 Sep 2013 22:26:27 +0200 |
User-agent: | Thunderbird 2.0.0.23 (Windows/20090812) |
Richard Henderson a écrit :
On 08/23/2013 11:52 AM, Hervé Poussineau wrote:+ uint8_t buf[4]; + uint64_t val; + + if (s->contiguous_map == 0) { + /* 64 KB contiguous space for IOs */ + addr &= 0xFFFF; + } else { + /* 8 MB non-contiguous space for IOs */ + addr = (addr & 0x1F) | ((addr & 0x007FFF000) >> 7); + } + + address_space_read(&s->pci_io_as, addr + 0x80000000, buf, size); + memcpy(&val, buf, size); + return val;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 is always little-endian). prep_io_ops endianness is DEVICE_LITTLE_ENDIAN, so, AFAIK, this means that returned val should be LE.
Why should it break on big-endian hosts? Regards, Hervé
[Prev in Thread] | Current Thread | [Next in Thread] |