> > 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.
I agree. Most of the uses of TARGET_PAGE_SIZE are simply an optimization - it's a convenient buffer size for DMA transfers. Other uses are probably incorrect. None of virtio.c, virtio-{blk,net,serial} or virtio-{pci,syborg} should know about CPU properties. Virtio-s390 might because it's implementing magic CPU instructions. Paul