[Qemu-devel] [PATCH] vhost-user: verify that number of queues is less than MAX_QUEUE_NUM

2016-02-24 Thread Ilya Maximets
Fix QEMU crash when -netdev vhost-user,queues=n is passed with number of queues greater than MAX_QUEUE_NUM. Signed-off-by: Ilya Maximets <i.maxim...@samsung.com> --- net/vhost-user.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-

Re: [Qemu-devel] [PATCH 0/4] Fix QEMU crash on vhost-user socket disconnect.

2016-03-31 Thread Ilya Maximets
On 30.03.2016 20:01, Michael S. Tsirkin wrote: > On Wed, Mar 30, 2016 at 06:14:05PM +0300, Ilya Maximets wrote: >> Currently QEMU always crashes in following scenario (assume that >> vhost-user application is Open vSwitch with 'dpdkvhostuser' port): > > In fact, wouldn't

Re: [Qemu-devel] [PATCH 0/4] Fix QEMU crash on vhost-user socket disconnect.

2016-04-06 Thread Ilya Maximets
--- Original Message --- Sender : Michael S. Tsirkin<m...@redhat.com> Date : Apr 05, 2016 13:46 (GMT+03:00) Title : Re: [PATCH 0/4] Fix QEMU crash on vhost-user socket disconnect. > On Thu, Mar 31, 2016 at 09:02:01AM +0300, Ilya Maximets wrote: > > On 30.03.2016 20:01, Mic

Re: [Qemu-devel] [PATCH 0/4] Fix QEMU crash on vhost-user socket disconnect.

2016-04-07 Thread Ilya Maximets
> --- Original Message --- > Sender : Michael S. Tsirkin<m...@redhat.com> > Date : Apr 07, 2016 10:01 (GMT+03:00) > Title : Re: Re: [PATCH 0/4] Fix QEMU crash on vhost-user socket disconnect. > > On Wed, Apr 06, 2016 at 11:52:56PM +, Ilya Maximets wrote: >

[Qemu-devel] [PATCH 0/4] Fix QEMU crash on vhost-user socket disconnect.

2016-03-30 Thread Ilya Maximets
ether 00:16:35:af:aa:4b brd ff:ff:ff:ff:ff:ff 7. QEMU may be gracefully restarted to restore communication after restarting of vhost-user application. Ilya Maximets (4): vhost-user: fix crash on socket disconnect. vhost: prevent double stop of vhost_net device. vhost: check for vhost_

[Qemu-devel] [PATCH 3/4] vhost: check for vhost_net device validity.

2016-03-30 Thread Ilya Maximets
UP> mtu 1500 qdisc <...> link/ether 00:16:35:af:aa:4b brd ff:ff:ff:ff:ff:ff [ cut -------] Signed-off-by: Ilya Maximets <i.maxim...@samsung.com> --- hw/net/vhost_net.c | 18 +- 1 file changed, 17 insert

[Qemu-devel] [PATCH 4/4] net: notify about link status only if it changed.

2016-03-30 Thread Ilya Maximets
No need to notify nc->peer if nothing changed. Signed-off-by: Ilya Maximets <i.maxim...@samsung.com> --- net/net.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/net.c b/net/net.c index 3b5a142..6f6a8ce 100644 --- a/net/net.c +++ b/net/net.c @@ -1385,9

[Qemu-devel] [PATCH 1/4] vhost-user: fix crash on socket disconnect.

2016-03-30 Thread Ilya Maximets
#8 virtio_net_set_status #9 virtio_set_status <...> [ cut ---] Fix that by introducing of reference counter for vhost_net device and freeing memory only after dropping of last reference. Signed-off-by: Ilya Maximets <i.maxim...@samsung.com> --- h

[Qemu-devel] [PATCH 2/4] vhost: prevent double stop of vhost_net device.

2016-03-30 Thread Ilya Maximets
---] In example above assertion will fail when control will be brought back to function at #17 and it will try to free 'eventfd' that was already freed at call #3. Fix that by disallowing execution of vhost_net_stop() if we're already inside of it. Signed-off-by: Ilya Maximets <i.

Re: [Qemu-devel] [PATCH 0/4] Fix QEMU crash on vhost-user socket disconnect.

2016-03-31 Thread Ilya Maximets
On 31.03.2016 12:21, Michael S. Tsirkin wrote: > On Thu, Mar 31, 2016 at 09:02:01AM +0300, Ilya Maximets wrote: >> On 30.03.2016 20:01, Michael S. Tsirkin wrote: >>> On Wed, Mar 30, 2016 at 06:14:05PM +0300, Ilya Maximets wrote: >>>> Currently QEMU always crashes

Re: [Qemu-devel] [v5, 09/31] vhost: fix calling vhost_dev_cleanup() after vhost_dev_init()

