Re: [Virtio-fs] [virtiofsd PATCH v4 4/4] virtiofsd: support per-file DAX in FUSE_LOOKUP

2021-08-24 Thread Greg Kurz
On Fri, 20 Aug 2021 13:03:23 +0800 JeffleXu wrote: > > > On 8/19/21 9:08 PM, Dr. David Alan Gilbert wrote: > > * JeffleXu (jeffl...@linux.alibaba.com) wrote: > >> > >> > >> On 8/18/21 3:00 AM, Dr. David Alan Gilbert wrote: > >>> * Jeffle Xu (jeffl...@linux.alibaba.com) wrote: > For

Re: [PATCH v4 4/5] virtiofs: Skip submounts in sget_fc()

2021-05-21 Thread Greg Kurz
On Fri, 21 May 2021 14:37:25 +0200 Miklos Szeredi wrote: > On Fri, 21 May 2021 at 12:06, Greg Kurz wrote: > > > > On Fri, 21 May 2021 10:50:34 +0200 > > Miklos Szeredi wrote: > > > > > On Fri, 21 May 2021 at 10:39, Greg Kurz wrote: > > >

Re: [PATCH v4 5/5] virtiofs: propagate sync() to file server

2021-05-21 Thread Greg Kurz
On Thu, 20 May 2021 17:46:54 +0200 Greg Kurz wrote: > Even if POSIX doesn't mandate it, linux users legitimately expect > sync() to flush all data and metadata to physical storage when it > is located on the same system. This isn't happening with virtiofs > though : sync() insi

Re: [PATCH v4 4/5] virtiofs: Skip submounts in sget_fc()

2021-05-21 Thread Greg Kurz
On Fri, 21 May 2021 10:50:34 +0200 Miklos Szeredi wrote: > On Fri, 21 May 2021 at 10:39, Greg Kurz wrote: > > > > On Fri, 21 May 2021 10:26:27 +0200 > > Miklos Szeredi wrote: > > > > > On Thu, 20 May 2021 at 17:47, Greg Kurz wrote: > > > > >

Re: [PATCH v4 4/5] virtiofs: Skip submounts in sget_fc()

2021-05-21 Thread Greg Kurz
On Fri, 21 May 2021 10:26:27 +0200 Miklos Szeredi wrote: > On Thu, 20 May 2021 at 17:47, Greg Kurz wrote: > > > > All submounts share the same virtio-fs device instance as the root > > mount. If the same virtiofs filesystem is mounted again, sget_fc() > &g

Re: [PATCH v4 2/5] fuse: Call vfs_get_tree() for submounts

2021-05-21 Thread Greg Kurz
On Fri, 21 May 2021 10:19:48 +0200 Miklos Szeredi wrote: > On Thu, May 20, 2021 at 05:46:51PM +0200, Greg Kurz wrote: > > We don't set the SB_BORN flag on submounts superblocks. This is wrong > > as these superblocks are then considered as partially constructed or > &

Re: [PATCH v4 1/5] fuse: Fix leak in fuse_dentry_automount() error path

2021-05-21 Thread Greg Kurz
On Fri, 21 May 2021 09:54:19 +0200 Miklos Szeredi wrote: > On Thu, 20 May 2021 at 21:45, Al Viro wrote: > > > > On Thu, May 20, 2021 at 05:46:50PM +0200, Greg Kurz wrote: > > > Some rollback was forgotten during the addition of crossmounts. > > > > Have

Re: [PATCH v4 1/5] fuse: Fix leak in fuse_dentry_automount() error path

2021-05-21 Thread Greg Kurz
On Thu, 20 May 2021 19:45:13 + Al Viro wrote: > On Thu, May 20, 2021 at 05:46:50PM +0200, Greg Kurz wrote: > > Some rollback was forgotten during the addition of crossmounts. > > Have you actually tested that? Because I strongly suspect that > by that point the owne

[PATCH v4 5/5] virtiofs: propagate sync() to file server

