[PATCH 5/7] virtio: use u32, not bitmap for struct virtio_device's features

2013-04-04 Thread 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: Ohad Ben-Cohen Cc: Brian Swetland Cc: Cornelia Huck Cc: Christian Borntraeger Signed-off-by: Rusty Russell Acked-by: Pawel Moll --- drivers

[PATCH 6/7] virtio: add support for 64 bit features.

2013-04-04 Thread Rusty Russell
Change the u32 to a u64, and make sure to use 1ULL everywhere! Cc: Ohad Ben-Cohen Cc: Brian Swetland Cc: Cornelia Huck Cc: Christian Borntraeger Signed-off-by: Rusty Russell Acked-by: Pawel Moll --- drivers/char/virtio_console.c |2 +- drivers/lguest/lguest_device.c

[PATCH 7/7] virtio: move vring structure into struct virtqueue.

2013-04-04 Thread Rusty Russell
we've already demonstrated that it's useful to be able to see the ring size, and the new virtio pci layout wants to know the location of each part of the ring. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_ring.c | 114 +- include

[PATCH 2/7] virtio: use size-based config accessors.

2013-04-04 Thread Rusty Russell
This lets the transport do endian conversion if necessary, and insulates the drivers from the difference. Most drivers can use the simple helpers virtio_cread() and virtio_cwrite(). Signed-off-by: Rusty Russell --- drivers/block/virtio_blk.c | 77

[PATCH 1/7] virtio_config: introduce size-based accessors.

2013-04-04 Thread Rusty Russell
This lets the transport do endian conversion if necessary, and insulates the drivers from that change. Signed-off-by: Rusty Russell --- include/linux/virtio_config.h | 161 ++--- 1 file changed, 134 insertions(+), 27 deletions(-) diff --git a/include/linux

[PATCH 3/7] virtio_config: helpers for non-converting accessors.

2013-04-04 Thread Rusty Russell
Simply redirect everything via the byte-at-a-time accessor. Slow, but simple and this is config reading, which mostly only happens at probe time. Signed-off-by: Rusty Russell --- drivers/virtio/virtio.c | 69 + include/linux/virtio_config.h

