Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-22 Thread Jan Kiszka
On 2014-10-22 22:34, Benjamin Herrenschmidt wrote: > On Wed, 2014-10-22 at 16:17 +0200, Jan Kiszka wrote: >> I thought about this again, and I'm not sure anymore if we can use >> ACPI >> to "black-list" the incompatible virtio devices. Reason: hotplug. To >> my >> understanding, the ACPI DRHD table

Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-22 Thread Benjamin Herrenschmidt
On Wed, 2014-10-22 at 16:17 +0200, Jan Kiszka wrote: > I thought about this again, and I'm not sure anymore if we can use > ACPI > to "black-list" the incompatible virtio devices. Reason: hotplug. To > my > understanding, the ACPI DRHD tables won't change during runtime when a > device shows up or

[PATCH RFC v3 03/16] virtio: use u32, not bitmap for struct virtio_device's features

2014-10-22 Thread Michael S. Tsirkin
From: Rusty Russell It seemed like a good idea, but it's actually a pain when we get more than 32 feature bits. Just change it to a u32 for now. Cc: Brian Swetland Cc: Christian Borntraeger Signed-off-by: Rusty Russell Signed-off-by: Cornelia Huck Acked-by: Pawel Moll Acked-by: Ohad Ben-Co

[PATCH RFC v3 04/16] virtio: add support for 64 bit features.

2014-10-22 Thread Michael S. Tsirkin
From: Rusty Russell Change the u32 to a u64, and make sure to use 1ULL everywhere! Cc: Brian Swetland Cc: Christian Borntraeger [Thomas Huth: fix up virtio-ccw get_features] Signed-off-by: Rusty Russell Signed-off-by: Cornelia Huck Acked-by: Pawel Moll Acked-by: Ohad Ben-Cohen Signed-off-

[PATCH RFC v3 16/16] virtio_blk: fix types for in memory structures

2014-10-22 Thread Michael S. Tsirkin
Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/virtio_blk.h | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h index 9ad67b2..247c8ba 100644 --- a/include/uapi/linux/virtio_blk.h +++ b/inc

[PATCH RFC v3 11/16] virtio_blk: use virtio v1.0 endian

2014-10-22 Thread Michael S. Tsirkin
From: Cornelia Huck Note that we care only about the fields still in use for virtio v1.0. Reviewed-by: Thomas Huth Reviewed-by: David Hildenbrand Signed-off-by: Cornelia Huck Signed-off-by: Michael S. Tsirkin --- drivers/block/virtio_blk.c | 4 1 file changed, 4 insertions(+) diff --

[PATCH RFC v3 15/16] virtio_net: fix types for in memory structures

2014-10-22 Thread Michael S. Tsirkin
Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/virtio_net.h | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index 172a7f0..b5f1677 100644 --- a/include/uapi/linux/virtio_net.h +++ b/inc

[PATCH RFC v3 10/16] virtio_net: use v1.0 endian.

2014-10-22 Thread Michael S. Tsirkin
From: Rusty Russell [Cornelia Huck: converted some missed fields] Signed-off-by: Rusty Russell Signed-off-by: Cornelia Huck Signed-off-by: Michael S. Tsirkin --- drivers/net/virtio_net.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/dri

[PATCH RFC v3 07/16] virtio_config: endian conversion for v1.0

2014-10-22 Thread Michael S. Tsirkin
We (ab)use virtio conversion functions for device-specific config space accesses. Reviewed-by: David Hildenbrand Signed-off-by: Rusty Russell Signed-off-by: Cornelia Huck Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 9 ++--- 1 file changed, 6 insertions(+), 3 dele

[PATCH RFC v3 09/16] virtio: set FEATURES_OK

2014-10-22 Thread Michael S. Tsirkin
set FEATURES_OK as per virtio 1.0 spec Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/virtio_config.h | 2 ++ drivers/virtio/virtio.c| 29 ++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/include/uapi/linux/virtio_config.h b/in

[PATCH RFC v3 01/16] virtio: memory access APIs