2021-05-20 Thread Greg Kurz
USE file server is an untrusted piece of software running in userspace, this is disabled by default. Only enable it with virtiofs for now since virtiofsd is supposedly trusted by the guest kernel. Reported-by: Robert Krawitz Signed-off-by: Greg Kurz --- fs/fuse/fuse_i.h | 3 +++

[PATCH v4 0/5] virtiofs: propagate sync() to file server

2021-05-20 Thread Greg Kurz
(Miklos) v3: - just keep a 64-bit padding field in the arg struct (Vivek) v2: - clarify compatibility with older servers in changelog (Vivek) - ignore the wait == 0 case (Miklos) - 64-bit aligned argument structure (Vivek, Miklos) Greg Kurz (5): fuse: Fix leak in fuse_dentry_automount

[PATCH v4 3/5] fuse: Make fuse_fill_super_submount() static

2021-05-20 Thread Greg Kurz
This function used to be called from fuse_dentry_automount(). This code was moved to fuse_get_tree_submount() in the same file since then. It is unlikely there will ever be another user. No need to be extern in this case. Signed-off-by: Greg Kurz --- fs/fuse/fuse_i.h | 9 - fs/fuse

[PATCH v4 4/5] virtiofs: Skip submounts in sget_fc()

2021-05-20 Thread Greg Kurz
in virtio_fs_test_super(). Signed-off-by: Greg Kurz --- fs/fuse/virtio_fs.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index e12e5190352c..8962cd033016 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -1408,6 +1408,11 @@ static

[PATCH v4 2/5] fuse: Call vfs_get_tree() for submounts

2021-05-20 Thread Greg Kurz
with submounts : hijack it to pass the FUSE inode of the mount point down to fuse_get_tree_submount(). Finally, adapt virtiofs to use this. Signed-off-by: Greg Kurz --- fs/fuse/dir.c | 48 +++-- fs/fuse/fuse_i.h| 6 ++ fs/fuse/inode.c | 43

[PATCH v4 1/5] fuse: Fix leak in fuse_dentry_automount() error path

2021-05-20 Thread Greg Kurz
Some rollback was forgotten during the addition of crossmounts. Fixes: bf109c64040f ("fuse: implement crossmounts") Cc: mre...@redhat.com Signed-off-by: Greg Kurz --- fs/fuse/dir.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/fuse/dir.c b/fs/fuse/d

[PATCH v3] virtiofs: propagate sync() to file server

2021-05-05 Thread Greg Kurz
t. Only enable it with virtiofs for now since virtiofsd is supposedly trusted by the guest kernel. Reported-by: Robert Krawitz Signed-off-by: Greg Kurz --- v3: - just keep a 64-bit padding field in the arg struct (Vivek) v2: - clarify compatibility with older servers in changelog (Vivek) - ignor

Re: [PATCH v2] virtiofs: propagate sync() to file server

2021-04-30 Thread Greg Kurz
On Fri, 30 Apr 2021 08:17:57 -0400 Vivek Goyal wrote: > On Tue, Apr 27, 2021 at 09:09:21PM +0200, Greg Kurz wrote: > [..] > > > > diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h > > > > index 54442612c48b..1265ca17620c 100644 > >

Re: [PATCH v2] virtiofs: propagate sync() to file server

2021-04-27 Thread Greg Kurz
On Tue, 27 Apr 2021 13:12:06 -0400 Vivek Goyal wrote: > On Mon, Apr 26, 2021 at 05:10:11PM +0200, Greg Kurz wrote: > > Even if POSIX doesn't mandate it, linux users legitimately expect > > sync() to flush all data and metadata to physical storage when it > > is locat

[PATCH v2] virtiofs: propagate sync() to file server

2021-04-26 Thread Greg Kurz
t. Only enable it with virtiofs for now since virtiofsd is supposedly trusted by the guest kernel. Reported-by: Robert Krawitz Signed-off-by: Greg Kurz --- v2: - clarify compatibility with older servers in changelog (Vivek) - ignore the wait == 0 case (Miklos) - 64-bit aligned argument s

Re: [Virtio-fs] [PATCH] virtiofs: propagate sync() to file server