Re: [PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-04-04 Thread Rusty Russell
"Michael S. Tsirkin" writes: > By the way, Gleb pointed out that on older hosts MMIO will > always be slower since we need to do a shadow page walk to > translate virtual to physical address. > Hopefully not a big concern, and after all we are still > keeping PIO around for use by BIOS ... Yeah,

[PATCH 0/7] virtio cleanups

2013-04-04 Thread Rusty Russell
Aiming these for coming merge window. Nothing should change, but get ready for a non-guest-endian config transports, and > 32 features bits. Final one is just an overdue consolidation. Cheers, Rusty. Rusty Russell (7): virtio_config: introduce size-based accessors. virtio: use size-ba

Re: [PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-04-04 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Apr 03, 2013 at 04:40:29PM +1030, Rusty Russell wrote: >> Current proposal is a 16 bit 'offset' field in the queue data for each >> queue, ie. >> addr = dev->notify_base + vq->notify_off; >> >&

Re: [PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-04-02 Thread Rusty Russell
"H. Peter Anvin" writes: > On 03/29/2013 08:19 PM, Rusty Russell wrote: >>> >>> Shift count? >> >> You can only have 2^16 vqs per device. Is it verboten to write 16-bit >> values to odd offsets? If so, we've just dropped it to 2^15 befor

Re: [PATCH 1/2 V3] virtio-spec: dynamic network offloads configuration

2013-04-02 Thread Rusty Russell
Dmitry Fleytman writes: > From: Dmitry Fleytman > > Virtio-net driver currently negotiates network offloads > on startup via features mechanism and have no ability to > change offloads state later. > This patch introduced a new control command that allows > to configure device network offloads st

Re: [PATCH] MAINTAINERS: add missing entries for virtio

2013-04-02 Thread Rusty Russell
Amos Kong writes: > Some head files were split or moved to uapi/ without > updating MAINTAINERS. > > Signed-off-by: Amos Kong Thanks, applied. Cheers, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux

Re: [PATCH 3/8] virtio: do not export "u16" and "u64" to userspace

2013-04-01 Thread Rusty Russell
Paul Bolle writes: > virtio_balloon.h exports "u16" and "u64" to userspace. Use "__u16" and > "__u64" instead. > > Signed-off-by: Paul Bolle > --- > 0) Tested with a kernel build. > > 1) Both types are used in this header for quite some time now. So is my > patch flawed or doesn't userspace actua

Re: [PATCH V2 2/2] tcm_vhost: Use vq->private_data to indicate if the endpoint is setup

2013-04-01 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Rusty's currently doing some reorgs of -net let's delay > cleanups there to avoid stepping on each other's toys. > Let's focus on scsi here. > E.g. any chance framing assumptions can be fixed in 3.10? I am waiting for your removal of the dma-compelete ordering stuff

Re: [PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-04-01 Thread Rusty Russell
"H. Peter Anvin" writes: > On 03/27/2013 04:25 AM, Michael S. Tsirkin wrote: >> >> Aha. Yes, good idea. As for how large the offsets are, >> I am guessing we should either just say offset is vqn * X and data is >> vqn, or give hypervisors full flexibility with 32 bit offset and >> arbitrary data

Re: [PATCH v2 2/2] virtio: console: add locking around c_ovq operations

2013-04-01 Thread Rusty Russell
Amit Shah writes: > When multiple ovq operations are being performed (lots of open/close > operations on virtio_console fds), the __send_control_msg() function can > get confused without locking. > > A simple recipe to cause badness is: > * create a QEMU VM with two virtio-serial ports > * in the

Re: [PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-03-26 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Mon, Mar 25, 2013 at 08:30:28PM +1030, Rusty Russell wrote: >> Let's go back a level. Do we still need I/O bars at all now? Or can we >> say "if you want hundreds of vqs, use mem bars"? >> >> hpa wanted

Re: [PATCH] drivers: virtio: Use PTR_RET function

2013-03-26 Thread Rusty Russell
Andru Gheorghiu writes: > PTR_RET does return. It's perfectly equivalent to using IS_ERR and the > returning PTR_ERR. The implementation is here [1]. Um, I read the implementation, thanks. > The reason for using it is this: if you have a function that does > something why not call it instead of

Re: [PATCH] drivers: virtio: Use PTR_RET function

2013-03-25 Thread Rusty Russell
Alexandru Gheorghiu writes: > Used PTR_RET function instead of IS_ERR and PTR_ERR. > Patch found using coccinelle. WTF is PTR_RET? PTR_RET doesn't return anything. Why is it called that? It doesn't even make sense. ZERO_OR_PTR_ERR() maybe. But what problem are we solving? Insufficient chur

Re: [PATCH 05/22] virtio: add support for 64 bit features.

2013-03-25 Thread Rusty Russell
Ohad Ben-Cohen writes: > On Fri, Mar 22, 2013 at 4:50 PM, Sjur Brændeland wrote: >> I guess you would need to update the feature bits in remoteproc as well? >> e.g. something like: >> >> diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h >> index faf3332..148a503 100644 >> --- a

Re: [PATCH 12/22] virtio_pci: allow duplicate capabilities.

2013-03-25 Thread Rusty Russell
"H. Peter Anvin" writes: > That might be pushing it, fitting into the 192-byte nonstandard area with > everything else that might have to go there... Yeah, and it only ever grows, since we add new fields at the end. Cheers, Rusty. ___ Virtualization m

Re: [PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-03-25 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Fri, Mar 22, 2013 at 01:22:57PM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > I would like an option for hypervisor to simply say "Do IO >> > to this fixed address for this VQ". Then

Re: [PATCH 03/22] virtio_config: make transports implement accessors.

2013-03-24 Thread Rusty Russell
Sjur Brændeland writes: > On Thu, Mar 21, 2013 at 9:29 AM, Rusty Russell wrote: >> @@ -653,8 +676,14 @@ static int vp_set_vq_affinity(struct virtqueue *vq, int >> cpu) >> } >> >> static const struct virtio_config_ops virtio_pci_config_ops = { &g

Re: [PATCH virtio-next 2/2] caif_virtio: Check that vringh_config is not null

2013-03-24 Thread Rusty Russell
Sjur Brændeland writes: > Check that vringh_config is not NULL before using it. > > Signed-off-by: Sjur Brændeland Both applied. Thanks, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.or

Re: [PATCH 03/22] virtio_config: make transports implement accessors.

2013-03-21 Thread Rusty Russell
Cornelia Huck writes: > On Thu, 21 Mar 2013 18:59:24 +1030 > Rusty Russell wrote: ... >> diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c >> index 6711e65..dcf35b1 100644 >> --- a/drivers/s390/kvm/kvm_virtio.c >> +++ b/drivers/s390/kvm/kvm_

Re: [PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-03-21 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Mar 21, 2013 at 06:59:37PM +1030, Rusty Russell wrote: >> (MST, is this what you were thinking?) > > Almost. > > Three points: > > 1. this is still an offset in BAR so for KVM we are still forced to use > an IO BAR.

Re: [PATCH 05/22] virtio: add support for 64 bit features.

2013-03-21 Thread Rusty Russell
Cornelia Huck writes: > On Thu, 21 Mar 2013 18:59:26 +1030 > Rusty Russell wrote: > >> Change the u32 to a u64, and make sure to use 1ULL everywhere! > > And a not-even-compiled change for virtio_ccw as well: Thanks, applied that too. BTW, this will all be in my virtio-pci

Re: [PATCH 04/22] virtio: use u32, not bitmap for struct virtio_device's features

2013-03-21 Thread Rusty Russell
Cornelia Huck writes: > On Thu, 21 Mar 2013 18:59:25 +1030 > Rusty Russell wrote: > >> 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. >> ... > I didn't try this patch, but

Re: [RFC qemu PATCH] only writing out the last byte of MAC makes it have effect

2013-03-21 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Mar 21, 2013 at 02:44:50PM +0800, Amos Kong wrote: >> The lengcy guests don't have mac programming command, we don't know when >> it's safe to use MAC. This patch changed qemu to makes MAC change effect >> when the last byte of MAC is written to config space.

Re: [PATCH 12/22] virtio_pci: allow duplicate capabilities.

2013-03-21 Thread Rusty Russell
"H. Peter Anvin" writes: > On 03/21/2013 10:49 AM, Michael S. Tsirkin wrote: >> >> Just to clarify, I expect BIOS to use it *for config access*. >> Notification will support IO anyway because it's >> faster on KVM, so BIOS can use it directly. >> > > Ah, yes, of course. > > Quite frankly, I don'

Re: [PATCH 13/22] virtio_pci: new, capability-aware driver.

2013-03-21 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Mar 21, 2013 at 06:59:34PM +1030, Rusty Russell wrote: >> Differences: >> 1) Uses 4 pci capabilities to demark common, irq, notify and dev-specific >> areas. >> 2) Guest sets queue size, using host-provided maximum. >

[PATCH 22/22] virtio_pci: fix finalize_features in modern driver.

2013-03-21 Thread Rusty Russell
Because we have potentially-infinite feature bits, it's hard for the device to know when features are finalized. This adds a new status bit, VIRTIO_CONFIG_S_FEATURES_DONE, which is only set by the modern virtio_pci driver at the moment. Signed-off-by: Rusty Russell --- drivers/v

[PATCH 21/22] virtio_pci: simplify common helpers.

2013-03-21 Thread Rusty Russell
Our helpers can take a virtio_pci_device, rather than converting from a virtio_device all the time. They couldn't do this when they were called from the common virtio code, but now we wrap them anyway, it simplifies things. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci-com

[PATCH 20/22] virtio_pci: share virtqueue setup/teardown between modern and legacy driver.

2013-03-21 Thread Rusty Russell
There's a great deal of work in setting up and disabling interrupts, particularly with MSI-X, which is generic. So we move most of the work out to helpers which take the location of the msix_config register, and setup_vq and del_vq functions. Signed-off-by: Rusty Russell --- drivers/v

[PATCH 19/22] virtio_pci: share interrupt/notify handlers between legacy and modern.

2013-03-21 Thread Rusty Russell
If we make the legacy driver set up the ->isr pointer in the struct virtio_pci_device structure, we can use that in common code. (the positions have changed, but the semantics haven't). Signed-off-by: Rusty Russell --- drivers/virtio/Makefile|4 +- drivers/virtio/vi

[PATCH 18/22] virtio_pci: share structure between legacy and modern.

2013-03-21 Thread Rusty Russell
They're almost identical: we add a "legacy" ioregion (what was "ioaddr" in the legacy driver), and move it out to virtio_pci-common.h. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci-common.h | 76 + drivers/virtio/v

[PATCH 17/22] virtio_pci_legacy: cleanup struct virtio_pci_vq_info

2013-03-21 Thread Rusty Russell
By removing the redundant num field and including a pointer to where we should notify, it exactly matches the virtio_pci one now. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci_legacy.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a

[PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-03-21 Thread Rusty Russell
en: it can still distinguish different notifications). Cc: "Michael S. Tsirkin" Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci.c | 61 +++ include/uapi/linux/virtio_pci.h |2 +- 2 files changed, 44 insertions(+), 19 deletions(-)

[PATCH 15/22] virtio_pci: use little endian for config space.

2013-03-21 Thread Rusty Russell
Previously, it was defined as "guest-endian". This was always confusing for PCI, for which everything else is defined a little endian. The ring itself is unchanged, this is just the per-device config info. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pc

[PATCH 14/22] virtio_pci: layout changes as per hpa's suggestions.

2013-03-21 Thread Rusty Russell
queue_address was at offset 28 (0x1C), which is unusual, so add more padding to take the first 64-bit value to offset 32 (0x20). Cc: H. Peter Anvin Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci.c | 48 +++ include/uapi/linux/virtio_pci.h | 11

[PATCH 13/22] virtio_pci: new, capability-aware driver.

2013-03-21 Thread Rusty Russell
Differences: 1) Uses 4 pci capabilities to demark common, irq, notify and dev-specific areas. 2) Guest sets queue size, using host-provided maximum. 3) Guest sets queue alignment, rather than ABI-defined 4096. 4) More than 32 feature bits (a lot more!). Signed-off-by: Rusty Russell Signed-off-by

