Re: [PATCH 8/9] qspinlock: Generic paravirt support

2015-04-02 Thread Peter Zijlstra
On Thu, Apr 02, 2015 at 07:20:57PM +0200, Peter Zijlstra wrote: pv_wait_head(): pv_hash() /* MB as per cmpxchg */ cmpxchg(l-locked, _Q_LOCKED_VAL, _Q_SLOW_VAL); VS __pv_queue_spin_unlock(): if (xchg(l-locked, 0) != _Q_SLOW_VAL) return;

Re: [PATCH 8/9] qspinlock: Generic paravirt support

2015-04-02 Thread Waiman Long
On 04/02/2015 03:48 PM, Peter Zijlstra wrote: On Thu, Apr 02, 2015 at 07:20:57PM +0200, Peter Zijlstra wrote: pv_wait_head(): pv_hash() /* MB as per cmpxchg */ cmpxchg(l-locked, _Q_LOCKED_VAL, _Q_SLOW_VAL); VS __pv_queue_spin_unlock(): if (xchg(l-locked, 0)

[PATCH net-next] virtio: document queue state logic

2015-04-02 Thread Michael S. Tsirkin
commit d631b94e7a15277858ec5f88d674d93080506999 virtio: change comment in transmit started clarifying the logic behind queue state management, but introduced an inaccuracy: TX_BUSY does not cause a BUG message. Clean this up some more, explaining the tradeoffs in detail. Signed-off-by:

[PATCH v2 0/7] vhost: support for cross endian guests

2015-04-02 Thread Greg Kurz
Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. It is a complete rework of my initial post. Patches 1 to 5 are preliminary work: we move the endianness check out of all memory accessors to separate functions. Patch 6 changes the

Re: [PATCH v2 7/7] vhost: feature to set the vring endianness

2015-04-02 Thread Michael S. Tsirkin
On Thu, Apr 02, 2015 at 03:17:13PM +0200, Greg Kurz wrote: This patch brings cross-endian support to vhost when used to implement legacy virtio devices. Since it is a relatively rare situation, the feature availability is controlled by a kernel config option (not set by default). If

[PATCH v2 3/7] macvtap: introduce macvtap_is_little_endian() helper

2015-04-02 Thread Greg Kurz
Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- drivers/net/macvtap.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 27ecc5c..a2f2958 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -49,14

[PATCH v2 1/7] virtio: introduce virtio_is_little_endian() helper

2015-04-02 Thread Greg Kurz
Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/linux/virtio_config.h | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index ca3ed78..bd1a582 100644 ---

[PATCH v2 4/7] vringh: introduce vringh_is_little_endian() helper

2015-04-02 Thread Greg Kurz
Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/linux/vringh.h | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/linux/vringh.h b/include/linux/vringh.h index a3fa537..3ed62ef 100644 --- a/include/linux/vringh.h +++

[PATCH v2 2/7] tun: add tun_is_little_endian() helper

2015-04-02 Thread Greg Kurz
Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- drivers/net/tun.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 857dca4..3c3d6c0 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -206,14 +206,19 @@ struct

[PATCH v2 5/7] vhost: introduce vhost_is_little_endian() helper

2015-04-02 Thread Greg Kurz
Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- drivers/vhost/vhost.h | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 8c1c792..6a49960 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h

Re: [PATCH v2 0/7] vhost: support for cross endian guests

2015-04-02 Thread Michael S. Tsirkin
On Thu, Apr 02, 2015 at 03:16:37PM +0200, Greg Kurz wrote: Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. It is a complete rework of my initial post. Patches 1 to 5 are preliminary work: we move the endianness check out of all

[PATCH v2 6/7] virtio: add explicit big-endian support to memory accessors

2015-04-02 Thread Greg Kurz
The current memory accessors logic is: - little endian if little_endian - native endian (i.e. no byteswap) if !little_endian If we want to fully support cross-endian vhost, we also need to be able to convert to big endian. Instead of changing the little_endian argument to some 3-value enum, this

[PATCH v2 7/7] vhost: feature to set the vring endianness

2015-04-02 Thread Greg Kurz
This patch brings cross-endian support to vhost when used to implement legacy virtio devices. Since it is a relatively rare situation, the feature availability is controlled by a kernel config option (not set by default). If cross-endian support is compiled in, vhost abvertises a new feature to

Re: [PATCH v2 3/4] Add virtio gpu driver.

2015-04-02 Thread Marc-André Lureau
Hi Gerd While doing some testing with your brance, I reached that: On Wed, Apr 1, 2015 at 3:15 PM, Gerd Hoffmann kra...@redhat.com wrote: +#define MAX_INLINE_CMD_SIZE 96 [ 750.446449] kernel BUG at drivers/gpu/drm/virtio/virtgpu_vq.c:132! [ 750.447005] Call Trace: [ 750.447005]

Re: [PATCH 8/9] qspinlock: Generic paravirt support

2015-04-02 Thread Peter Zijlstra
On Thu, Apr 02, 2015 at 12:28:30PM -0400, Waiman Long wrote: On 04/01/2015 05:03 PM, Peter Zijlstra wrote: On Wed, Apr 01, 2015 at 03:58:58PM -0400, Waiman Long wrote: On 04/01/2015 02:48 PM, Peter Zijlstra wrote: I am sorry that I don't quite get what you mean here. My point is that in the

Re: [PATCH v2 7/7] vhost: feature to set the vring endianness

2015-04-02 Thread Greg Kurz
On Thu, 2 Apr 2015 16:20:46 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Thu, Apr 02, 2015 at 03:17:13PM +0200, Greg Kurz wrote: This patch brings cross-endian support to vhost when used to implement legacy virtio devices. Since it is a relatively rare situation, the feature

Re: [PATCH 8/9] qspinlock: Generic paravirt support

2015-04-02 Thread Waiman Long
On 04/01/2015 05:03 PM, Peter Zijlstra wrote: On Wed, Apr 01, 2015 at 03:58:58PM -0400, Waiman Long wrote: On 04/01/2015 02:48 PM, Peter Zijlstra wrote: I am sorry that I don't quite get what you mean here. My point is that in the hashing step, a cpu will need to scan an empty bucket to put the

Re: [PATCH v2 7/7] vhost: feature to set the vring endianness

2015-04-02 Thread Michael S. Tsirkin
On Thu, Apr 02, 2015 at 06:45:27PM +0200, Greg Kurz wrote: On Thu, 2 Apr 2015 16:20:46 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Thu, Apr 02, 2015 at 03:17:13PM +0200, Greg Kurz wrote: This patch brings cross-endian support to vhost when used to implement legacy virtio