2021-04-21 Thread Greg Kurz
On Tue, 20 Apr 2021 14:42:26 -0400 Vivek Goyal wrote: > On Mon, Apr 19, 2021 at 05:08:48PM +0200, Greg Kurz wrote: > > Even if POSIX doesn't mandate it, linux users legitimately expect > > sync() to flush all data and metadata to physical storage when it > > is locat

[PATCH] virtiofs: propagate sync() to file server

2021-04-19 Thread Greg Kurz
l FUSE file server is an untrusted piece of software running in userspace, this is disabled by default. Only enable it with virtiofs for now since virtiofsd is supposedly trusted by the guest kernel. Reported-by: Robert Krawitz Signed-off-by: Greg Kurz --- Can be tested using the following custom QEMU with F

Re: [PATCH] vhost: fix initialization for vq->is_le

2017-02-01 Thread Greg Kurz
On Tue, 31 Jan 2017 16:56:13 +0100 Halil Pasic <pa...@linux.vnet.ibm.com> wrote: > On 01/30/2017 08:06 PM, Greg Kurz wrote: > >> Currently, under certain circumstances vhost_init_is_le does just a part > >> of the initialization job, and depends on vhost_reset_

Re: [PATCH] vhost: fix initialization for vq->is_le

2017-01-30 Thread Greg Kurz
t; Reported-by: Michael A. Tebolt <mi...@us.ibm.com> > Reported-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > Fixes: commit 2751c9882b94 ("vhost: cross-endian support for legacy devices") > --- Reviewed-by: Greg Kurz <gr...@kaod.org> > > The bug was alre

Re: [BUG/RFC] vhost: net: big endian viring access despite virtio 1

2017-01-27 Thread Greg Kurz
On Fri, 27 Jan 2017 13:24:13 +0100 Halil Pasic wrote: > On 01/26/2017 08:20 PM, Michael S. Tsirkin wrote: > > On Thu, Jan 26, 2017 at 06:39:14PM +0100, Halil Pasic wrote: > >> > >> Hi! > >> > >> Recently I have been investigating some strange migration problems on >

Re: [PATCH V4 0/3] basic busy polling support for vhost_net

2016-03-09 Thread Greg Kurz
On Fri, 4 Mar 2016 06:24:50 -0500 Jason Wang wrote: > This series tries to add basic busy polling for vhost net. The idea is > simple: at the end of tx/rx processing, busy polling for new tx added > descriptor and rx receive socket for a while. The maximum number of > time

Re: [PATCH v2 0/3] vhost: cross-endian code cleanup

2016-02-16 Thread Greg Kurz
On Tue, 16 Feb 2016 17:34:13 +0200 "Michael S. Tsirkin" <m...@redhat.com> wrote: > On Tue, Feb 16, 2016 at 03:54:18PM +0100, Greg Kurz wrote: > > This series is a new tentative to have cleaner cross-endian code. > > > > Patches 1/3 is new: it fixes a side-e

[PATCH v2 2/3] vhost: rename cross-endian helpers

2016-02-16 Thread Greg Kurz
e is started. The cross-endian mode is disabled when the device is stopped. The current names of the helpers that manipulate vq->user_be are unclear. This patch renames those helpers to clearly show that this is cross-endian stuff and with explicit enable/disable semantics. No behaviour change. Sign

[PATCH v2 3/3] vhost: rename vhost_init_used()

2016-02-16 Thread Greg Kurz
n't related to the vq used ring. This patch simply renames vhost_init_used() to vhost_vq_init_access() as suggested by Michael. No behaviour change. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- drivers/vhost/net.c |2 +- drivers/vhost/scsi.c |2 +- drivers/vhost/test.

[PATCH v2 1/3] vhost: fix error path in vhost_init_used()

2016-02-16 Thread Greg Kurz
We don't want side effects. If something fails, we rollback vq->is_le to its previous value. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- drivers/vhost/vhost.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vhost.c b/driv

[PATCH v2 0/3] vhost: cross-endian code cleanup

