Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-06 Thread Jason Wang
On 2020/8/6 下午1:58, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 11:37:38AM +0800, Jason Wang wrote: On 2020/8/5 下午7:45, Michael S. Tsirkin wrote: #define virtio_cread(vdev, structname, member, ptr) \ do {

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-05 Thread Michael S. Tsirkin
On Thu, Aug 06, 2020 at 11:37:38AM +0800, Jason Wang wrote: > > On 2020/8/5 下午7:45, Michael S. Tsirkin wrote: > > > >#define virtio_cread(vdev, structname, member, ptr) > > > > \ > > > > do { > > > > \ > > >

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-05 Thread Jason Wang
On 2020/8/5 下午7:45, Michael S. Tsirkin wrote: #define virtio_cread(vdev, structname, member, ptr) \ do {\ might_sleep(); \ /* Must

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-05 Thread Michael S. Tsirkin
On Wed, Aug 05, 2020 at 02:28:23PM +0800, Jason Wang wrote: > > On 2020/8/4 上午4:58, Michael S. Tsirkin wrote: > > Currently all config space fields are of the type __uXX. > > This confuses people and some drivers (notably vdpa) > > access them using CPU endian-ness - which only > > works well for

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-05 Thread Jason Wang
On 2020/8/4 上午4:58, Michael S. Tsirkin wrote: Currently all config space fields are of the type __uXX. This confuses people and some drivers (notably vdpa) access them using CPU endian-ness - which only works well for legacy or LE platforms. Update virtio_cread/virtio_cwrite macros to allow

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-04 Thread Michael S. Tsirkin
On Tue, Aug 04, 2020 at 04:23:40PM +0200, Cornelia Huck wrote: > On Mon, 3 Aug 2020 16:58:46 -0400 > "Michael S. Tsirkin" wrote: > > > Currently all config space fields are of the type __uXX. > > This confuses people and some drivers (notably vdpa) > > access them using CPU endian-ness - which

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-04 Thread Cornelia Huck
On Mon, 3 Aug 2020 16:58:46 -0400 "Michael S. Tsirkin" wrote: > Currently all config space fields are of the type __uXX. > This confuses people and some drivers (notably vdpa) > access them using CPU endian-ness - which only > works well for legacy or LE platforms. > > Update

[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-03 Thread Michael S. Tsirkin
Currently all config space fields are of the type __uXX. This confuses people and some drivers (notably vdpa) access them using CPU endian-ness - which only works well for legacy or LE platforms. Update virtio_cread/virtio_cwrite macros to allow __virtioXX and __leXX field types. Follow-up