2014-10-22 Thread Michael S. Tsirkin
virtio 1.0 makes all memory structures LE, so we need APIs to conditionally do a byteswap on BE architectures. To make it easier to check code statically, add virtio specific types for multi-byte integers in memory. Add low level wrappers that do a byteswap conditionally, these will be useful e.g

[PATCH RFC v3 08/16] virtio: allow transports to get avail/used addresses

2014-10-22 Thread Michael S. Tsirkin
From: Cornelia Huck For virtio-1, we can theoretically have a more complex virtqueue layout with avail and used buffers not on a contiguous memory area with the descriptor table. For now, it's fine for a transport driver to stay with the old layout: It needs, however, a way to access the location

[PATCH RFC v3 06/16] virtio: make endian-ness depend on virtio 1.0

2014-10-22 Thread Michael S. Tsirkin
virtio 1.0 is LE, virtio without 1.0 is native endian. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7d46280..be0f6dd 100644 --- a/inc

[PATCH RFC v3 05/16] virtio: add virtio 1.0 feature bit

2014-10-22 Thread Michael S. Tsirkin
Based on original patches by Rusty Russell, Thomas Huth and Cornelia Huck. Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/virtio_config.h | 7 +-- drivers/virtio/virtio_ring.c | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/virtio_con

[PATCH RFC v3 02/16] virtio_ring: switch to new memory access APIs

2014-10-22 Thread Michael S. Tsirkin
Use virtioXX_to_cpu and friends for access to all multibyte structures in memory. Note: this is intentionally mechanical. A follow-up patch will split long lines etc. Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_ring.c | 89 ++-- 1 file cha

Re: [PATCH RFC v2 01/16] virtio: memory access APIs

2014-10-22 Thread Michael S. Tsirkin
On Wed, Oct 22, 2014 at 01:45:55PM -0400, Christopher Covington wrote: > Hi Michael, > > On 10/22/2014 11:50 AM, Michael S. Tsirkin wrote: > > virtio 1.0 makes all memory structures LE, so > > we need APIs to conditionally do a byteswap on BE > > architectures. > > > > To make it easier to check

Re: [PATCH RFC v2 01/16] virtio: memory access APIs

2014-10-22 Thread Christopher Covington
Hi Michael, On 10/22/2014 11:50 AM, Michael S. Tsirkin wrote: > virtio 1.0 makes all memory structures LE, so > we need APIs to conditionally do a byteswap on BE > architectures. > > To make it easier to check code statically, > add virtio specific types for multi-byte integers > in memory. > >

[PATCH RFC v2 16/16] virtio_blk: fix types for in memory structures

2014-10-22 Thread Michael S. Tsirkin
Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/virtio_blk.h | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h index 9ad67b2..247c8ba 100644 --- a/include/uapi/linux/virtio_blk.h +++ b/inc

[PATCH RFC v2 15/16] virtio_net: fix types for in memory structures

2014-10-22 Thread Michael S. Tsirkin
Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/virtio_net.h | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index 172a7f0..b5f1677 100644 --- a/include/uapi/linux/virtio_net.h +++ b/inc

[PATCH RFC v2 11/16] virtio_blk: use virtio v1.0 endian

2014-10-22 Thread Michael S. Tsirkin
From: Cornelia Huck Note that we care only about the fields still in use for virtio v1.0. Reviewed-by: Thomas Huth Reviewed-by: David Hildenbrand Signed-off-by: Cornelia Huck Signed-off-by: Michael S. Tsirkin --- drivers/block/virtio_blk.c | 4 1 file changed, 4 insertions(+) diff --

[PATCH RFC v2 03/16] virtio: use u32, not bitmap for struct virtio_device's features

2014-10-22 Thread Michael S. Tsirkin
From: Rusty Russell It seemed like a good idea, but it's actually a pain when we get more than 32 feature bits. Just change it to a u32 for now. Cc: Brian Swetland Cc: Christian Borntraeger Signed-off-by: Rusty Russell Signed-off-by: Cornelia Huck Acked-by: Pawel Moll Acked-by: Ohad Ben-Co