2016-02-16 Thread Greg Kurz
This series is a new tentative to have cleaner cross-endian code. Patches 1/3 is new: it fixes a side-effect in case vhost_init_used() fails. Patch 2/3 comes from v1: it renames cross-endian helpers Patch 3/3 is new: it simply renames vhost_init_used() as suggested by Michael. --- Greg Kurz

Re: [PATCH 2/2] vhost: disentangle vring endianness stuff from the core code

2016-02-10 Thread Greg Kurz
On Wed, 10 Feb 2016 14:23:33 +0100 Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > On Wed, 10 Feb 2016 14:08:43 +0100 > Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > > But you are right, there is a bug: we should rollback if vhost_init_used() >

Re: [PATCH 1/2] vhost: helpers to enable/disable vring endianness

2016-02-10 Thread Greg Kurz
On Wed, 10 Feb 2016 17:08:52 +0200 "Michael S. Tsirkin" <m...@redhat.com> wrote: > On Wed, Feb 10, 2016 at 01:11:34PM +0100, Greg Kurz wrote: > > On Wed, 10 Feb 2016 13:21:22 +0200 > > "Michael S. Tsirkin" <m...@redhat.com> wrote: > > >

Re: [PATCH 1/2] vhost: helpers to enable/disable vring endianness

2016-02-10 Thread Greg Kurz
On Wed, 10 Feb 2016 13:21:22 +0200 "Michael S. Tsirkin" <m...@redhat.com> wrote: > On Wed, Jan 13, 2016 at 06:09:41PM +0100, Greg Kurz wrote: > > The default use case for vhost is when the host and the vring have the > > same endianness (default native endiann

Re: [PATCH 2/2] vhost: disentangle vring endianness stuff from the core code

2016-02-10 Thread Greg Kurz
On Wed, 10 Feb 2016 13:48:09 +0200 "Michael S. Tsirkin" <m...@redhat.com> wrote: > On Wed, Jan 13, 2016 at 06:09:47PM +0100, Greg Kurz wrote: > > The way vring endianness is being handled currently obfuscates > > the code in vhost_init_used(). > > >

[PATCH 2/2] vhost: disentangle vring endianness stuff from the core code

2016-01-13 Thread Greg Kurz
. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- drivers/vhost/net.c |3 +++ drivers/vhost/scsi.c |3 +++ drivers/vhost/test.c |2 ++ drivers/vhost/vhost.c | 16 +++- drivers/vhost/vhost.h |1 + 5 files changed, 20 insertions(+), 5 deletions(-) diff

[PATCH 0/2] vhost: cross-endian code cleanup

2016-01-13 Thread Greg Kurz
code, which DTRT according to vq->private_data, as suggested by Michael. --- Greg Kurz (2): vhost: helpers to enable/disable vring endianness vhost: disentangle vring endianness stuff from the core code drivers/vhost/net.c |3 +++ drivers/vhost/scsi.c |3 +++ drivers/vh

[PATCH 1/2] vhost: helpers to enable/disable vring endianness

2016-01-13 Thread Greg Kurz
g endianness. This endianness is then enforced for vring accesses through vq->is_le again The logic is unclear in the current code. This patch introduces helpers with explicit enable and disable semantics, for better clarity. No behaviour change. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm

Re: [PATCH] vhost: move is_le setup to the backend

2016-01-12 Thread Greg Kurz
On Tue, 12 Jan 2016 12:01:32 +0200 "Michael S. Tsirkin" <m...@redhat.com> wrote: > On Mon, Jan 11, 2016 at 03:39:38PM +0100, Greg Kurz wrote: > > The vq->is_le field is used to fix endianness when accessing the vring via > > the cpu_to_vhost16() and vhost16_to_cp

[PATCH] vhost: move is_le setup to the backend

2016-01-11 Thread Greg Kurz
iour change. Reviewed-by: Cornelia Huck <cornelia.h...@de.ibm.com> Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- Hi Michael, This is a cleanup patch I had posted last year: http://patchwork.ozlabs.org/patch/538277/ I am just reposting with Cornelia's R-b. Cheers. -- G

Re: [PATCH] vhost: move is_le setup to the backend

2015-12-16 Thread Greg Kurz
On Thu, 12 Nov 2015 15:28:19 +0100 Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > On Thu, 12 Nov 2015 15:46:30 +0200 > "Michael S. Tsirkin" <m...@redhat.com> wrote: > > > On Fri, Oct 30, 2015 at 12:42:35PM +0100, Greg Kurz wrote: > > > The vq->is_

Re: [PATCH] tools/virtio: fix byteswap logic

2015-11-30 Thread Greg Kurz
ut didn't > update tools/virtio, so vring_bench started failing. > Oops... yet another oversight... > Update the copy under tools/virtio/ (TODO: find a way to avoid this code > duplication). > > Cc: Greg Kurz <gk...@linux.vnet.ibm.com> > Signed-off-by: Michael

Re: [PATCH] vhost: move is_le setup to the backend

2015-11-12 Thread Greg Kurz
On Fri, 30 Oct 2015 12:42:35 +0100 Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > The vq->is_le field is used to fix endianness when accessing the vring via > the cpu_to_vhost16() and vhost16_to_cpu() helpers in the following cases: > > 1) host is big endian and device is

