Re: [PATCH 9/9] virtio_pci: update file descriptions and copyright

2014-12-15 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: There's been a lot of changes since 2007. List main authors, add Red Hat copyright. Acked-by: Rusty Russell ru...@rustcorp.com.au Cheers, Rusty. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/virtio/virtio_pci.h| 5 -

[PATCH 0/3] fix up vringh/mic sparse errors

2014-12-15 Thread Michael S. Tsirkin
This fixes remaining sparse warnings in vringh and mic by using virtio 1.0 compliant wrappers. This also needs by get_user patches to avoid getting warnings from these calls. Tested by running vringh_test. Rusty, I prefer fixing all these warnings for 3.19, any objections? Michael S. Tsirkin

[PATCH 3/3] mic/host: initial virtio 1.0 support

2014-12-15 Thread Michael S. Tsirkin
This just makes code sparse-clean. The new feature bit is not yet negotiated. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/misc/mic/host/mic_debugfs.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/misc/mic/host/mic_debugfs.c

[PATCH 2/3] vringh: initial virtio 1.0 support

2014-12-15 Thread Michael S. Tsirkin
Signed-off-by: Michael S. Tsirkin m...@redhat.com --- include/linux/vringh.h | 33 ++ drivers/vhost/vringh.c | 121 ++--- 2 files changed, 107 insertions(+), 47 deletions(-) diff --git a/include/linux/vringh.h b/include/linux/vringh.h

[PATCH 1/3] vringh: 64 bit features

2014-12-15 Thread Michael S. Tsirkin
Pass u64 everywhere. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- include/linux/vringh.h | 4 ++-- drivers/vhost/vringh.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/vringh.h b/include/linux/vringh.h index 749cde2..f696dd0 100644 ---

[PATCH 0/6] virtio 1.0 fixups, tweaks

2014-12-15 Thread Michael S. Tsirkin
Fixes a couple of minor compliance issues in new virtio 1.0 code. Plus, adds a couple of minor cleanups - not bugfixes, but seem safe enough for 3.19. Michael S. Tsirkin (6): virtio: set VIRTIO_CONFIG_S_FEATURES_OK on restore virtio_config: fix virtio_cread_bytes virtio_pci_common.h: drop

[PATCH 2/6] virtio_config: fix virtio_cread_bytes

2014-12-15 Thread Michael S. Tsirkin
virtio_cread_bytes is implemented incorrectly in case length happens to be 2,4 or 8 bytes: transports and devices will assume it's an integer value that has to be converted to LE format. Let's just do multiple 1-byte reads: this also makes life easier for transports who only need to implement

[PATCH 1/6] virtio: set VIRTIO_CONFIG_S_FEATURES_OK on restore

2014-12-15 Thread Michael S. Tsirkin
virtio 1.0 devices require that drivers set VIRTIO_CONFIG_S_FEATURES_OK after finalizing features. virtio core missed doing this on restore, fix it up. Signed-off-by: Michael S. Tsirkin m...@redhat.com Reviewed-by: Cornelia Huck cornelia.h...@de.ibm.com --- drivers/virtio/virtio.c | 37

[PATCH 3/6] virtio_pci_common.h: drop VIRTIO_PCI_NO_LEGACY

2014-12-15 Thread Michael S. Tsirkin
Legacy drivers use virtio_pci_common.h too, we should not define VIRTIO_PCI_NO_LEGACY there. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/virtio/virtio_pci_common.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/virtio/virtio_pci_common.h

[PATCH 4/6] virtio_pci: move probe to common file

2014-12-15 Thread Michael S. Tsirkin
It turns out this make everything easier. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/virtio/virtio_pci_common.h | 6 +++--- drivers/virtio/virtio_pci_common.c | 34 +- drivers/virtio/virtio_pci_legacy.c | 24 ++-- 3 files

[PATCH 5/6] virtio_pci: add VIRTIO_PCI_NO_LEGACY

2014-12-15 Thread Michael S. Tsirkin
Add macro to disable all legacy register defines. Helpful to make sure legacy macros don't leak through into modern code. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- include/uapi/linux/virtio_pci.h | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git

[PATCH 6/6] virtio: core support for config generation

2014-12-15 Thread Michael S. Tsirkin
virtio 1.0 spec says: Drivers MUST NOT assume reads from fields greater than 32 bits wide are atomic, nor are reads from multiple fields: drivers SHOULD read device configuration space fields like so: u32 before, after; do { before = get_config_generation(device);

[PATCH RFC 0/5] virtio pci: virtio 1.0 support

2014-12-15 Thread Michael S. Tsirkin
This is on top of 3.19 master + my bugfix patches, and adds virtio 1.0 support to virtio pci. This is 3.20 material I think. Would like to get feedback on s390 change as it's untested. Michael S Tsirkin (2): pci: add pci_iomap_range s390: add pci_iomap_range Michael S. Tsirkin (2):

[PATCH RFC 2/5] s390: add pci_iomap_range

2014-12-15 Thread Michael S. Tsirkin
From: Michael S Tsirkin m...@redhat.com Virtio drivers should map the part of the range they need, not necessarily all of it. To this end, support mapping ranges within BAR on s390. Since multiple ranges can now be mapped within a BAR, we keep track of the number of mappings created, and only

[PATCH RFC 1/5] pci: add pci_iomap_range

2014-12-15 Thread Michael S. Tsirkin
From: Michael S Tsirkin m...@redhat.com Virtio drivers should map the part of the BAR they need, not necessarily all of it. Signed-off-by: Michael S. Tsirkin m...@redhat.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- include/asm-generic/pci_iomap.h | 10 ++ lib/pci_iomap.c

[PATCH RFC 4/5] virtio_pci: modern driver

2014-12-15 Thread Michael S. Tsirkin
It compiles! Must be perfect. One thing *not* implemented here is separate mappings for descriptor/avail/used rings. That's nice to have, will be done later after we have core support. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/virtio/virtio_pci_common.h | 29 +-

[PATCH RFC 3/5] virtio-pci: define layout for virtio 1.0

2014-12-15 Thread Michael S. Tsirkin
From: Rusty Russell ru...@rustcorp.com.au Based on patches by Michael S. Tsirkin m...@redhat.com, but I found it hard to follow so changed to use structures which are more self-documenting. Signed-off-by: Rusty Russell ru...@rustcorp.com.au Signed-off-by: Michael S. Tsirkin m...@redhat.com ---

[PATCH RFC 5/5] virtio_pci: macros for PCI layout offsets.

2014-12-15 Thread Michael S. Tsirkin
QEMU wants it, so why not? Trust, but verify. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- include/uapi/linux/virtio_pci.h| 30 ++ drivers/virtio/virtio_pci_modern.c | 63 ++ 2 files changed, 93 insertions(+) diff --git