[PATCH 12/22] virtio_pci: allow duplicate capabilities.

2013-03-21 Thread Rusty Russell
Another HPA suggestion: that the device be allowed to offer duplicate capabilities, particularly so it can offer a mem and an I/O bar and let the guest decide (Linux guest probably doesn't care?). Cc: H. Peter Anvin Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci_legacy.c |

[PATCH 11/22] virtio_pci: don't use the legacy driver if we find the new PCI capabilities.

2013-03-21 Thread Rusty Russell
With module option to override. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci_legacy.c | 20 +++- include/linux/virtio_pci.h | 16 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_pci_legacy.c b

[PATCH 10/22] virtio_pci: use _LEGACY_ defines in virtio_pci_legacy.c

2013-03-21 Thread Rusty Russell
include/linux/virtio_pci.h turns off the compat defines, and we use it rather than including include/uapi/linux/virtio_pci.h directly. This makes it obvious if we use legacy defines elsewhere. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci_legacy.c | 62

[PATCH 09/22] virtio_pci: move old defines to legacy, introduce new structure.

2013-03-21 Thread Rusty Russell
We don't *remove* the old ones, unless VIRTIO_PCI_NO_LEGACY is defined, but they get a friendly #warning about the change. Note that config option is not prompted; we always enable it for now. Signed-off-by: Rusty Russell --- drivers/virtio/Kconfig | 12 + drivers/virtio/Mak

[PATCH 07/22] pci: add pci_iomap_range

2013-03-21 Thread Rusty Russell
From: Michael S Tsirkin Virtio drivers should map the part of the range they need, not necessarily all of it. They also need non-cacheable mapping even for prefetchable BARs. Signed-off-by: Michael S. Tsirkin Signed-off-by: Rusty Russell --- include/asm-generic/pci_iomap.h |5 + lib

[PATCH 08/22] virtio-pci: define layout for virtio vendor-specific capabilities.

2013-03-21 Thread Rusty Russell
Based on patch by Michael S. Tsirkin , but I found it hard to follow so changed to use structures which are more self-documenting. Signed-off-by: Rusty Russell --- include/uapi/linux/virtio_pci.h | 41 +++ 1 file changed, 41 insertions(+) diff --git a

[PATCH 05/22] virtio: add support for 64 bit features.

2013-03-21 Thread Rusty Russell
Change the u32 to a u64, and make sure to use 1ULL everywhere! Cc: Ohad Ben-Cohen Cc: Brian Swetland Cc: Cornelia Huck Cc: Pawel Moll Cc: Christian Borntraeger Signed-off-by: Rusty Russell --- drivers/char/virtio_console.c |2 +- drivers/lguest/lguest_device.c | 10

[PATCH 06/22] virtio: move vring structure into struct virtqueue.

2013-03-21 Thread Rusty Russell
we've already demonstrated that it's useful to be able to see the ring size, and the new virtio pci layout wants to know the location of each part of the ring. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_ring.c | 114 +- include

[PATCH 03/22] virtio_config: make transports implement accessors.

2013-03-21 Thread Rusty Russell
All transports just pass through at the moment. Cc: Ohad Ben-Cohen Cc: Brian Swetland Cc: Cornelia Huck Cc: Pawel Moll Cc: Christian Borntraeger Signed-off-by: Rusty Russell --- drivers/lguest/lguest_device.c | 79 ++-- drivers/net/caif/caif_virtio.c

[PATCH 04/22] virtio: use u32, not bitmap for struct virtio_device's features

2013-03-21 Thread 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: Ohad Ben-Cohen Cc: Brian Swetland Cc: Cornelia Huck Cc: Pawel Moll Cc: Christian Borntraeger Signed-off-by: Rusty Russell --- drivers/char/virtio_cons

[PATCH 02/22] virtio_config: use size-based accessors.

2013-03-21 Thread Rusty Russell
This lets the transport do endian conversion if necessary, and insulates the drivers from that change. Most drivers can use the simple helpers virtio_cread() and virtio_cwrite(). Signed-off-by: Rusty Russell --- drivers/block/virtio_blk.c | 77

[PATCH 01/22] virtio_config: introduce size-based accessors.

2013-03-21 Thread Rusty Russell
This lets the transport do endian conversion if necessary, and insulates the drivers from that change. Signed-off-by: Rusty Russell --- include/linux/virtio_config.h | 161 ++--- 1 file changed, 134 insertions(+), 27 deletions(-) diff --git a/include/linux

[PATCH 00/22] New virtio PCI layout

2013-03-21 Thread Rusty Russell
etely untested. Comments gratefully received! Rusty. Michael S Tsirkin (1): pci: add pci_iomap_range Rusty Russell (21): virtio_config: introduce size-based accessors. virtio_config: use size-based accessors. virtio_config: make transports implement accessors. virtio: use u

Re: [PATCH 18/22] virtio_rpmsg_bus: use simplified virtqueue accessors.

2013-03-20 Thread Rusty Russell
Ohad Ben-Cohen writes: > On Mon, Mar 18, 2013 at 11:34 AM, Rusty Russell wrote: >> We never add buffers with input and output parts, so use the new accessors. >> >> Cc: Ohad Ben-Cohen >> Signed-off-by: Rusty Russell > > Acked-by: Ohad Ben-Cohen Thanks. U

Re: [PATCH 20/22] 9p/trans_virtio.c: use virtio_add_sgs[]

2013-03-19 Thread Rusty Russell
Rusty Russell writes: > virtio_add_buf() is going away, replaced with virtio_add_sgs() which > takes multiple terminated scatterlists. > > Cc: Eric Van Hensbergen > Signed-off-by: Rusty Russell This one was buggy. Testing and reading the patch do wonderful things. Che

Re: [PATCH 00/22] virtqueue_add_sgs, virtqueue_add_outbuf, virtqueue_add_inbuf

2013-03-19 Thread Rusty Russell
Rusty Russell writes: > Add virtqueue_add_sgs which is more general than virtqueue_add_buf, > which makes virtio-scsi and virtio-blk nicer, then add virtqueue_add_inbuf > and virtqueue_add_outbuf which handle the more general case, and finally > delete virtqueue_add_buf(). > &g

Re: [PATCH V2 11/22] virtio-scsi: use virtqueue_add_sgs for command buffers

2013-03-19 Thread Rusty Russell
Reviewed-by: Asias He > Signed-off-by: Rusty Russell Thanks... and I agree with Paulo: this is nice. I've replaced the patch I posted with this one. Cheers, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org http

Re: [PATCH] virtio-spec: add field for scsi command size

2013-03-18 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Mar 14, 2013 at 01:10:20PM +0200, Michael S. Tsirkin wrote: >> Add field for guest to specify command size for virtio-blk. >> >> Signed-off-by: Michael S. Tsirkin > > There's one concern here: are we going to add a > feature flag for flexible layout? If yes

Re: [PATCH 13/22] virtio_net: use virtqueue_add_sgs[] for command buffers.

2013-03-18 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Mon, Mar 18, 2013 at 08:04:44PM +1030, Rusty Russell wrote: >> It's a bit cleaner to hand multiple sgs, rather than one big one. >> >> Cc: "Michael S. Tsirkin" >> Signed-off-by: Rusty

[PATCH 22/22] virtio: remove virtqueue_add_buf().

2013-03-18 Thread Rusty Russell
All users changed to virtqueue_add_sg() or virtqueue_add_outbuf/inbuf. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_ring.c | 31 --- include/linux/virtio.h |7 --- 2 files changed, 38 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b

[PATCH 21/22] tools/virtio: remove virtqueue_add_buf() from tests.

2013-03-18 Thread Rusty Russell
Signed-off-by: Rusty Russell --- tools/virtio/linux/virtio.h |7 --- tools/virtio/virtio_test.c |6 +++--- tools/virtio/vringh_test.c | 22 -- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux

[PATCH 20/22] 9p/trans_virtio.c: use virtio_add_sgs[]

2013-03-18 Thread Rusty Russell
virtio_add_buf() is going away, replaced with virtio_add_sgs() which takes multiple terminated scatterlists. Cc: Eric Van Hensbergen Signed-off-by: Rusty Russell --- net/9p/trans_virtio.c | 48 +++- 1 file changed, 39 insertions(+), 9 deletions

[PATCH 13/22] virtio_net: use virtqueue_add_sgs[] for command buffers.

2013-03-18 Thread Rusty Russell
It's a bit cleaner to hand multiple sgs, rather than one big one. Cc: "Michael S. Tsirkin" Signed-off-by: Rusty Russell --- drivers/net/virtio_net.c | 50 +++--- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/net

[PATCH 18/22] virtio_rpmsg_bus: use simplified virtqueue accessors.

2013-03-18 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Cc: Ohad Ben-Cohen Signed-off-by: Rusty Russell --- drivers/rpmsg/virtio_rpmsg_bus.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg

[PATCH 17/22] caif_virtio: use simplified virtqueue accessors.

2013-03-18 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Cc: Sjur Brendeland Signed-off-by: Rusty Russell --- drivers/net/caif/caif_virtio.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif

[PATCH 19/22] virtio_balloon: use simplified virtqueue accessors.

2013-03-18 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_balloon.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index

[PATCH 16/22] virtio_console: use simplified virtqueue accessors.

2013-03-18 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Cc: Amit Shah Signed-off-by: Rusty Russell --- drivers/char/virtio_console.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c

[PATCH 15/22] virtio_rng: use simplified virtqueue accessors.

2013-03-18 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Signed-off-by: Rusty Russell --- drivers/char/hw_random/virtio-rng.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c

[PATCH 14/22] virtio_net: use simplified virtqueue accessors.

2013-03-18 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Cc: "Michael S. Tsirkin" Signed-off-by: Rusty Russell --- drivers/net/virtio_net.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/vi

[PATCH 10/22] virtio_blk: remove nents member.

2013-03-18 Thread Rusty Russell
It's simply a flag as to whether we have data now, so make it an explicit function parameter rather than a member of struct virtblk_req. Signed-off-by: Rusty Russell Reviewed-by: Asias He --- drivers/block/virtio_blk.c | 22 +++--- 1 file changed, 11 insertions(+

[PATCH 11/22] virtio-scsi: use virtqueue_add_sgs for command buffers

2013-03-18 Thread Rusty Russell
: Rusty Russell --- drivers/scsi/virtio_scsi.c | 91 +--- 1 file changed, 34 insertions(+), 57 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 0f5dd28..bb67576 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers

[PATCH 12/22] virtio_scsi: use virtqueue_add_inbuf() for virtscsi_kick_event.

2013-03-18 Thread Rusty Russell
It's a bit clearer, and add_buf is going away. Signed-off-by: Rusty Russell --- drivers/scsi/virtio_scsi.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index bb67576..f679b8c 100644 --- a/drivers

[PATCH 09/22] virtio-blk: use virtqueue_add_sgs on req path

2013-03-18 Thread Rusty Russell
#x27;t use vbr->sg, however, we need to add a couple of arguments to __virtblk_add_req. We also need to teach __virtblk_add_req how to build SCSI command requests. Signed-off-by: Paolo Bonzini Signed-off-by: Rusty Russell Reviewed-by: Asias He --- drivers/block/virtio

[PATCH 08/22] virtio-blk: use virtqueue_add_sgs on bio path

2013-03-18 Thread Rusty Russell
parately using virtqueue_add_sgs(). With this change, virtio-blk (with use_bio) is not relying anymore on the virtio functions ignoring the end markers in a scatterlist. The next patch will do the same for the other path. Signed-off-by: Paolo Bonzini Signed-off-by: Rusty Russell Reviewed-by:

[PATCH 05/22] virtio_ring: virtqueue_add_outbuf / virtqueue_add_inbuf.

2013-03-18 Thread Rusty Russell
These are specialized versions of virtqueue_add_buf(), which cover over 80% of cases and are far clearer. In particular, the scatterlists passed to these functions don't have to be clean (ie. we ignore end markers). Signed-off-by: Rusty Russell --- drivers/virtio/virtio_ring.c |

[PATCH 06/22] tools/virtio: make vringh_test use inbuf/outbuf.

2013-03-18 Thread Rusty Russell
-39063(39062) Host: notified 39037-39063(39062), pinged 0 Wall time:1.64-1.81(1.676875) Signed-off-by: Rusty Russell --- tools/virtio/linux/virtio.h | 10 ++ tools/virtio/vringh_test.c |8 2 files changed, 14 insertions(+), 4 deletions(-) diff

[PATCH 07/22] virtio-blk: reorganize virtblk_add_req

2013-03-18 Thread Rusty Russell
Bonzini Reviewed-by: Asias He Signed-off-by: Rusty Russell --- drivers/block/virtio_blk.c | 55 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 922bcb9..b271650 100644 --- a

[PATCH 01/22] scatterlist: introduce sg_unmark_end

2013-03-18 Thread Rusty Russell
From: Paolo Bonzini This is useful in places that recycle the same scatterlist multiple times, and do not want to incur the cost of sg_init_table every time in hot paths. Acked-by: Jens Axboe Signed-off-by: Paolo Bonzini Signed-off-by: Rusty Russell --- block/blk-integrity.c |2

[PATCH 02/22] virtio_ring: virtqueue_add_sgs, to add multiple sgs.

2013-03-18 Thread Rusty Russell
1.70-1.95(1.723542) After: Using CPUS 0 and 3 Guest: notified 0, pinged 39019-39063(39061) Host: notified 39019-39063(39061), pinged 0 Wall time:2.09-2.52(2.188542) Signed-off-by: Rusty Russell Reviewed-by: Wanlong Gao Reviewed-by: Asias He --

[PATCH 00/22] virtqueue_add_sgs, virtqueue_add_outbuf, virtqueue_add_inbuf

2013-03-18 Thread Rusty Russell
whole series, and it can move from my pending-rebases tree into virtio-next. Thanks! Rusty. Paolo Bonzini (4): scatterlist: introduce sg_unmark_end virtio-blk: reorganize virtblk_add_req virtio-blk: use virtqueue_add_sgs on bio path virtio-blk: use virtqueue_add_sgs on req path Rusty Russel

[PATCH 04/22] virtio_ring: inline internal vring functions more aggressively.

2013-03-18 Thread Rusty Russell
63) Host: notified 39062-39063(39063), pinged 0 Wall time:1.76-2.22(1.789167) Signed-off-by: Rusty Russell --- drivers/virtio/virtio_ring.c | 91 ++ 1 file changed, 56 insertions(+), 35 deletions(-) diff --git a/drivers/virti