[PATCH] vhost: move is_le setup to the backend

2015-10-30 Thread Greg Kurz
ur change. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- drivers/vhost/net.c |6 ++ drivers/vhost/scsi.c |3 +++ drivers/vhost/test.c |2 ++ drivers/vhost/vhost.c | 12 +++- drivers/vhost/vhost.h |1 + 5 files changed, 19 insertions(+), 5 deleti

Re: [PATCH] vhost: fix performance on LE hosts

2015-10-27 Thread Greg Kurz
on LE host, vhost_is_little_endian is > checking is_le flag so there's always a branch. > > To fix, simply check virtio_legacy_is_little_endian first. > > Cc: Greg Kurz <gk...@linux.vnet.ibm.com> > Signed-off-by: Michael S. Tsirkin <m...@redhat.com> Oops my bad for th

Re: [PATCH v2] Fix AF_PACKET ABI breakage in 4.2

2015-09-25 Thread Greg Kurz
On Thu, 24 Sep 2015 12:50:59 +0300 "Michael S. Tsirkin" <m...@redhat.com> wrote: > On Thu, Sep 24, 2015 at 09:25:45AM +0200, Greg Kurz wrote: > > On Wed, 23 Sep 2015 19:45:08 +0100 > > David Woodhouse <dw...@infradead.org> wrote: > > > > > C

Re: [PATCH v2] Fix AF_PACKET ABI breakage in 4.2

2015-09-24 Thread Greg Kurz
On Wed, 23 Sep 2015 19:45:08 +0100 David Woodhouse wrote: > Commit 7d82410950aa ("virtio: add explicit big-endian support to memory > accessors") accidentally changed the virtio_net header used by > AF_PACKET with PACKET_VNET_HDR from host-endian to big-endian. > Hi David,

Re: [PATCH] KVM: Add Kconfig option to signal cross-endian guests

2015-07-13 Thread Greg Kurz
On Thu, 9 Jul 2015 09:49:05 +0200 Thomas Huth th...@redhat.com wrote: The option for supporting cross-endianness legacy guests in the vhost and tun code should only be available on systems that support cross-endian guests. Signed-off-by: Thomas Huth th...@redhat.com Acked-by: Greg Kurz gk

Re: [PULL] virtio/vhost: cross endian support

2015-07-02 Thread Greg Kurz
On Thu, 2 Jul 2015 08:01:28 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jul 01, 2015 at 12:02:50PM -0700, Linus Torvalds wrote: On Wed, Jul 1, 2015 at 2:31 AM, Michael S. Tsirkin m...@redhat.com wrote: virtio/vhost: cross endian support Ugh. Does this really have to be

Re: [PATCH v6 0/8] vhost: support for cross endian guests

