[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: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio |
Date: |
Fri, 26 Nov 2010 23:18:21 +0000 |
On 26 November 2010 23:00, Andreas Färber <address@hidden> wrote:
> Am 25.11.2010 um 08:35 schrieb Alexander Graf:
>> + switch (endian) {
>> + case DEVICE_BIG_ENDIAN:
>> +#ifndef TARGET_WORDS_BIGENDIAN
>> + swapendian_init(io_index);
>> +#endif
>> + break;
>
> So basically, you just moved the #ifdefs to another place. :) Shouldn't this
> be dependent on the CPU state and determined at runtime? Thinking of MSR LE
> bit on ppc. I guess QEMU doesn't support bi-endian ppc today, as does the
> 970, but it would be nice to keep it in mind.
I was wondering about that (ARM actually has two different 'big endian'
modes, one of which is byte-invariant and one of which is word-invariant,
and which are runtime selectable on at least some cores...) But
I think I agree with Paul Brook that endianness as we're considering it
here is really kind of a bus level property, and TARGET_WORDS_BIGENDIAN
is defining a sort of "system bus endianness". Runtime flippable cores
do the swapping in generated code before they get out to this bit, which
corresponds to how the hardware does it (things get swapped before they
get out to the signals external to the core).
That does mean that in some cases you end up doing a double byteswap,
but my guess would be that the slowdown on doing that for device access
is completely buried by the slowdown on having to do that for RAM access,
so it's not worth worrying about.
-- PMM
- [Qemu-devel] [PATCH 00/15] [RFC] MMIO endianness cleanup, Alexander Graf, 2010/11/25
- [Qemu-devel] [PATCH 04/15] dbdma: Make little endian, Alexander Graf, 2010/11/25
- [Qemu-devel] [PATCH 03/15] Make simple io mem handler endian aware, Alexander Graf, 2010/11/25
- [Qemu-devel] [PATCH 06/15] uninorth: Get rid of bswap, Alexander Graf, 2010/11/25
- [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, Gleb Natapov, 2010/11/28
[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