[PATCH 03/22] virtio_ring: don't count elements twice for add_buf path.

2013-03-18 Thread Rusty Russell
(39062), pinged 0 Wall time:1.90-2.35(1.921875) Signed-off-by: Rusty Russell Reviewed-by: Wanlong Gao --- drivers/virtio/virtio_ring.c | 147 +++--- 1 file changed, 80 insertions(+), 67 deletions(-) diff --git a/drivers/virtio/virtio_ring.c

Re: [PATCHv2] virtio: Introduce vringh wrappers in virtio_config

2013-03-18 Thread Rusty Russell
evice >>>> struct. This enables virtio drivers to manage virtio >>>> host rings without detailed knowledge of how the >>>> vrings are created and deleted. >>>> >>>> The function vringh_notify() is added so vringh clients >>>>

Re: [PATCHv2] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"

2013-03-18 Thread Rusty Russell
Amit Shah writes: > On (Wed) 13 Mar 2013 [12:10:48], sjur.brandel...@stericsson.com wrote: >> From: Sjur Brændeland >> >> >> This reverts commit 8078db789a92b10ff6e2d713231b5367e014c53b, and >> adds a lengthy comment explaining the problem area. >> >> The reverted patch caused opening of port

Re: [PATCHv3 vringh] caif_virtio: Introduce caif over virtio

