Alexander Graf <ag...@suse.de> writes: > On 02/18/2014 05:17 PM, Cornelia Huck wrote: >> Hm. So whatever_le for 1.0 devices, and virtio_whatever (checking the >> byteswap value) for legacy devices? The device implementation will be >> aware of the virtio version anyway. > > Yeah, but I would hope we want to share as much code as possible here, > so that config accessors can be shared between legacy virtio and 1.0 > virtio. And in that case we want to have a generic helper to read/write > pieces of that config space - which this patch introduces for us :). > >> (Btw., can some of those architectures supporting both le/be run with >> mixed le/be cpus? That would be a mess for legacy devices.) > > Yes, they can. No, we don't care :).
There's per-cpu (what endian) and per-device (legacy or no). To do this Right, we'd need to consult both, but we don't always have that information. So this the minimal viable solution. We'll need a per-device legacy flag eventually (there are other changes than just endian). But getting the wrappers in place is a good first step. Cheers, Rusty.