[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio
From: |
Alexander Graf |
Subject: |
Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio |
Date: |
Sun, 28 Nov 2010 12:05:29 +0100 |
On 28.11.2010, at 09:12, Gleb Natapov wrote:
> On Thu, Nov 25, 2010 at 08:35:41AM +0100, Alexander Graf wrote:
>> The way we're currently modeling mmio is too simplified. We assume that
>> every device has the same endianness as the target CPU. In reality,
>> most devices are little endian (all PCI and ISA ones I'm aware of). Some
>> are big endian (special system devices) and a very little fraction is
>> target native endian (fw_cfg).
>>
> As far as I can see fw_cfg calls cpu_to_le() on some of entries and
> doesn't on others. Doesn't this makes it "mixed endian" (aka broken)?
There are two layers of brokenness:
1) MMIO
2) Internal structures
A device that assumes native target endianness for its own MMIO is usually
broken. Devices don't know which CPU they're plugged to (unless built inside of
course) :).
That specific issue is that fw_cfg_mem_writew directly takes the selector as is
and both openbios and seabios expect it to accept values in native endianness.
The way forward to fix this is probably to declare the selector as little
endian and just commit a new version of openbios.
Its internal structures are a different story. If the interface spec of fw_cfg
(basically the .c file atm) defines some values to be a different endianness
from the other, that might be acceptable. It's still unpretty though. I'd way
prefer to see everything aligned to a single endianness.
Alex
- [Qemu-devel] [PATCH 07/15] e1000: Make little endian, (continued)
- [Qemu-devel] [PATCH 07/15] e1000: Make little endian, Alexander Graf, 2010/11/25
- [Qemu-devel] [PATCH 12/15] rtl8139: Declare as little endian, Alexander Graf, 2010/11/25
- [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Alexander Graf, 2010/11/25
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Andreas Färber, 2010/11/26
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Alexander Graf, 2010/11/26
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Peter Maydell, 2010/11/26
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Paul Brook, 2010/11/26
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Blue Swirl, 2010/11/27
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Paul Brook, 2010/11/27
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Gleb Natapov, 2010/11/28
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio,
Alexander Graf <=
[Qemu-devel] [PATCH 05/15] pci-host: Delegate bswap to mmio layer, Alexander Graf, 2010/11/25
[Qemu-devel] [PATCH 13/15] heathrow_pic: Declare as little endian, Alexander Graf, 2010/11/25
[Qemu-devel] [PATCH 11/15] openpic: Replace explicit byte swap with endian hints, Alexander Graf, 2010/11/25
[Qemu-devel] [PATCH 15/15] usb_ohci: Always use little endian, Alexander Graf, 2010/11/25
[Qemu-devel] [PATCH 08/15] prep: Declare as little endian, Alexander Graf, 2010/11/25
[Qemu-devel] [PATCH 10/15] ppc4xx_pci: Declare as little endian, Alexander Graf, 2010/11/25
[Qemu-devel] [PATCH 09/15] versatile_pci: Declare as little endian, Alexander Graf, 2010/11/25