2013-03-18 Thread Rusty Russell
anks, Rusty. caif_virtio: remove unneeded remoteproc.h Reported-by: Ohad Ben-Cohen Signed-off-by: Rusty Russell diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c index 6a745dd..b1e1205 100644 --- a/drivers/net/caif/caif_virtio.c +++ b/drivers/net/caif/caif_virtio.c @@ -1

Re: [PATCHv3 vringh] caif_virtio: Introduce caif over virtio

2013-03-18 Thread Rusty Russell
David Miller writes: > From: Erwan Yvin > Date: Fri, 15 Mar 2013 10:42:17 +0100 > >> caif-virtio is going to replace caif-shm. >> This patch should be merged in rusty's tree. (vringh) >> because there is a dependency with vringh wrapper. > > Feel free to add my: > > Acked-by: David S. Miller T

Re: [PATCHv3 vringh] caif_virtio: Introduce caif over virtio

2013-03-18 Thread Rusty Russell
n_pool_create" [drivers/net/caif/caif_virtio.ko] undefined! ERROR: "gen_pool_destroy" [drivers/net/caif/caif_virtio.ko] undefined! ERROR: "gen_pool_free" [drivers/net/caif/caif_virtio.ko] undefined! ERROR: "gen_pool_alloc" [drivers/net/caif/caif_virtio.ko] undefined! Sig

