Message ID | cover.1566829168.git.tony.nguyen@bt.com |
---|---|
Headers | show |
Series | Declare device little or big endian | expand |
On 8/26/19 4:21 PM, Tony Nguyen wrote: > This series is an attempt to re-declare devices with DEVICE_NATIVE_ENDIAN as > DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN. > > This clean up was split out from an earlier series which collapsed byte swaps > along the I/O path. > > On Wed, 7 Aug 2019 at 12:42, Paolo Bonzini wrote: >> On 07/08/19 10:31, tony.nguyen@bt wrote: >>> >>> Device realizing code with MemorRegionOps endianness as >>> DEVICE_NATIVE_ENDIAN is not common code. >>> >>> Corrected devices were identified by making the declaration of >>> DEVICE_NATIVE_ENDIAN conditional upon NEED_CPU_H and then listing >>> what failed to compile. >> >> The general approach makes sense. However, most of these should not be >> DEVICE_NATIVE_ENDIAN. I can help with some of them. > > On Fri, 16 Aug 2019 at 13:02, Peter Maydell wrote: >> OTOH it's worth noting that it's quite likely that most of >> the implementations of these DEVICE_NATIVE_ENDIAN devices >> picked it in an equally naive way, by just copying some other >> device's code... > > Approach this in two steps. > > 1. Naively. For each device declared with DEVICE_NATIVE_ENDIAN, find the set of > targets from the set of target/hw/*/device.o. > > If the set of targets are all little or all big endian, re-declare > as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. > > 2. Manually. Inspect with heuristics (thanks Paolo): > - if not used, re-declare as DEVICE_HOST_ENDIAN. > - if max/min size=1, re-declare as DEVICE_HOST_ENDIAN. > - if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN > - if PCI, re-declare as DEVICE_LITTLE_ENDIAN. > - if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN. > - if for SPARC only, re-declare as DEVICE_BIG_ENDIAN. Maybe this list is better to split your patches. Which are the 'not used' ones? TYPE_TPCI200 (from IndustryPack) can go with PCI. You can put all the PrimeCell devices together (eventually with the other ARM devices): hw/audio/pl041.c hw/char/pl011.c hw/display/pl110.c hw/dma/pl080.c hw/dma/pl330.c hw/gpio/pl061.c hw/input/pl050.c hw/intc/pl190.c hw/sd/pl181.c hw/ssi/pl022.c hw/timer/pl031.c