2016-07-25 Thread Ilya Maximets
t;nvqs; ++i) { +for (i = 0; i < hdev->nvqs; ++i, ++n_initialized_vqs) { r = vhost_virtqueue_init(hdev, hdev->vqs + i, hdev->vq_index + i); if (r < 0) { -hdev->nvqs = i; goto fail; } } @@ -1136,6 +1137,7 @@ fail_busyloop: vhost_virtque

Re: [Qemu-devel] [v5, 09/31] vhost: fix calling vhost_dev_cleanup() after vhost_dev_init()

2016-07-25 Thread Ilya Maximets
9 @@ int vhost_dev_init(struct vhost_dev *hdev, void >>>> *opaque, >>>> VhostBackendType backend_type, uint32_t >>>> busyloop_timeout) >>>> { >>>> uint64_t features; >>>> -int i, r; >>>> +int i, r, n_initialized_vqs; >>>> >>>> +n_initialized_vqs = 0; >>>> hdev->migration_blocker = NULL; >>>> >>>> r = vhost_set_backend_type(hdev, backend_type); >>>> >>>> @@ -1069,10 +1071,9 @@ int vhost_dev_init(struct vhost_dev *hdev, void >>>> *opaque, >>>> goto fail; >>>> } >>>> >>>> -for (i = 0; i < hdev->nvqs; ++i) { >>>> +for (i = 0; i < hdev->nvqs; ++i, ++n_initialized_vqs) { >>>> r = vhost_virtqueue_init(hdev, hdev->vqs + i, hdev->vq_index + >>>> i); >>>> if (r < 0) { >>>> -hdev->nvqs = i; >>> >>> Isn't that assignment doing the same thing? >> >> Yes. >> But assignment to zero (hdev->nvqs = 0) required before all previous >> 'goto fail;' instructions. I think, it's not a clean solution. >> > > Good point, I'll squash your change, Thanks for fixing it. > should I add your sign-off-by? I don't mind if you want to. Best regards, Ilya Maximets.

Re: [Qemu-devel] [v5, 09/31] vhost: fix calling vhost_dev_cleanup() after vhost_dev_init()

2016-07-25 Thread Ilya Maximets
_backend_type(hdev, backend_type); >> >> @@ -1069,10 +1071,9 @@ int vhost_dev_init(struct vhost_dev *hdev, void >> *opaque, >> goto fail; >> } >> >> -for (i = 0; i < hdev->nvqs; ++i) { >> +for (i = 0; i < hdev->nvqs; ++i, ++n_initialized_vqs) { >> r = vhost_virtqueue_init(hdev, hdev->vqs + i, hdev->vq_index + i); >> if (r < 0) { >> -hdev->nvqs = i; > > Isn't that assignment doing the same thing? Yes. But assignment to zero (hdev->nvqs = 0) required before all previous 'goto fail;' instructions. I think, it's not a clean solution. > btw, thanks for the review > >> goto fail; >> } >> } >> @@ -1136,6 +1137,7 @@ fail_busyloop: >> vhost_virtqueue_set_busyloop_timeout(hdev, hdev->vq_index + i, 0); >> } >> fail: >> +hdev->nvqs = n_initialized_vqs; >> vhost_dev_cleanup(hdev); >> return r; >> } >> -- >> >> Best regards, Ilya Maximets. >> > >

Re: [Qemu-devel] [v5, 17/31] vhost-user: keep vhost_net after a disconnection

2016-07-25 Thread Ilya Maximets
es(NetClientState *nc) { VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc); assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_USER); -return s->vhost_net ? vhost_net_get_acked_features(s->vhost_net) : 0; +return s->acked_features; } static void vhost_user_stop(int queues, NetClientState *ncs[]) @@ -55,6 +56,11 @@ static void vhost_user_stop(int queues, NetClientState *ncs[]) s = DO_UPCAST(VhostUserState, nc, ncs[i]); if (s->vhost_net) { +/* save acked features */ +uint64_t features = vhost_net_get_acked_features(s->vhost_net); +if (features) { +s->acked_features = features; +} vhost_net_cleanup(s->vhost_net); } } -- Best regards, Ilya Maximets.

[Qemu-devel] [PATCH] vhost: check for vhost_ops before using.

2016-08-02 Thread Ilya Maximets
. Signed-off-by: Ilya Maximets <i.maxim...@samsung.com> --- hw/net/vhost_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index dc61dc1..f2d49ad 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -428,7 +428,7

Re: [Qemu-devel] [PATCH] vhost: fix crash on virtio_error while device stop

2017-12-14 Thread Ilya Maximets
On 14.12.2017 17:31, Ilya Maximets wrote: > One update for the testing scenario: > > No need to kill OVS. The issue reproducible with simple 'del-port' > and 'add-port'. virtio driver in guest could crash on both operations. > Most times it crashes in my case on 'add-port'

Re: [Qemu-devel] [PATCH] vhost: fix crash on virtio_error while device stop

2017-12-14 Thread Ilya Maximets
st regards, Ilya Maximets. P.S. Previously I mentioned that I can not reproduce virtio driver crash with "[PATCH] virtio_error: don't invoke status callbacks" applied. I was wrong. I can reproduce now. System was misconfigured. Sorry. On 14.12.2017 12:01, Maxime Coque

Re: [Qemu-devel] [PATCH] vhost: fix crash on virtio_error while device stop

2017-12-13 Thread Ilya Maximets
On 11.12.2017 07:35, Michael S. Tsirkin wrote: > On Fri, Dec 08, 2017 at 05:54:18PM +0300, Ilya Maximets wrote: >> On 07.12.2017 20:27, Michael S. Tsirkin wrote: >>> On Thu, Dec 07, 2017 at 09:39:36AM +0300, Ilya Maximets wrote: >>>> On 06.12.2017 19:45, Michael S. Ts

Re: [Qemu-devel] [PATCH] virtio_error: don't invoke status callbacks

2017-12-18 Thread Ilya Maximets
On 13.12.2017 23:03, Michael S. Tsirkin wrote: > Backends don't need to know what frontend requested a reset, > and notifying then from virtio_error is messy because > virtio_error itself might be invoked from backend. > > Let's just set the status directly. > > Repor

Re: [Qemu-devel] [PATCH] vhost: fix crash on virtio_error while device stop

2017-12-13 Thread Ilya Maximets
On 13.12.2017 22:48, Michael S. Tsirkin wrote: > On Wed, Dec 13, 2017 at 04:45:20PM +0300, Ilya Maximets wrote: >>>> That >>>> looks very strange. Some of the functions gets 'old_status', others >>>> the 'new_status'. I'm a bit confused. >>> &g

Re: [Qemu-devel] [PATCH] vhost: fix crash on virtio_error while device stop

2017-12-08 Thread Ilya Maximets
On 07.12.2017 20:27, Michael S. Tsirkin wrote: > On Thu, Dec 07, 2017 at 09:39:36AM +0300, Ilya Maximets wrote: >> On 06.12.2017 19:45, Michael S. Tsirkin wrote: >>> On Wed, Dec 06, 2017 at 04:06:18PM +0300, Ilya Maximets wrote: >>>> In case virtio error occured

Re: [Qemu-devel] [PATCH] vhost: fix crash on virtio_error while device stop

2017-12-06 Thread Ilya Maximets
On 06.12.2017 19:45, Michael S. Tsirkin wrote: > On Wed, Dec 06, 2017 at 04:06:18PM +0300, Ilya Maximets wrote: >> In case virtio error occured after vhost_dev_close(), qemu will crash >> in nested cleanup while checking IOMMU flag because dev->vdev already >> set to zero a

[Qemu-devel] [PATCH] vhost: fix crash on virtio_error while device stop

2017-12-06 Thread Ilya Maximets
ble double frees and segmentation faults doue to using of already freed resources by setting 'vhost_started' flag to zero prior to 'vhost_net_stop' call. Signed-off-by: Ilya Maximets <i.maxim...@samsung.com> --- This issue was already addressed more than a year ago by the following patch: https://lists.gnu

Re: [Qemu-devel] [PATCH] virtio: add support for in-order feature

2018-08-14 Thread Ilya Maximets
On 13.08.2018 18:35, Michael S. Tsirkin wrote: > On Mon, Aug 13, 2018 at 06:28:06PM +0300, Ilya Maximets wrote: >> On 13.08.2018 12:56, Michael S. Tsirkin wrote: >>> On Mon, Aug 13, 2018 at 10:55:23AM +0300, Ilya Maximets wrote: >>>> On 10.08.2018 22:19, Michael S. Ts

Re: [Qemu-devel] [PATCH] virtio: add support for in-order feature

2018-08-13 Thread Ilya Maximets
On 10.08.2018 22:19, Michael S. Tsirkin wrote: > On Fri, Aug 10, 2018 at 02:04:47PM +0300, Ilya Maximets wrote: >> On 10.08.2018 12:34, Michael S. Tsirkin wrote: >>> On Fri, Aug 10, 2018 at 11:28:47AM +0300, Ilya Maximets wrote: >>>> On 10.08.2018 01:51, Michael S. Ts

Re: [Qemu-devel] [PATCH] virtio: add support for in-order feature

2018-08-13 Thread Ilya Maximets
On 13.08.2018 12:56, Michael S. Tsirkin wrote: > On Mon, Aug 13, 2018 at 10:55:23AM +0300, Ilya Maximets wrote: >> On 10.08.2018 22:19, Michael S. Tsirkin wrote: >>> On Fri, Aug 10, 2018 at 02:04:47PM +0300, Ilya Maximets wrote: >>>> On 10.08.2018 12:34, Michael S. Ts

Re: [Qemu-devel] [PATCH] virtio: add support for in-order feature

2018-08-10 Thread Ilya Maximets
On 10.08.2018 01:51, Michael S. Tsirkin wrote: > On Thu, Aug 09, 2018 at 07:54:37PM +0300, Ilya Maximets wrote: >> New feature bit for in-order feature of the upcoming >> virtio 1.1. It's already supported by DPDK vhost-user >> and virtio implementations. These changes require

Re: [Qemu-devel] [PATCH] virtio: add support for in-order feature

2018-08-10 Thread Ilya Maximets
On 10.08.2018 11:28, Ilya Maximets wrote: > On 10.08.2018 01:51, Michael S. Tsirkin wrote: >> On Thu, Aug 09, 2018 at 07:54:37PM +0300, Ilya Maximets wrote: >>> New feature bit for in-order feature of the upcoming >>> virtio 1.1. It's already supported by DPD

[Qemu-devel] [PATCH] virtio: add support for in-order feature

2018-08-09 Thread Ilya Maximets
New feature bit for in-order feature of the upcoming virtio 1.1. It's already supported by DPDK vhost-user and virtio implementations. These changes required to allow feature negotiation. Signed-off-by: Ilya Maximets --- I just wanted to test this new feature in DPDK but failed to found

Re: [Qemu-devel] [PATCH] virtio: add support for in-order feature

2018-08-10 Thread Ilya Maximets
On 10.08.2018 12:34, Michael S. Tsirkin wrote: > On Fri, Aug 10, 2018 at 11:28:47AM +0300, Ilya Maximets wrote: >> On 10.08.2018 01:51, Michael S. Tsirkin wrote: >>> On Thu, Aug 09, 2018 at 07:54:37PM +0300, Ilya Maximets wrote: >>>> New feature bit for in-order featu

[Qemu-devel] [RFC 0/2] vhost+postcopy fixes

2018-10-08 Thread Ilya Maximets
Sending as RFC because it's not fully tested yet. Ilya Maximets (2): migration: Stop postcopy fault thread before notifying vhost-user: Fix userfaultfd leak hw/virtio/vhost-user.c | 7 +++ migration/postcopy-ram.c | 11 ++- 2 files changed, 13 insertions(+), 5 deletions

[Qemu-devel] [RFC 1/2] migration: Stop postcopy fault thread before notifying

2018-10-08 Thread Ilya Maximets
otify") Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Maximets --- migration/postcopy-ram.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 853d8b32ca..e5c02a32c5 100644 --- a/migration/postcopy-r

[Qemu-devel] [RFC 2/2] vhost-user: Fix userfaultfd leak

2018-10-08 Thread Ilya Maximets
") Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Maximets --- hw/virtio/vhost-user.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index c442daa562..e09bed0e4a 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.

[Qemu-devel] Are FreeBSD guest images working?

2018-11-15 Thread Ilya Maximets
-cpu host -enable-kvm -nographic -smp 2 \ -drive if=virtio,file=./FreeBSD-11.2-RELEASE-amd64.qcow2,format=qcow2 Best regards, Ilya Maximets.

[Qemu-devel] [PATCH] vhost-user: Don't ask for reply on postcopy mem table set

2018-10-02 Thread Ilya Maximets
vhost+postcopy: Send address back to qemu") Signed-off-by: Ilya Maximets --- hw/virtio/vhost-user.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index b041343632..c442daa562 100644 --- a/hw/virtio/vhost-user.

[Qemu-devel] Have multiple virtio-net devices, but only one of them receives all traffic

2018-10-02 Thread Ilya Maximets
> Hi, > > I'm using QEMU 3.0.0 and Linux kernel 4.15.0 on x86 machines. I'm > observing pretty weird behavior when I have multiple virtio-net > devices. My KVM VM has two virtio-net devices (vhost=off) and I'm > using a Linux bridge in the host. The two devices have different > MAC/IP addresses.

Re: [Qemu-devel] [PATCH] .cirrus.yml: basic compile and test for FreeBSD

2019-01-16 Thread Ilya Maximets
On 16.01.2019 15:26, Alex Bennée wrote: > > Ed Maste writes: > >> From: Ed Maste >> >> Cirrus-CI (https://cirrus-ci.org) is a hosted CI service which supports >> several platforms, including FreeBSD. Later on we could build for other >> hosts in Cirrus-CI, but I'm starting with only FreeBSD

Re: [Qemu-devel] [PATCH v2 1/4] hostmem-memfd: disable for systems wihtout sealing support

2019-01-16 Thread Ilya Maximets
On 16.01.2019 18:30, Eduardo Habkost wrote: > On Wed, Dec 12, 2018 at 07:49:36AM +0100, Gerd Hoffmann wrote: >> On Tue, Dec 11, 2018 at 02:09:11PM +0300, Ilya Maximets wrote: >>> On 11.12.2018 13:53, Daniel P. Berrangé wrote: >>>>> >>>>> Let'

Re: [Qemu-devel] [PATCH v2 1/4] hostmem-memfd: disable for systems wihtout sealing support

2019-01-16 Thread Ilya Maximets
On 16.01.2019 18:48, Daniel P. Berrangé wrote: > On Wed, Jan 16, 2019 at 06:46:39PM +0300, Ilya Maximets wrote: >> >> >> On 16.01.2019 18:30, Eduardo Habkost wrote: >>> On Wed, Dec 12, 2018 at 07:49:36AM +0100, Gerd Hoffmann wrote: >>>> On Tue, Dec 11, 201

Re: [Qemu-devel] [PATCH v2 1/4] hostmem-memfd: disable for systems wihtout sealing support

2019-01-16 Thread Ilya Maximets
So, can we have any conclusion about this patch and the series? Best regards, Ilya Maximets. On 05.01.2019 5:43, Eduardo Habkost wrote: > On Tue, Dec 11, 2018 at 04:48:23PM +0100, Igor Mammedov wrote: >> On Tue, 11 Dec 2018 13:29:19 +0300 >> Ilya Maximets wrote: >>

Re: [Qemu-devel] [PATCH v2 1/4] hostmem-memfd: disable for systems wihtout sealing support

2018-12-11 Thread Ilya Maximets
On 10.12.2018 19:18, Igor Mammedov wrote: > On Tue, 27 Nov 2018 16:50:27 +0300 > Ilya Maximets wrote: > > s/wihtout/without/ in subj > >> If seals are not supported, memfd_create() will fail. >> Furthermore, there is no way to disable it in this case

Re: [Qemu-devel] [PATCH v2 1/4] hostmem-memfd: disable for systems wihtout sealing support

2018-12-11 Thread Ilya Maximets
On 11.12.2018 13:53, Daniel P. Berrangé wrote: > On Tue, Nov 27, 2018 at 04:50:27PM +0300, Ilya Maximets wrote: >> If seals are not supported, memfd_create() will fail. >> Furthermore, there is no way to disable it in this case because >> '.seal' property is not registered

[Qemu-devel] [PATCH] virtio: add ORDER_PLATFORM feature support

2018-12-14 Thread Ilya Maximets
techniques for memory ordering if negotiated. Signed-off-by: Ilya Maximets --- Note: Patch to change the name of the feature from VIRTIO_F_IO_BARRIER to VIRTIO_F_ORDER_PLATFORM is not merged yet: https://www.mail-archive.com/virtio-dev@lists.oasis-open.org/msg04114.html Patch for DPDK vir

[Qemu-devel] [PATCH 1/4] hostmem-memfd: enable seals only if supported

2018-11-27 Thread Ilya Maximets
,: \ failed to create memfd: Invalid argument Signed-off-by: Ilya Maximets --- backends/hostmem-memfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index b6836b28e5..ee39bdbde6 100644 --- a/backends/hostmem-memfd.c

[Qemu-devel] [PATCH 0/4] memfd fixes.

2018-11-27 Thread Ilya Maximets
Ilya Maximets (4): hostmem-memfd: enable seals only if supported memfd: always check for MFD_CLOEXEC memfd: set up correct errno if not supported memfd: improve error messages backends/hostmem-memfd.c | 4 ++-- util/memfd.c | 10 -- 2 files changed, 10 insertions

[Qemu-devel] [PATCH 3/4] memfd: set up correct errno if not supported

2018-11-27 Thread Ilya Maximets
qemu_memfd_create() prints the value of 'errno' which is not set in this case. Signed-off-by: Ilya Maximets --- util/memfd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/memfd.c b/util/memfd.c index d74ce4d793..393d23da96 100644 --- a/util/memfd.c +++ b/util/memfd.c @@ -40,6 +40,7

[Qemu-devel] [PATCH 2/4] memfd: always check for MFD_CLOEXEC

2018-11-27 Thread Ilya Maximets
QEMU always sets this flag unconditionally. We need to check if it's supported. Signed-off-by: Ilya Maximets --- util/memfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/memfd.c b/util/memfd.c index 8debd0d037..d74ce4d793 100644 --- a/util/memfd.c +++ b/util/memfd.c

[Qemu-devel] [PATCH 4/4] memfd: improve error messages

2018-11-27 Thread Ilya Maximets
This gives more information about the failure. Additionally 'ENOSYS' returned for a non-Linux platforms instead of 'errno', which is not initilaized in this case. Signed-off-by: Ilya Maximets --- util/memfd.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/memfd.c

Re: [Qemu-devel] [PATCH 1/4] hostmem-memfd: enable seals only if supported

2018-11-27 Thread Ilya Maximets
On 27.11.2018 14:49, Marc-André Lureau wrote: > Hi > On Tue, Nov 27, 2018 at 3:11 PM Ilya Maximets wrote: >> >> If seals are not supported, memfd_create() will fail. >> Furthermore, there is no way to disable it in this case because >> '.seal' property is not regi

Re: [Qemu-devel] [PATCH 1/4] hostmem-memfd: enable seals only if supported

2018-11-27 Thread Ilya Maximets
On 27.11.2018 15:00, Marc-André Lureau wrote: > Hi > On Tue, Nov 27, 2018 at 3:56 PM Ilya Maximets wrote: >> >> On 27.11.2018 14:49, Marc-André Lureau wrote: >>> Hi >>> On Tue, Nov 27, 2018 at 3:11 PM Ilya Maximets >>> wrote: >>>>

Re: [Qemu-devel] [PATCH 1/4] hostmem-memfd: enable seals only if supported

2018-11-27 Thread Ilya Maximets
On 27.11.2018 15:29, Marc-André Lureau wrote: > Hi > > On Tue, Nov 27, 2018 at 4:02 PM Ilya Maximets wrote: >> >> On 27.11.2018 15:00, Marc-André Lureau wrote: >>> Hi >>> On Tue, Nov 27, 2018 at 3:56 PM Ilya Maximets >>> wrote: >>>>

Re: [Qemu-devel] [PATCH 1/4] hostmem-memfd: enable seals only if supported

2018-11-27 Thread Ilya Maximets
On 27.11.2018 15:56, Marc-André Lureau wrote: > Hi > > On Tue, Nov 27, 2018 at 4:37 PM Ilya Maximets wrote: >> >> On 27.11.2018 15:29, Marc-André Lureau wrote: >>> Hi >>> >>> On Tue, Nov 27, 2018 at 4:02 PM Ilya Maximets >>> wrot

[Qemu-devel] [PATCH v2 2/4] memfd: always check for MFD_CLOEXEC

2018-11-27 Thread Ilya Maximets
QEMU always sets this flag unconditionally. We need to check if it's supported. Signed-off-by: Ilya Maximets Reviewed-by: Marc-André Lureau --- util/memfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/memfd.c b/util/memfd.c index 8debd0d037..d74ce4d793 100644

[Qemu-devel] [PATCH v2 0/4] memfd fixes.

2018-11-27 Thread Ilya Maximets
Version 2: * First patch changed to just drop the memfd backend if seals are not supported. Ilya Maximets (4): hostmem-memfd: disable for systems wihtout sealing support memfd: always check for MFD_CLOEXEC memfd: set up correct errno if not supported memfd: improve error

[Qemu-devel] [PATCH v2 1/4] hostmem-memfd: disable for systems wihtout sealing support

2018-11-27 Thread Ilya Maximets
,: \ failed to create memfd: Invalid argument and actually breaks the feature on such systems. Let's restrict memfd backend to systems with sealing support. Signed-off-by: Ilya Maximets --- backends/hostmem-memfd.c | 18 -- tests/vhost-user-test.c | 6 +++--- 2 files

[Qemu-devel] [PATCH v2 3/4] memfd: set up correct errno if not supported

2018-11-27 Thread Ilya Maximets
qemu_memfd_create() prints the value of 'errno' which is not set in this case. Signed-off-by: Ilya Maximets Reviewed-by: Marc-André Lureau --- util/memfd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/memfd.c b/util/memfd.c index d74ce4d793..393d23da96 100644 --- a/util/memfd.c

[Qemu-devel] [PATCH v2 4/4] memfd: improve error messages

2018-11-27 Thread Ilya Maximets
This gives more information about the failure. Additionally 'ENOSYS' returned for a non-Linux platforms instead of 'errno', which is not initilaized in this case. Signed-off-by: Ilya Maximets Reviewed-by: Marc-André Lureau --- util/memfd.c | 7 ++- 1 file changed, 6 insertions(+), 1

[Qemu-devel] [PATCH 00/97] Patch Round-up for stable 3.0.1, freeze on 2019-04-08

2019-04-08 Thread Ilya Maximets
e), but is being release now since it was > delayed from its intended release date. > > Thanks! > [...] > > Ilya Maximets (1): > migration: Stop postcopy fault thread before notifying Hi. Sorry for late response, but what about following two patches: c4f753859ae6

[Qemu-devel] [PATCH v3 0/4] memfd fixes.

2019-03-11 Thread Ilya Maximets
Version 3: * Rebase on top of current master. Version 2: * First patch changed to just drop the memfd backend if seals are not supported. Ilya Maximets (4): hostmem-memfd: disable for systems wihtout sealing support memfd: always check for MFD_CLOEXEC memfd: set up correct

[Qemu-devel] [PATCH v3 3/4] memfd: set up correct errno if not supported

2019-03-11 Thread Ilya Maximets
qemu_memfd_create() prints the value of 'errno' which is not set in this case. Signed-off-by: Ilya Maximets Reviewed-by: Marc-André Lureau --- util/memfd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/memfd.c b/util/memfd.c index d74ce4d793..393d23da96 100644 --- a/util/memfd.c

[Qemu-devel] [PATCH v3 4/4] memfd: improve error messages

2019-03-11 Thread Ilya Maximets
This gives more information about the failure. Additionally 'ENOSYS' returned for a non-Linux platforms instead of 'errno', which is not initilaized in this case. Signed-off-by: Ilya Maximets Reviewed-by: Marc-André Lureau --- util/memfd.c | 7 ++- 1 file changed, 6 insertions(+), 1

Re: [Qemu-devel] [PATCH v2 0/4] memfd fixes.

2019-03-11 Thread Ilya Maximets
regards, Ilya Maximets. On 27.11.2018 16:50, Ilya Maximets wrote: > Version 2: > * First patch changed to just drop the memfd backend > if seals are not supported. > > Ilya Maximets (4): > hostmem-memfd: disable for systems wihtout sealing support >

[Qemu-devel] [PATCH v3 1/4] hostmem-memfd: disable for systems wihtout sealing support

2019-03-11 Thread Ilya Maximets
,: \ failed to create memfd: Invalid argument and actually breaks the feature on such systems. Let's restrict memfd backend to systems with sealing support. Signed-off-by: Ilya Maximets --- backends/hostmem-memfd.c | 18 -- tests/vhost-user-test.c | 5 +++-- 2 files changed

[Qemu-devel] [PATCH v3 2/4] memfd: always check for MFD_CLOEXEC

2019-03-11 Thread Ilya Maximets
QEMU always sets this flag unconditionally. We need to check if it's supported. Signed-off-by: Ilya Maximets Reviewed-by: Marc-André Lureau --- util/memfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/memfd.c b/util/memfd.c index 8debd0d037..d74ce4d793 100644

[PATCH] vhost_net: Print feature masks in hex

2022-03-18 Thread Ilya Maximets
"0x2" is much more readable than "8589934592". The change saves one step (conversion) while debugging. Signed-off-by: Ilya Maximets --- hw/net/vhost_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_ne

[PATCH v4 2/2] net: add initial support for AF_XDP network backend

2023-09-13 Thread Ilya Maximets
to results of a tap backend with vhost=on and disabled segmentation offloading bridged with a NIC. Signed-off-by: Ilya Maximets --- MAINTAINERS | 4 + hmp-commands.hx | 3 + meson.build

[PATCH v4 0/2] net: add initial support for AF_XDP network backend

2023-09-13 Thread Ilya Maximets
of RLIMIT_MEMLOCK per queue. - Refined and extended documentation. Ilya Maximets (2): tests: bump libvirt-ci for libasan and libxdp net: add initial support for AF_XDP network backend MAINTAINERS | 4 + hmp-commands.hx | 3

[PATCH v4 1/2] tests: bump libvirt-ci for libasan and libxdp

2023-09-13 Thread Ilya Maximets
This pulls in the fixes for libasan version as well as support for libxdp that will be used for af-xdp netdev in the next commits. Signed-off-by: Ilya Maximets --- tests/docker/dockerfiles/debian-amd64-cross.docker | 2 +- tests/docker/dockerfiles/debian-amd64.docker | 2 +- tests

Re: [PULL 00/17] Net patches

2023-09-13 Thread Ilya Maximets
On 9/8/23 16:15, Daniel P. Berrangé wrote: > On Fri, Sep 08, 2023 at 04:06:35PM +0200, Ilya Maximets wrote: >> On 9/8/23 14:15, Daniel P. Berrangé wrote: >>> On Fri, Sep 08, 2023 at 02:00:47PM +0200, Ilya Maximets wrote: >>>> On 9/8/23 13:49, Daniel P. Berrangé wro

Re: [PULL 00/17] Net patches

2023-09-08 Thread Ilya Maximets
On 9/8/23 13:49, Daniel P. Berrangé wrote: > On Fri, Sep 08, 2023 at 01:34:54PM +0200, Ilya Maximets wrote: >> On 9/8/23 13:19, Stefan Hajnoczi wrote: >>> Hi Ilya and Jason, >>> There is a CI failure related to a missing Debian libxdp-dev package: >>> https:/

Re: [PULL 00/17] Net patches

2023-09-08 Thread Ilya Maximets
On 9/8/23 13:19, Stefan Hajnoczi wrote: > Hi Ilya and Jason, > There is a CI failure related to a missing Debian libxdp-dev package: > https://gitlab.com/qemu-project/qemu/-/jobs/5046139967 > > I think the issue is that the debian-amd64 container image that QEMU > uses for testing is based on

Re: [PULL 12/17] net: add initial support for AF_XDP network backend

2023-09-08 Thread Ilya Maximets
On 9/8/23 13:48, Daniel P. Berrangé wrote: > On Fri, Sep 08, 2023 at 02:45:02PM +0800, Jason Wang wrote: >> From: Ilya Maximets >> >> AF_XDP is a network socket family that allows communication directly >> with the network device driver in the kernel, bypassing m

Re: [PULL 00/17] Net patches

2023-09-08 Thread Ilya Maximets
On 9/8/23 14:15, Daniel P. Berrangé wrote: > On Fri, Sep 08, 2023 at 02:00:47PM +0200, Ilya Maximets wrote: >> On 9/8/23 13:49, Daniel P. Berrangé wrote: >>> On Fri, Sep 08, 2023 at 01:34:54PM +0200, Ilya Maximets wrote: >>>> On 9/8/23 13:19, Stefan Hajnoczi

Re: [PULL 00/17] Net patches

2023-09-19 Thread Ilya Maximets
On 9/19/23 10:40, Daniel P. Berrangé wrote: > On Mon, Sep 18, 2023 at 09:36:10PM +0200, Ilya Maximets wrote: >> On 9/14/23 10:13, Daniel P. Berrangé wrote: >>> On Wed, Sep 13, 2023 at 08:46:42PM +0200, Ilya Maximets wrote: >>>> On 9/8/23 16:15, Daniel P. Berrangé wro

Re: [PULL 00/17] Net patches

2023-09-18 Thread Ilya Maximets
On 9/14/23 10:13, Daniel P. Berrangé wrote: > On Wed, Sep 13, 2023 at 08:46:42PM +0200, Ilya Maximets wrote: >> On 9/8/23 16:15, Daniel P. Berrangé wrote: >>> On Fri, Sep 08, 2023 at 04:06:35PM +0200, Ilya Maximets wrote: >>>> On 9/8/23 14:15, Daniel P. Berrangé wro

Re: [PATCH] virtio: remove unnecessary thread fence while reading next descriptor

2023-09-25 Thread Ilya Maximets
On 9/25/23 16:32, Stefan Hajnoczi wrote: > On Fri, 25 Aug 2023 at 13:02, Ilya Maximets wrote: >> >> It was supposed to be a compiler barrier and it was a compiler barrier >> initially called 'wmb' (??) when virtio core support was introduced. >> Later all the insta

Re: [PATCH] virtio: use shadow_avail_idx while checking number of heads

2023-09-25 Thread Ilya Maximets
On 9/25/23 17:12, Stefan Hajnoczi wrote: > On Mon, 25 Sept 2023 at 11:02, Ilya Maximets wrote: >> >> On 9/25/23 16:23, Stefan Hajnoczi wrote: >>> On Fri, 25 Aug 2023 at 13:04, Ilya Maximets wrote: >>>> >>>> We do not need the most up to

Re: [PATCH] virtio: use shadow_avail_idx while checking number of heads

2023-09-25 Thread Ilya Maximets
On 9/25/23 16:23, Stefan Hajnoczi wrote: > On Fri, 25 Aug 2023 at 13:04, Ilya Maximets wrote: >> >> We do not need the most up to date number of heads, we only want to >> know if there is at least one. >> >> Use shadow variable as long as it is not equal to th

Re: [PATCH] virtio: use shadow_avail_idx while checking number of heads

2023-09-25 Thread Ilya Maximets
On 9/25/23 23:24, Michael S. Tsirkin wrote: > On Mon, Sep 25, 2023 at 10:58:05PM +0200, Ilya Maximets wrote: >> On 9/25/23 17:38, Stefan Hajnoczi wrote: >>> On Mon, 25 Sept 2023 at 11:36, Ilya Maximets wrote: >>>> >>>> On 9/25/23 17:12, Stefan Hajnoczi

Re: [PATCH] virtio: use shadow_avail_idx while checking number of heads

2023-09-25 Thread Ilya Maximets
On 9/25/23 17:38, Stefan Hajnoczi wrote: > On Mon, 25 Sept 2023 at 11:36, Ilya Maximets wrote: >> >> On 9/25/23 17:12, Stefan Hajnoczi wrote: >>> On Mon, 25 Sept 2023 at 11:02, Ilya Maximets wrote: >>>> >>>> On 9/25/23 16:23, Stefan Hajnoczi

[PATCH v2] virtio: use shadow_avail_idx while checking number of heads

2023-09-27 Thread Ilya Maximets
itself. The change improves performance of the af-xdp network backend by 2-3%. Signed-off-by: Ilya Maximets --- Version 2: - Changed to not skip error checks and a barrier. - Added comments about the need for a barrier. hw/virtio/virtio.c | 18 +++--- 1 file changed, 15

Re: [PATCH] virtio: remove unnecessary thread fence while reading next descriptor

2023-09-27 Thread Ilya Maximets
On 9/25/23 20:04, Ilya Maximets wrote: > On 9/25/23 16:32, Stefan Hajnoczi wrote: >> On Fri, 25 Aug 2023 at 13:02, Ilya Maximets wrote: >>> >>> It was supposed to be a compiler barrier and it was a compiler barrier >>> initially called 'wmb' (??) when virtio co

[PATCH v2 2/2] virtio: remove unused next argument from virtqueue_split_read_next_desc()

2023-09-27 Thread Ilya Maximets
ombine the read of a descriptor") Remove the unused argument to simplify the code. Also, adding a comment to the function to describe what it is actually doing, as it is not obvious that the 'desc' is both an input and an output argument. Signed-off-by: Ilya Maximets --- hw/virtio/virtio.c | 18 +

[PATCH v2 0/2] virtio: clean up of virtqueue_split_read_next_desc()

2023-09-27 Thread Ilya Maximets
Version 2: - Converted into a patch set adding a new patch that removes the 'next' argument. [Stefan] - Completely removing the barrier instead of changing into compiler barrier. [Stefan] Ilya Maximets (2): virtio: remove unnecessary thread fence while reading next descriptor

Re: [PATCH] virtio: use shadow_avail_idx while checking number of heads

2023-09-27 Thread Ilya Maximets
On 9/26/23 00:24, Michael S. Tsirkin wrote: > On Tue, Sep 26, 2023 at 12:13:11AM +0200, Ilya Maximets wrote: >> On 9/25/23 23:24, Michael S. Tsirkin wrote: >>> On Mon, Sep 25, 2023 at 10:58:05PM +0200, Ilya Maximets wrote: >>>> On 9/25/23 17:38, Stefan Hajnoczi wro

[PATCH v2 1/2] virtio: remove unnecessary thread fence while reading next descriptor

2023-09-27 Thread Ilya Maximets
barrier, as its only purpose was to ensure that the value is not read twice. And since commit aa570d6fb6bd ("virtio: combine the read of a descriptor") there is no need for a barrier at all, since we're no longer reading guest memory here, but accessing a local structure. Signed-off-by: Ily

Re: [PATCH] virtio: remove unnecessary thread fence while reading next descriptor

2023-09-27 Thread Ilya Maximets
On 9/27/23 17:41, Michael S. Tsirkin wrote: > On Wed, Sep 27, 2023 at 04:06:41PM +0200, Ilya Maximets wrote: >> On 9/25/23 20:04, Ilya Maximets wrote: >>> On 9/25/23 16:32, Stefan Hajnoczi wrote: >>>> On Fri, 25 Aug 2023 at 13:02, Ilya Maximets wrote: >>>&g

Re: [PATCH v2] virtio: don't zero out memory region cache for indirect descriptors

2023-09-25 Thread Ilya Maximets
On 8/11/23 16:34, Ilya Maximets wrote: > Lots of virtio functions that are on a hot path in data transmission > are initializing indirect descriptor cache at the point of stack > allocation. It's a 112 byte structure that is getting zeroed out on > each call adding unnecessary ove

Re: [PATCH] virtio: use shadow_avail_idx while checking number of heads

2023-09-25 Thread Ilya Maximets
On 8/25/23 19:04, Ilya Maximets wrote: > We do not need the most up to date number of heads, we only want to > know if there is at least one. > > Use shadow variable as long as it is not equal to the last available > index checked. This avoids expensive qatomic dereference of the

Re: [PATCH] virtio: remove unnecessary thread fence while reading next descriptor

2023-09-25 Thread Ilya Maximets
On 8/25/23 19:01, Ilya Maximets wrote: > It was supposed to be a compiler barrier and it was a compiler barrier > initially called 'wmb' (??) when virtio core support was introduced. > Later all the instances of 'wmb' were switched to smp_wmb to fix memory > ordering issues on non-x

[PATCH] memory: initialize 'fv' in MemoryRegionCache to make Coverity happy

2023-10-09 Thread Ilya Maximets
; ** CID 1522370: Memory - illegal accesses (UNINIT) Instead of trying to silence these false positive reports in 4 different places, initializing 'fv' as well, as this doesn't result in any noticeable performance impact. Signed-off-by: Ilya Maximets --- include/exec/memory.h | 2 ++ 1 file chan

Re: [PATCH v2 3/4] virtio: use defer_call() in virtio_irqfd_notify()

2023-08-21 Thread Ilya Maximets
On 8/17/23 17:58, Stefan Hajnoczi wrote: > virtio-blk and virtio-scsi invoke virtio_irqfd_notify() to send Used > Buffer Notifications from an IOThread. This involves an eventfd > write(2) syscall. Calling this repeatedly when completing multiple I/O > requests in a row is wasteful. > > Use the

Re: [PATCH 1/2] virtio: use blk_io_plug_call() in virtio_irqfd_notify()

2023-08-16 Thread Ilya Maximets
y missing something, but could you explain why it is safe to batch unconditionally here? The current BH code, as you mentioned in the second patch, is only batching if EVENT_IDX is not set. Maybe worth adding a few words in the commit message for people like me, who are a bit rusty on QEMU/virtio internals. :)