Re: vhost questions.

2013-03-17 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Mar 14, 2013 at 05:08:22PM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > On Wed, Mar 13, 2013 at 05:19:51PM +1030, Rusty Russell wrote: >> >> OK, I've been trying to read the vhost

Re: [PATCHv2] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"

2013-03-17 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: > From: Sjur Brændeland > > > This reverts commit 8078db789a92b10ff6e2d713231b5367e014c53b, and > adds a lengthy comment explaining the problem area. > > The reverted patch caused opening of ports to fail for rproc_serial. > In probe guest_connected was set

Re: vhost questions.

2013-03-13 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Mar 13, 2013 at 05:19:51PM +1030, Rusty Russell wrote: >> OK, I've been trying to read the vhost and vhost net code, and I'm >> struggling with basic questions. >> >> 1) Why do we allow userspace to change an

vhost questions.

2013-03-12 Thread Rusty Russell
OK, I've been trying to read the vhost and vhost net code, and I'm struggling with basic questions. 1) Why do we allow userspace to change an already-set-up vhost device? Why not have: open() ioctl(VHOST_GET_FEATURES) ioctl(VHOST_SET_VRING) x n (sets num, addresses, kick

Re: [PATCH] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"

2013-03-12 Thread Rusty Russell
Sjur Brændeland writes: > On Tue, Mar 12, 2013 at 8:34 AM, Amit Shah wrote: >> On (Mon) 11 Mar 2013 [16:15:00], sjur.brandel...@stericsson.com wrote: >>> From: Sjur Brćndeland >>> >>> This reverts commit 8078db789a92b10ff6e2d713231b5367e014c53b. >>> >>> The reverted patch caused opening of ports

Re: [PATCH 1/2] virtio-scsi: use pr_err() instead of printk()

2013-03-12 Thread Rusty Russell
Paolo Bonzini writes: > Il 07/03/2013 04:29, Wanlong Gao ha scritto: >> Convert the virtio-scsi driver to use pr_err() instead of printk(). >> >> Signed-off-by: Wanlong Gao > > Acked-by: Paolo Bonzini Thanks, applied. Cheers, Rusty. ___ Virtualizat

Re: [PATCH] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"

2013-03-12 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: > From: Sjur Brændeland > > This reverts commit 8078db789a92b10ff6e2d713231b5367e014c53b. > > The reverted patch caused opening of ports to fail for rproc_serial. > In probe guest_connected was set to true, but port_fops_open() > fails with -EMFILE if guest_

Re: Opposite return values in vringh_notify_enable_kern() and virtqueue_enable_cb().

2013-03-12 Thread Rusty Russell
Sjur Brændeland writes: > Hi Rusty, > > The two similar functions in vringh and virtqueue for turning on > interrupts has opposite return values if there are buffers available > in the ring. I think it would be better if these two functions aligned > the use of return values. Maybe it's just me,

Re: virtio-s390: document GPR4/GPR2 cookie values

2013-03-12 Thread Rusty Russell
Cornelia Huck writes: > On Thu, 7 Mar 2013 20:02:21 +0200 > "Michael S. Tsirkin" wrote: > >> virtio-s390 on kvm can use a cookie value passed to guest > > s/virtio-s390/virtio-ccw/ (to avoid confusion with s390-virtio, which > was never specced) > >> to optimize channel/VQ lookups. >> Document th

drivers/vhost: sizing of ubuf_info and heads

2013-03-07 Thread Rusty Russell
Hi Michael, I'm a bit confused about why ubuf_info and heads are UIO_MAXIOV length arrays, rather than being the size of the ring? In particular, this is suspicious: linux/drivers/vhost/net.c:342: struct ubuf_info *ubuf = &vq->ubuf_info[head]; And it seems to assume we trust head: a ma

Re: [PATCH dontapply 0/2] tools/virtio updates for API testing

2013-03-07 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Here's a patchset to update tools/virtio with > changes in 3.8, as well as the proposed API extension. > > Useful to see whether the extra level of indirection > adds measureable overhead. > > I will upstream at least patch 1 soon. What happened to this, BTW? > Mic

Re: [PATCH 2/2] tools/virtio: make barriers stronger.

2013-03-07 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Mar 07, 2013 at 02:48:24PM +1100, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > On Wed, Mar 06, 2013 at 03:54:42PM +1100, Rusty Russell wrote: >> >> In the coming vringh_test, we share an mma

<    1   2   3   4   5   6   7   8   9   10   >