2015-05-26 Thread Greg Kurz
On Tue, 12 May 2015 12:52:55 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, May 12, 2015 at 12:44:26PM +0200, Greg Kurz wrote: On Fri, 24 Apr 2015 15:31:54 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Apr 24, 2015 at 02:24:15PM +0200, Greg Kurz wrote: Only

Re: [PATCH v6 0/8] vhost: support for cross endian guests

2015-05-12 Thread Greg Kurz
On Fri, 24 Apr 2015 15:31:54 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Apr 24, 2015 at 02:24:15PM +0200, Greg Kurz wrote: Only cosmetic and documentation changes since v5. --- Looks sane to me. I plan to review and apply next week. Hi Michael, I realize you just got

Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check

2015-05-12 Thread Greg Kurz
On Tue, 12 May 2015 15:14:53 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Wed, 06 May 2015 14:07:37 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: Unlike with add and clear, there is no valid reason to abort when checking for a feature. It makes more sense to return false (i.e

[PATCH RFC 1/7] virtio: relax feature check

2015-05-06 Thread Greg Kurz
VIRTIO_F_VERSION_1, even if they are still not implemented. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/hw/virtio/virtio.h |1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index d95f8b6..6ef70f1 100644 --- a/include/hw

[PATCH RFC 0/7] vhost: cross-endian support (vhost-net only)

2015-05-06 Thread Greg Kurz
endian Greg Kurz (6): virtio: relax feature check linux-headers: sync vhost.h virtio: introduce virtio_legacy_is_cross_endian() vhost: set vring endianness for legacy virtio tap: add VNET_LE/VNET_BE operations vhost-net: tell tap backend about the vnet endianness

[PATCH RFC 2/7] linux-headers: sync vhost.h

2015-05-06 Thread Greg Kurz
This patch brings the cross-endian vhost API to QEMU. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- linux-headers/linux/vhost.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h index c656f61..ead86db 100644

[PATCH RFC 3/7] virtio: introduce virtio_legacy_is_cross_endian()

2015-05-06 Thread Greg Kurz
This helper will be used by vhost and tap to detect cross-endianness in the legacy virtio case. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/hw/virtio/virtio-access.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/hw/virtio/virtio-access.h b

[PATCH RFC 5/7] tap: add VNET_LE/VNET_BE operations

2015-05-06 Thread Greg Kurz
The linux tap and macvtap backends can be told to parse vnet headers according to little or big endian. This is done through the TUNSETVNETLE and TUNSETVNETBE ioctls. This patch brings all the plumbing for QEMU to use these APIs. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/net

[PATCH RFC 4/7] vhost: set vring endianness for legacy virtio

2015-05-06 Thread Greg Kurz
Legacy virtio is native endian: if the guest and host endianness differ, we have to tell vhost so it can swap bytes where appropriate. This is done through a vhost ring ioctl. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/virtio/vhost.c | 50

[PATCH RFC 7/7] vhost_net: re-enable when cross endian

2015-05-06 Thread Greg Kurz
From: Cédric Le Goater c...@fr.ibm.com Cross-endianness is now checked by the core vhost code. revert 371df9f5e0f1 vhost-net: disable when cross-endian Signed-off-by: Cédric Le Goater c...@fr.ibm.com [ added commit message, Greg Kurz gk...@linux.vnet.ibm.com ] Signed-off-by: Greg Kurz gk

[PATCH RFC 6/7] vhost-net: tell tap backend about the vnet endianness

2015-05-06 Thread Greg Kurz
The default behaviour for TAP/MACVTAP is to consider vnet as native endian. This patch handles the cases when this is not true: - virtio 1.0: always little-endian - legacy cross-endian Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/net/vhost_net.c | 33

Re: [PATCH v5 6/8] virtio: add explicit big-endian support to memory accessors

2015-04-24 Thread Greg Kurz
On Fri, 24 Apr 2015 09:04:21 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Thu, 23 Apr 2015 21:27:19 +0200 Thomas Huth th...@redhat.com wrote: Thomas's e-mail did not make it to my mailbox... weird. :-\ On Thu, 23 Apr 2015 17:29:06 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote

Re: [PATCH v5 7/8] vhost: cross-endian support for legacy devices

2015-04-24 Thread Greg Kurz
On Fri, 24 Apr 2015 09:19:26 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Thu, 23 Apr 2015 17:29:42 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: This patch brings cross-endian support to vhost when used to implement legacy virtio devices. Since it is a relatively rare

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

2015-04-24 Thread Greg Kurz
, this patch changes the logic to: - little endian if little_endian - big endian if !little_endian The native endian case is handled by all users with a trivial helper. This patch doesn't change any functionality, nor it does add overhead. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- Changes

[PATCH v6 0/8] vhost: support for cross endian guests

2015-04-24 Thread Greg Kurz
Only cosmetic and documentation changes since v5. --- Greg Kurz (8): virtio: introduce virtio_is_little_endian() helper tun: add tun_is_little_endian() helper macvtap: introduce macvtap_is_little_endian() helper vringh: introduce vringh_is_little_endian() helper

[PATCH v6 5/8] vhost: introduce vhost_is_little_endian() helper

2015-04-24 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

[PATCH v6 4/8] vringh: introduce vringh_is_little_endian() helper

2015-04-24 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 +++ b/include/linux

[PATCH v6 2/8] tun: add tun_is_little_endian() helper

2015-04-24 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 v6 1/8] virtio: introduce virtio_is_little_endian() helper