Re: [PATCH 1/2] virtio: use blk_io_plug_call() in virtio_irqfd_notify()

2023-08-16 Thread Ilya Maximets
On 8/16/23 17:30, Stefan Hajnoczi wrote: > On Wed, Aug 16, 2023 at 03:36:32PM +0200, Ilya Maximets wrote: >> On 8/15/23 14:08, Stefan Hajnoczi wrote: >>> virtio-blk and virtio-scsi invoke virtio_irqfd_notify() to send Used >>> Buffer Notifications from an IOThrea

[PATCH] virtio: remove unnecessary thread fence while reading next descriptor

2023-08-25 Thread Ilya Maximets
barrier. It's enough for it to stay a compiler barrier as its only purpose is to ensure that the value is not read twice. There is no counterpart read barrier in the drivers, AFAICT. And even if we needed an actual barrier, it shouldn't have been a write barrier. Signed-off-by: Ilya Maximets

[PATCH] virtio: use shadow_avail_idx while checking number of heads

2023-08-25 Thread Ilya Maximets
itself and the subsequent memory barrier. The change improves performance of the af-xdp network backend by 2-3%. Signed-off-by: Ilya Maximets --- hw/virtio/virtio.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

Re: [PATCH] net: add initial support for AF_XDP network backend

2023-07-07 Thread Ilya Maximets
2023 at 4:15 PM Stefan Hajnoczi >>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> On Wed, 28 Jun 2023 at 09:59, Jason Wang wrote: >>>>>>>>>>> >>>>>>>>>>> On