[PATCH RFC v2 04/16] virtio: add support for 64 bit features.

2014-10-22 Thread Michael S. Tsirkin
From: Rusty Russell Change the u32 to a u64, and make sure to use 1ULL everywhere! Cc: Brian Swetland Cc: Christian Borntraeger [Thomas Huth: fix up virtio-ccw get_features] Signed-off-by: Rusty Russell Signed-off-by: Cornelia Huck Acked-by: Pawel Moll Acked-by: Ohad Ben-Cohen Signed-off-

[PATCH RFC v2 08/16] virtio: allow transports to get avail/used addresses

2014-10-22 Thread Michael S. Tsirkin
From: Cornelia Huck For virtio-1, we can theoretically have a more complex virtqueue layout with avail and used buffers not on a contiguous memory area with the descriptor table. For now, it's fine for a transport driver to stay with the old layout: It needs, however, a way to access the location

[PATCH RFC v2 10/16] virtio_net: use v1.0 endian.

2014-10-22 Thread Michael S. Tsirkin
From: Rusty Russell [Cornelia Huck: converted some missed fields] Signed-off-by: Rusty Russell Signed-off-by: Cornelia Huck Signed-off-by: Michael S. Tsirkin --- drivers/net/virtio_net.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/dri

[PATCH RFC v2 01/16] virtio: memory access APIs

2014-10-22 Thread Michael S. Tsirkin
virtio 1.0 makes all memory structures LE, so we need APIs to conditionally do a byteswap on BE architectures. To make it easier to check code statically, add virtio specific types for multi-byte integers in memory. Add low level wrappers that do a byteswap conditionally, these will be useful e.g

[PATCH RFC v2 09/16] virtio: set FEATURES_OK

2014-10-22 Thread Michael S. Tsirkin
set FEATURES_OK as per virtio 1.0 spec Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/virtio_config.h | 2 ++ drivers/virtio/virtio.c| 29 ++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/include/uapi/linux/virtio_config.h b/in

[PATCH RFC v2 07/16] virtio_config: endian conversion for v1.0

2014-10-22 Thread Michael S. Tsirkin
We (ab)use virtio conversion functions for device-specific config space accesses. Reviewed-by: David Hildenbrand Signed-off-by: Rusty Russell Signed-off-by: Cornelia Huck Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 9 ++--- 1 file changed, 6 insertions(+), 3 dele

[PATCH RFC v2 06/16] virtio: make endian-ness depend on virtio 1.0

2014-10-22 Thread Michael S. Tsirkin
virtio 1.0 is LE, virtio without 1.0 is native endian. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7d46280..be0f6dd 100644 --- a/inc

[PATCH RFC v2 05/16] virtio: add virtio 1.0 feature bit

2014-10-22 Thread Michael S. Tsirkin
Based on original patches by Rusty Russell, Thomas Huth and Cornelia Huck. Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/virtio_config.h | 7 +-- drivers/virtio/virtio_ring.c | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/virtio_con

[PATCH RFC v2 02/16] virtio_ring: switch to new memory access APIs

2014-10-22 Thread Michael S. Tsirkin
Use virtioXX_to_cpu and friends for access to all multibyte structures in memory. Note: this is intentionally mechanical. A follow-up patch will split long lines etc. Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_ring.c | 89 ++-- 1 file cha

Re: IPv6 UFO for VMs

2014-10-22 Thread Hannes Frederic Sowa
On Mi, 2014-10-22 at 00:44 +0100, Ben Hutchings wrote: > There are several ways that VMs can take advantage of UFO and get the > host to do fragmentation for them: > > drivers/net/macvtap.c: gso_type = SKB_GSO_UDP; > drivers/net/tun.c: skb_shinfo(skb)->gso_typ