2015-04-24 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 --- a/include/linux

[PATCH v6 3/8] macvtap: introduce macvtap_is_little_endian() helper

2015-04-24 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 v6 8/8] macvtap/tun: cross-endian support for little-endian hosts

2015-04-24 Thread Greg Kurz
, little-endian wins. Since this is isn't a common usecase, the feature is controlled by a kernel config option (not set by default). Both macvtap and tun are covered by this patch since they share the same API with userland. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- Changes since v5

[PATCH v5 1/8] virtio: introduce virtio_is_little_endian() helper

2015-04-23 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 --- a/include/linux

[PATCH v5 2/8] tun: add tun_is_little_endian() helper

2015-04-23 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 v5 3/8] macvtap: introduce macvtap_is_little_endian() helper

2015-04-23 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 v5 4/8] vringh: introduce vringh_is_little_endian() helper

2015-04-23 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 +++ b/include/linux

[PATCH v5 5/8] vhost: introduce vhost_is_little_endian() helper

2015-04-23 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

[PATCH v5 7/8] vhost: cross-endian support for legacy devices

2015-04-23 Thread Greg Kurz
that userspace may request a specific endianness. This field is used to override the default when activating the ring of a legacy device. It has no effect on modern devices. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- Changes since v4: - rewrote patch title to mention cross-endian

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

2015-04-23 Thread Greg Kurz
, this patch changes the logic to: - little endian if little_endian - big endian if !little_endian The native endian case is handled by all users with a trivial helper. This patch doesn't change any functionality, nor it does add overhead. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- Changes

[PATCH v5 8/8] macvtap/tun: cross-endian support for little-endian hosts

2015-04-23 Thread Greg Kurz
, little-endian wins. Since this is isn't a common usecase, the feature is controlled by a kernel config option (not set by default). Both macvtap and tun are covered by this patch since they share the same API with userland. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- Changes since v4

[PATCH v5 0/8] vhost: support for cross endian guests

2015-04-23 Thread Greg Kurz
from a ppc64 to a ppc64le host and back. No regressions on x86 as expected. My experimental QEMU tree is here: https://github.com/gkurz/qemu.git vhost/cross-endian I'd be glad if this series could make it to 4.1. Cheers. --- Greg Kurz (8): virtio: introduce virtio_is_little_endian

Re: [PATCH v4 0/8] vhost: support for cross endian guests

2015-04-21 Thread Greg Kurz
On Fri, 17 Apr 2015 11:18:13 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: On Fri, 10 Apr 2015 12:15:00 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patch 7 got

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

