Re: [PULL] uaccess: fix sparse warning on get/put_user for bitwise types

2015-01-14 Thread Arnd Bergmann
On Wednesday 14 January 2015 19:36:18 Michael S. Tsirkin wrote: As you asked, here's a pull request. This has been in linux-next apparently with no ill effects. The following changes since commit 99975cc6ada0d5f2675e83abecae05aba5f437d2: vhost/net: length miscalculation (2015-01-07

[PATCH] VMCI: Fix two UVA mapping bugs

2015-01-14 Thread jhansen
From: Jorgen Hansen jhan...@vmware.com (this is a resend of this patch. Originally sent last year, but post appears to have been lost) This change fixes two bugs in the VMCI host driver related to mapping the notify boolean from user space into kernel space: - the actual UVA was rounded up to

[PATCH v3 05/16] virtio/net: verify device has config space

2015-01-14 Thread Michael S. Tsirkin
Some devices might not implement config space access (e.g. remoteproc used not to - before 3.9). virtio/net needs config space access so make it fail gracefully if not there. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/net/virtio_net.c | 6 ++ 1 file changed, 6

[PATCH v3 02/16] virtio/9p: verify device has config space

2015-01-14 Thread Michael S. Tsirkin
Some devices might not implement config space access (e.g. remoteproc used not to - before 3.9). virtio/9p needs config space access so make it fail gracefully if not there. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- net/9p/trans_virtio.c | 6 ++ 1 file changed, 6 insertions(+)

[PATCH v3 13/16] virtio_pci: modern driver

2015-01-14 Thread Michael S. Tsirkin
Lightly tested against qemu. 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. This also exposes the PCI layout to userspace, and adds macros for PCI layout offsets: QEMU wants it, so why

[PATCH v3 14/16] virtio_pci: macros for PCI layout offsets

2015-01-14 Thread Michael S. Tsirkin
From: Rusty Russell ru...@rustcorp.com.au QEMU wants it, so why not? Trust, but verify. Signed-off-by: Rusty Russell ru...@rustcorp.com.au Signed-off-by: Michael S. Tsirkin m...@redhat.com --- include/uapi/linux/virtio_pci.h| 30 drivers/virtio/virtio_pci_modern.c | 58

[PATCH v3 12/16] virtio-pci: define layout for virtio 1.0

2015-01-14 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 v3 00/16] virtio-pci: towards virtio 1.0 guest support

2015-01-14 Thread Michael S. Tsirkin
Changes since v2: handling for devices without config space (e.g. rng) reduce # of mappings for VQs These patches seem to work fine on my virtio-1.0 qemu branch. There haven't been any bugs since v2: just minor cleanups and enhancements. QEMU side is still undergoing polishing,

[PATCH v3 01/16] virtio_pci: drop virtio_config dependency

2015-01-14 Thread Michael S. Tsirkin
virtio_pci does not depend on virtio_config: let's not include it, users can pull it in as necessary. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- include/uapi/linux/virtio_pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/virtio_pci.h

[PATCH v3 15/16] virtio_pci_modern: reduce number of mappings

2015-01-14 Thread Michael S. Tsirkin
We don't know the # of VQs that drivers are going to use so it's hard to predict how much memory we'll need to map. However, the relevant capability does give us an upper limit. If that's below a page, we can reduce the number of required mappings by mapping it all once ahead of the time.

[PATCH v3 16/16] virtio_pci_modern: support devices with no config

2015-01-14 Thread Michael S. Tsirkin
Virtio 1.0 spec lists device config as optional. Set get/set callbacks to NULL. Drivers can check that and fail gracefully. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/virtio/virtio_pci_modern.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff

[PULL] uaccess: fix sparse warning on get/put_user for bitwise types

2015-01-14 Thread Michael S. Tsirkin
Hello, Arnd, As you asked, here's a pull request. This has been in linux-next apparently with no ill effects. The following changes since commit 99975cc6ada0d5f2675e83abecae05aba5f437d2: vhost/net: length miscalculation (2015-01-07 12:22:00 +0200) are available in the git repository at:

[PATCH v3 08/16] mn10300: drop dead code

2015-01-14 Thread Michael S. Tsirkin
pci-iomap.c was (apparently, mistakenly) reintroduced as part of commit 83c2dc15ce824450e7044b9f90cd529c25747ae0 MN10300: Handle cacheable PCI regions in pci_iomap() probably as side-effect of forward-porting the patch from an old kernel. It's not really needed: the generic pci_iomap does the

[PATCH v3 07/16] virtio/balloon: verify device has config space

2015-01-14 Thread Michael S. Tsirkin
Some devices might not implement config space access (e.g. remoteproc used not to - before 3.9). virtio/balloon needs config space access so make it fail gracefully if not there. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/virtio/virtio_balloon.c | 6 ++ 1 file changed, 6

[PATCH v3 09/16] pci: add pci_iomap_range

2015-01-14 Thread Michael S. Tsirkin
Virtio drivers should map the part of the BAR they need, not necessarily all of it. Cc: Bjorn Helgaas bhelg...@google.com Cc: linux-...@vger.kernel.org Acked-by: Arnd Bergmann a...@arndb.de Signed-off-by: Michael S. Tsirkin m...@redhat.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au ---

[PATCH v3 11/16] virtio_pci: move probe/remove code to common

2015-01-14 Thread Michael S. Tsirkin
Most of initialization is device-independent. Let's move it to common. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/virtio/virtio_pci_common.h | 5 +-- drivers/virtio/virtio_pci_common.c | 69 +- drivers/virtio/virtio_pci_legacy.c | 76

[PATCH v3 10/16] s390: add pci_iomap_range

2015-01-14 Thread Michael S. Tsirkin
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 clear out the mapping for a BAR when this

[PATCH v3 04/16] virtio/console: verify device has config space

2015-01-14 Thread Michael S. Tsirkin
Some devices might not implement config space access (e.g. remoteproc used not to - before 3.9). virtio/console needs config space access so make it fail gracefully if not there. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/char/virtio_console.c | 6 ++ 1 file changed, 6

[PATCH v3 06/16] virtio/scsi: verify device has config space

2015-01-14 Thread Michael S. Tsirkin
Some devices might not implement config space access (e.g. remoteproc used not to - before 3.9). virtio/scsi needs config space access so make it fail gracefully if not there. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/scsi/virtio_scsi.c | 6 ++ 1 file changed, 6