Re: [PATCH] net: add initial support for AF_XDP network backend

2023-07-10 Thread Ilya Maximets
On 7/10/23 05:51, Jason Wang wrote: > On Fri, Jul 7, 2023 at 7:21 PM Ilya Maximets wrote: >> >> On 7/7/23 03:43, Jason Wang wrote: >>> On Fri, Jul 7, 2023 at 3:08 AM Stefan Hajnoczi wrote: >>>> >>>> On Wed, 5 Jul 2023 at 02:02, Jason Wang wrote: &

Re: [PATCH v2] net: add initial support for AF_XDP network backend

2023-07-20 Thread Ilya Maximets
On 7/20/23 09:37, Jason Wang wrote: > On Thu, Jul 6, 2023 at 4:58 AM Ilya Maximets wrote: >> >> AF_XDP is a network socket family that allows communication directly >> with the network device driver in the kernel, bypassing most or all >> of the kernel networ

[PATCH v2] net: add initial support for AF_XDP network backend

2023-07-05 Thread Ilya Maximets
ults of a tap backend with vhost=on and disabled segmentation offloading bridged with a NIC. Signed-off-by: Ilya Maximets --- Version 2: - Added support for running with no capabilities by passing pre-created AF_XDP socket file descriptors via 'sock-fds' option. Conditionally com

  1   2   >