2015-04-21 Thread Greg Kurz
On Tue, 7 Apr 2015 17:56:25 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Apr 07, 2015 at 02:15:52PM +0200, Greg Kurz wrote: 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

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

2015-04-21 Thread Greg Kurz
On Tue, 21 Apr 2015 16:04:23 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Apr 10, 2015 at 12:19:16PM +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 v4 8/8] macvtap/tun: add VNET_BE flag

2015-04-21 Thread Greg Kurz
On Tue, 21 Apr 2015 16:06:33 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Apr 10, 2015 at 12:20:21PM +0200, Greg Kurz wrote: The VNET_LE flag was introduced to fix accesses to virtio 1.0 headers that are always little-endian. It can also be used to handle the special case

Re: [PATCH v4 6/8] virtio: add explicit big-endian support to memory accessors

2015-04-21 Thread Greg Kurz
On Tue, 21 Apr 2015 16:09:44 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Apr 10, 2015 at 12:16:20PM +0200, Greg Kurz wrote: 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

Re: [PATCH v4 0/8] vhost: support for cross endian guests

2015-04-21 Thread Greg Kurz
On Tue, 21 Apr 2015 16:10:18 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Apr 10, 2015 at 12:15:00PM +0200, Greg Kurz wrote: Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patch 7 got rewritten according

Re: [PATCH v4 0/8] vhost: support for cross endian guests

2015-04-17 Thread Greg Kurz
On Fri, 10 Apr 2015 12:15:00 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patch 7 got rewritten according to Cornelia's and Michael's comments. I have also introduced patch 8

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

2015-04-14 Thread Greg Kurz
On Tue, 14 Apr 2015 16:20:23 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Fri, 10 Apr 2015 12:19:16 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: This patch brings cross-endian support to vhost when used to implement legacy virtio devices. Since it is a relatively rare

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

2015-04-08 Thread Greg Kurz
On Tue, 7 Apr 2015 17:52:28 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Apr 07, 2015 at 02:19:31PM +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 v3 7/7] vhost: feature to set the vring endianness

2015-04-08 Thread Greg Kurz
On Tue, 7 Apr 2015 17:01:31 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Tue, 07 Apr 2015 14:19:31 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: This patch brings cross-endian support to vhost when used to implement legacy virtio devices. Since it is a relatively rare

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

2015-04-08 Thread Greg Kurz
On Tue, 7 Apr 2015 18:11:29 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Apr 07, 2015 at 02:19:31PM +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

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

2015-04-07 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 v3 0/7] vhost: support for cross endian guests

2015-04-07 Thread Greg Kurz
Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patches 1-6 remain the same as the previous post. Patch 7 was heavily changed according to MST's comments. --- Greg Kurz (7): virtio: introduce virtio_is_little_endian() helper

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

2015-04-07 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 --- a/include/linux

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

2015-04-07 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 v3 6/7] virtio: add explicit big-endian support to memory accessors

2015-04-07 Thread Greg Kurz
, this patch changes the logic to: - little endian if little_endian - big endian if !little_endian The native endian case is handled by all users with a trivial helper. This patch doesn't change any functionality, nor it does add overhead. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- drivers

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

2015-04-07 Thread Greg Kurz
are returned EPERM. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- drivers/vhost/Kconfig | 10 drivers/vhost/vhost.c | 55 drivers/vhost/vhost.h | 17 +- include/uapi/linux/vhost.h |5 4 files

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

2015-04-07 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 +++ b/include/linux

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

2015-04-07 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 v3 0/7] vhost: support for cross endian guests

2015-04-07 Thread Greg Kurz
On Tue, 7 Apr 2015 17:55:08 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Apr 07, 2015 at 02:09:29PM +0200, Greg Kurz wrote: Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patches 1-6 remain the same

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

2015-04-02 Thread Greg Kurz
vnet headers was dropped for the moment. As a consequnce, vhost_net still fails to work with cross-endian. It will be fixed in another patchset I'm currently working on. --- Greg Kurz (7): virtio: introduce virtio_is_little_endian() helper tun: add tun_is_little_endian() helper

[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 --- a/include/linux

  1   2   >