On 3/31/10, Paolo Bonzini <pbonz...@redhat.com> wrote: > On 03/26/2010 08:02 PM, Blue Swirl wrote: > > Comments, anyone? > > Sorry I'm late. > > I don't really like the changes introduced here, because they make > devices very very tied to the boards. Hopefully this could be changed > one day with qdev, and patches like this make this task more complicated.
The real solution is to insert a byte swapping bus where needed and also make devices use some kind of memory API which goes through any buses (including byte swapping buses) in between the device and memory. > One example is the openpic page size pointed out downthread. > > What about something like this (doesn't change all the places affected > by your series, compile-tested only)? In general (with vmport and maybe virtio as the only exceptions), the devices have no business knowing _any_ CPU properties, like page size or endianness. If there really was a device that really cared about CPU page size, the size should be also known by the board and should be passed down from there via qdev property. Byte swapping should be handled by the bus, bus controller or memory controller. Your patch does not move things to right direction, instead the byte swapping remains at the device, so I don't think the patch should be applied. Thank you for the comments.