Re: [PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.

2014-10-22 Thread Michael S. Tsirkin
On Wed, Oct 22, 2014 at 04:28:34PM +0200, Cornelia Huck wrote: > On Wed, 22 Oct 2014 17:02:26 +0300 > "Michael S. Tsirkin" wrote: > > > On Tue, Oct 07, 2014 at 04:39:45PM +0200, Cornelia Huck wrote: > > > From: Rusty Russell > > > > > > [Cornelia Huck: we don't need the vq->vring.num -> vq->rin

Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-22 Thread Michael S. Tsirkin
On Wed, Oct 22, 2014 at 04:17:40PM +0200, Jan Kiszka wrote: > On 2014-10-22 10:44, Michael S. Tsirkin wrote: > > On Wed, Oct 08, 2014 at 11:04:28AM +0200, Cornelia Huck wrote: > >> On Tue, 07 Oct 2014 18:24:22 -0700 > >> Andy Lutomirski wrote: > >> > >>> On 10/07/2014 07:39 AM, Cornelia Huck wrote

Re: [PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.

2014-10-22 Thread Cornelia Huck
On Wed, 22 Oct 2014 17:02:26 +0300 "Michael S. Tsirkin" wrote: > On Tue, Oct 07, 2014 at 04:39:45PM +0200, Cornelia Huck wrote: > > From: Rusty Russell > > > > [Cornelia Huck: we don't need the vq->vring.num -> vq->ring_mask change] > > Signed-off-by: Rusty Russell > > Signed-off-by: Cornelia

Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-22 Thread Jan Kiszka
On 2014-10-22 10:44, Michael S. Tsirkin wrote: > On Wed, Oct 08, 2014 at 11:04:28AM +0200, Cornelia Huck wrote: >> On Tue, 07 Oct 2014 18:24:22 -0700 >> Andy Lutomirski wrote: >> >>> On 10/07/2014 07:39 AM, Cornelia Huck wrote: This patchset aims to get us some way to implement virtio-1 compl

Re: [PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.

2014-10-22 Thread Michael S. Tsirkin
On Tue, Oct 07, 2014 at 04:39:45PM +0200, Cornelia Huck wrote: > From: Rusty Russell > > [Cornelia Huck: we don't need the vq->vring.num -> vq->ring_mask change] > Signed-off-by: Rusty Russell > Signed-off-by: Cornelia Huck > --- > drivers/virtio/virtio_ring.c | 195 > +++

Re: [Qemu-devel] [PATCH RFC 03/11] virtio: endianess conversion helpers

2014-10-22 Thread Michael S. Tsirkin
On Tue, Oct 07, 2014 at 04:39:44PM +0200, Cornelia Huck wrote: > Provide helper functions that convert from/to LE for virtio devices that > are not operating in legacy mode. We check for the VERSION_1 feature bit > to determine that. > > Based on original patches by Rusty Russell and Thomas Huth.

Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-22 Thread Michael S. Tsirkin
On Wed, Oct 08, 2014 at 11:04:28AM +0200, Cornelia Huck wrote: > On Tue, 07 Oct 2014 18:24:22 -0700 > Andy Lutomirski wrote: > > > On 10/07/2014 07:39 AM, Cornelia Huck wrote: > > > This patchset aims to get us some way to implement virtio-1 compliant > > > and transitional devices in qemu. Branc

Re: [PATCH RFC] virtio 1.0 vring endian-ness

2014-10-22 Thread Michael S. Tsirkin
On Wed, Oct 22, 2014 at 10:24:17AM +0200, Cornelia Huck wrote: > On Wed, 22 Oct 2014 01:09:40 +0300 > "Michael S. Tsirkin" wrote: > > > This adds wrappers to switch between native endian-ness > > (virtio 0.9) and virtio endian-ness (virtio 1.0). > > Add new typedefs as well, so that we can check

Re: [PATCH RFC] virtio 1.0 vring endian-ness

2014-10-22 Thread Cornelia Huck
On Wed, 22 Oct 2014 01:09:40 +0300 "Michael S. Tsirkin" wrote: > This adds wrappers to switch between native endian-ness > (virtio 0.9) and virtio endian-ness (virtio 1.0). > Add new typedefs as well, so that we can check > statically that we didn't miss any accesses. > All callers simply pass in