Re: [PATCH] vhost: mask VIRTIO_F_RING_RESET for vhost and vhost-user devices

2022-11-21 Thread Raphael Norwitz
ce VIRTIO_F_RING_RESET is negotiated > by the guest (Linux >= v6.0), but not supported by the device. > > Fixes: 69e1c14aa2 ("virtio: core: vq reset feature negotation support") > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1318 > Signed-off-by: Stefano Garzarella Looks good. For vhost-user-blk and vhost-user-scsi: Acked-by: Raphael Norwitz

Re: [PATCH for-7.2] vhost: enable vrings in vhost_dev_start() for vhost-user devices

2022-11-23 Thread Raphael Norwitz
> > [1] https://gitlab.com/virtio-fs/virtiofsd > [2] > https://github.com/rust-vmm/vhost/blob/240fc2966/crates/vhost-user-backend/src/event_loop.rs#L217 > Fixes: 02b61f38d3 ("hw/virtio: incorporate backend features in features") > Reported-by: German Maglione &

Re: [PATCH for-7.2] vhost: enable vrings in vhost_dev_start() for vhost-user devices

2022-11-24 Thread Raphael Norwitz
> On Nov 24, 2022, at 2:54 AM, Stefano Garzarella wrote: > > On Thu, Nov 24, 2022 at 01:50:19AM -0500, Michael S. Tsirkin wrote: >> On Thu, Nov 24, 2022 at 12:19:25AM +, Raphael Norwitz wrote: >>> >>> > On Nov 23, 2022, at 8:16 AM, Stefano Garzarel

Re: [PATCH v3 7/7] hw/virtio: generalise CHR_EVENT_CLOSED handling

2022-11-28 Thread Raphael Norwitz
> On Nov 28, 2022, at 11:41 AM, Alex Bennée wrote: > > ..and use for both virtio-user-blk and virtio-user-gpio. This avoids > the circular close by deferring shutdown due to disconnection until a > later point. virtio-user-blk already had this mechanism in place so The mechanism was originally c

Re: [PATCH v3 7/7] hw/virtio: generalise CHR_EVENT_CLOSED handling

2022-11-29 Thread Raphael Norwitz
> On Nov 29, 2022, at 12:30 AM, Michael S. Tsirkin wrote: > > On Tue, Nov 29, 2022 at 05:18:58AM +, Raphael Norwitz wrote: >>> On Nov 28, 2022, at 11:41 AM, Alex Bennée wrote: >>> >>> ..and use for both virtio-user-blk and virtio-user-gpio. This avoids

Re: [PATCH] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement

2022-07-27 Thread Raphael Norwitz
On Tue, Jul 26, 2022 at 03:57:42PM +0100, Peter Maydell wrote: > On Fri, 1 Jul 2022 at 06:41, Markus Armbruster wrote: > > Could we use a contrib/README with an explanation what "contrib" means, > > and how to build and use the stuff there? > > I would rather we got rid of contrib/ entirely. Our

Re: [PATCH v4 11/22] hw/virtio: move vhd->started check into helper and add FIXME

2022-08-07 Thread Raphael Norwitz
g at the vhost level. I do agree we shouldn't re-use vdev->started. Maybe we should add another 'active' variable in vhost_dev? I'm happy to send a patch for that. Until we agree on a better solution I'm happy with the FIXME. Reviewed-by: Raphael Norwitz > >

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-24 Thread Raphael Norwitz
Very excited to see this. High level looks good modulo a few small things. My major concern is around existing vhost-user-scsi backends which don’t support VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD. IMO we should hide the reconnect behavior behind a VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD check. We may

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-27 Thread Raphael Norwitz
> On Jul 25, 2023, at 6:19 AM, Li Feng wrote: > > Thanks for your comments. > >> 2023年7月25日 上午1:21,Raphael Norwitz 写道: >> >> Very excited to see this. High level looks good modulo a few small things. >> >> My major concern is around existing vhost-

Re: [PATCH v2 1/4] vhost: fix the fd leak

2023-07-30 Thread Raphael Norwitz
gned-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/virtio/vhost.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c > index abf0d03c8d..e2f6ffb446 100644 > --- a/hw/virtio/vhost.c > +++ b/hw/virtio/vhost.c > @@

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-30 Thread Raphael Norwitz
> On Jul 28, 2023, at 3:48 AM, Li Feng wrote: > > Thanks for your reply. > >> 2023年7月28日 上午5:21,Raphael Norwitz 写道: >> >> >> >>> On Jul 25, 2023, at 6:19 AM, Li Feng wrote: >>> >>> Thanks for your comments. >>> &g

Re: [PATCH v2 3/4] vhost: move and rename the conn retry times

2023-07-30 Thread Raphael Norwitz
> On Jul 25, 2023, at 6:42 AM, Li Feng wrote: > > Multile devices need this macro, move it to a common header. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/block/vhost-user-blk.c | 4 +--- > hw/virtio/vhost-user-gpio.c | 3 +-- > incl

Re: [PATCH v2 2/4] vhost-user-common: send get_inflight_fd once

2023-07-30 Thread Raphael Norwitz
> On Jul 28, 2023, at 3:49 AM, Li Feng wrote: > > > >> 2023年7月28日 下午2:04,Michael S. Tsirkin 写道: >> >> On Tue, Jul 25, 2023 at 06:42:45PM +0800, Li Feng wrote: >>> Get_inflight_fd is sent only once. When reconnecting to the backend, >>> qemu sent set_inflight_fd to the backend. >> >> I don't

Re: [PATCH v2 4/4] vhost-user-scsi: support reconnect to backend

2023-07-30 Thread Raphael Norwitz
I don’t think we should be changing any vhost-scsi-common code here. I’d rather implement wrappers around vhost_user_scsi_start/stop() around vhost_user_scsi_common_start/stop() and check started_vu there. Otherwise I think this is looking good. Glad to see you caught the vhost_user_scsi_handl

Re: [PATCH v2 2/4] vhost-user-common: send get_inflight_fd once

2023-07-31 Thread Raphael Norwitz
> On Jul 31, 2023, at 7:38 AM, Li Feng wrote: > > > >> 2023年7月31日 06:13,Raphael Norwitz 写道: >> >>> >>> On Jul 28, 2023, at 3:49 AM, Li Feng wrote: >>> >>> >>> >>>> 2023年7月28日 下午2:04,Michael S

Re: [PATCH v3 2/5] vhost-user-common: send get_inflight_fd once

2023-07-31 Thread Raphael Norwitz
t will release the > previous shared memory, which breaks inflight working logic. > > This patch is a preparation for the following patches. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/scsi/vhost-scsi-common.c | 37 ++---

Re: [PATCH v3 4/5] vhost-user-scsi: support reconnect to backend

2023-07-31 Thread Raphael Norwitz
> On Jul 31, 2023, at 8:10 AM, Li Feng wrote: > > If the backend crashes and restarts, the device is broken. > This patch adds reconnect for vhost-user-scsi. > > Tested with spdk backend. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > ---

Re: [PATCH v3 5/5] vhost-user-scsi: start vhost when guest kicks

2023-07-31 Thread Raphael Norwitz
> On Jul 31, 2023, at 8:10 AM, Li Feng wrote: > > Let's keep the same behavior as vhost-user-blk. > > Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- >

Re: [PATCH v1 01/15] libvhost-user: Fix msg_region->userspace_addr computation

2024-02-03 Thread Raphael Norwitz
vidual regions in libvhost-user") > Fixes: 9bb38019942c ("vhost+postcopy: Send address back to qemu") > Cc: Raphael Norwitz > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 8 > 1 file chan

Re: [PATCH v1 02/15] libvhost-user: Dynamically allocate memory for memory slots

2024-02-03 Thread Raphael Norwitz
Let's zero out the memory, just as we used to do. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 11 +++ > subprojects/libvhost-user/libvhost-user.h | 2 +- > 2 files changed, 12 insertions(+

Re: [PATCH v1 03/15] libvhost-user: Bump up VHOST_USER_MAX_RAM_SLOTS to 509

2024-02-03 Thread Raphael Norwitz
There are plenty left for the application to consume. > > [1] https://github.com/rust-vmm/vhost/pull/224 > [2] https://lore.kernel.org/all/20230926185738.277351-1-da...@redhat.com/ > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost

Re: [PATCH v1 04/15] libvhost-user: Factor out removing all mem regions

2024-02-03 Thread Raphael Norwitz
On Fri, Feb 2, 2024 at 4:54 PM David Hildenbrand wrote: > > Let's factor it out. Note that the check for MAP_FAILED was wrong as > we never set mmap_addr if mmap() failed. We'll remove the NULL check > separately. > > Signed-off-by: David Hildenbrand

Re: [PATCH v1 05/15] libvhost-user: Merge vu_set_mem_table_exec_postcopy() into vu_set_mem_table_exec()

2024-02-03 Thread Raphael Norwitz
On Fri, Feb 2, 2024 at 4:55 PM David Hildenbrand wrote: > > Let's reduce some code duplication and prepare for further changes. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 119 +++--

Re: [PATCH v1 06/15] libvhost-user: Factor out adding a memory region

2024-02-03 Thread Raphael Norwitz
now increment dev->nregions as we are successfully > adding memory regions, and don't increment dev->nregions if anything went > wrong. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 168

Re: [PATCH v1 07/15] libvhost-user: No need to check for NULL when unmapping

2024-02-03 Thread Raphael Norwitz
On Fri, Feb 2, 2024 at 4:55 PM David Hildenbrand wrote: > > We never add a memory region if mmap() failed. Therefore, no need to check > for NULL. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 10

Re: [PATCH v1 08/15] libvhost-user: Don't zero out memory for memory regions

2024-02-03 Thread Raphael Norwitz
On Fri, Feb 2, 2024 at 4:56 PM David Hildenbrand wrote: > > dev->nregions always covers only valid entries. Stop zeroing out other > array elements that are unused. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-

Re: [PATCH v1 09/15] libvhost-user: Don't search for duplicates when removing memory regions

2024-02-03 Thread Raphael Norwitz
> > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/subprojects/libvhost-user/libvhost-user.c > b/subprojects/libvhost-user/libvhost-use

Re: [PATCH v1 10/15] libvhost-user: Factor out search for memory region by GPA and simplify

2024-02-03 Thread Raphael Norwitz
ning regions") added and clarified that > handling and how overlaps are impossible. > > Consequently, each GPA can belong to at most one memory region, and > everything else doesn't make sense. Let's factor out our search to prepare > for further changes. > > Signed

Re: [PATCH v1 11/15] libvhost-user: Speedup gpa_to_mem_region() and vu_gpa_to_va()

2024-02-03 Thread Raphael Norwitz
One comment on this one. On Fri, Feb 2, 2024 at 4:56 PM David Hildenbrand wrote: > > Let's speed up GPA to memory region / virtual address lookup. Store the > memory regions ordered by guest physical addresses, and use binary > search for address translation, as well as when adding/removing memor

Re: [PATCH v1 12/15] libvhost-user: Use most of mmap_offset as fd_offset

2024-02-03 Thread Raphael Norwitz
0dc000 > memory_size: 0x4000 > userspace_addr 0x7f552bffe000 > mmap_offset 0x000c4000 > fd_offset: 0x000c4000 > new mmap_offset: 0x > mmap_addr: 0x7f7e8c00 > Successf

Re: [PATCH v1 13/15] libvhost-user: Factor out vq usability check

2024-02-03 Thread Raphael Norwitz
On Fri, Feb 2, 2024 at 4:55 PM David Hildenbrand wrote: > > Let's factor it out to prepare for further changes. > > Signed-off-by: David Hildenbrand Reviewed-by: Raphael Norwitz > --- > subprojects/libvhost-user/libvhost-user.c | 24 +++ > 1 f

Re: [PATCH v1 14/15] libvhost-user: Dynamically remap rings after (temporarily?) removing memory regions

2024-02-03 Thread Raphael Norwitz
d on > hotplugged memory, and as the VM reboots, we might unplug that memory, to > hotplug memory before resetting the ring addresses. > > So let's unmap affected rings as we remove a memory region, and try > dynamically mapping the ring again when required. > > Signed-of

Re: [PATCH v1 15/15] libvhost-user: Mark mmap'ed region memory as MADV_DONTDUMP

2024-02-03 Thread Raphael Norwitz
g > purposes. > > This change implies that the mmap'ed rings won't be included in a > coredump. If ever required for debugging purposes, we could mark only > the mapped rings MADV_DODUMP. > > Ignore errors during madvise() for now. > > Signed-off-by: David Hilden

[PATCH] MAINTAINERS: Switch to my Enfabrica email

2024-02-03 Thread Raphael Norwitz
I'd prefer to use my new work email so this change updates MAINTAINERS with it. Signed-off-by: Raphael Norwitz --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 2f9741b898..a12b58abe2 100644 --- a/MAINTAINERS +++ b/MAINTA

Re: [PATCH v1 01/15] libvhost-user: Fix msg_region->userspace_addr computation

2024-02-04 Thread Raphael Norwitz
On Sun, Feb 4, 2024 at 9:36 AM David Hildenbrand wrote: > > On 04.02.24 02:35, Raphael Norwitz wrote: > > As a heads up, I've left Nutanix and updated it in MAINTAINERS. Will > > be updating it again shortly so tagging these with my new work email. > > > > T

Re: [PATCH v1 11/15] libvhost-user: Speedup gpa_to_mem_region() and vu_gpa_to_va()

2024-02-04 Thread Raphael Norwitz
On Sun, Feb 4, 2024 at 9:51 AM David Hildenbrand wrote: > > On 04.02.24 03:10, Raphael Norwitz wrote: > > One comment on this one. > > > > On Fri, Feb 2, 2024 at 4:56 PM David Hildenbrand wrote: > >> > >> Let's speed up GPA to memory region / virtua

Re: [PATCH 1/2] libvhost-user: Fix pointer arithmetic in indirect read

2024-04-18 Thread Raphael Norwitz
The change looks right to me. As is, it looks like the code is skipping over descriptors when the intent should be to bounce data into a single descriptor. I agree the variable rename should go in as a separate change. On Thu, Apr 18, 2024 at 6:56 AM Daniel P. Berrangé wrote: > > On Sat, Jan 13,

[Qemu-devel] [PATCH] vhost-user-scsi: prevent using uninitialized vqs

2019-06-11 Thread Raphael Norwitz
0 The qemu commit e6cc11d64fc998c11a4dfcde8fda3fc33a74d844 has already resolved the issue for vhost scsi devices but the fix was never applied to vhost-user scsi devices. Signed-off-by: Raphael Norwitz --- hw/scsi/vhost-user-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH v2 0/3] vhost-user: Lift Max Ram Slots Limitation

2020-02-19 Thread Raphael Norwitz
On Mon, Feb 10, 2020 at 11:04:28AM -0500, Michael S. Tsirkin wrote: > > On Sun, Feb 09, 2020 at 12:14:42PM -0500, Raphael Norwitz wrote: > > On Thu, Feb 06, 2020 at 03:33:13AM -0500, Michael S. Tsirkin wrote: > > > > > > On Wed, Jan 15, 2020 at 09:57:03P

Re: [PATCH 1/2] vhost-user: add VHOST_USER_RESET_DEVICE to reset devices

2019-12-12 Thread Raphael Norwitz
On Wed, Nov 06, 2019 at 06:36:01AM -0500, Michael S. Tsirkin wrote: > > On Tue, Oct 29, 2019 at 05:38:02PM -0400, Raphael Norwitz wrote: > > Add a VHOST_USER_RESET_DEVICE message which will reset the vhost user > > backend. Disabling all rings, and resetting all internal state,

[RFC PATCH 0/3] vhost-user: Lift Max Ram Slots Limitation

2019-12-16 Thread Raphael Norwitz
there a cleaner way to ensure to ensure a postcopy migration cannot be started with this protocol feature enabled? Best, Raphael Raphael Norwitz (3): Fixed Error Handling in vhost_user_set_mem_table_postcopy vhost-user: Refactor vhost_user_set_mem_table Functions Introduce Configurable

[RFC PATCH 1/3] Fixed Error Handling in vhost_user_set_mem_table_postcopy

2019-12-16 Thread Raphael Norwitz
(), gracefully propogating an error up instead of corrupting memory and crashing qemu. Signed-off-by: Raphael Norwitz --- hw/virtio/vhost-user.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 02a9b25..f74ff3b 100644 --- a/hw

[RFC PATCH 3/3] Introduce Configurable Number of Memory Slots Exposed by vhost-user:

2019-12-16 Thread Raphael Norwitz
VHOST_USER_PROTOCOL_F_REPLY_ACK feature has also been negotiated. Signed-off-by: Raphael Norwitz --- docs/interop/vhost-user.rst | 43 hw/virtio/vhost-user.c | 251 2 files changed, 273 insertions(+), 21 deletions(-) diff --git a/docs/interop

[RFC PATCH 2/3] vhost-user: Refactor vhost_user_set_mem_table Functions

2019-12-16 Thread Raphael Norwitz
, vhost_user_fill_set_mem_table_msg(). No functionality is impacted. Signed-off-by: Raphael Norwitz --- hw/virtio/vhost-user.c | 144 +++-- 1 file changed, 66 insertions(+), 78 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index

Re: [PATCH v2 0/3] vhost-user: Lift Max Ram Slots Limitation

2020-02-05 Thread Raphael Norwitz
Ping On Wed, Jan 15, 2020 at 09:57:03PM -0500, Raphael Norwitz wrote: > > In QEMU today, a VM with a vhost-user device can hot add memory a > maximum of 8 times. See these threads, among others: > > [1] https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg01046.htm

Re: [PATCH v2 0/3] vhost-user: Lift Max Ram Slots Limitation

2020-02-10 Thread Raphael Norwitz
On Thu, Feb 06, 2020 at 03:33:13AM -0500, Michael S. Tsirkin wrote: > > On Wed, Jan 15, 2020 at 09:57:03PM -0500, Raphael Norwitz wrote: > > > > Changes since V1: > > * Kept the assert in vhost_user_set_mem_table_postcopy, but moved it > > to prevent corru

Re: [PATCH v2 1/3] Fixed assert in vhost_user_set_mem_table_postcopy

2020-02-10 Thread Raphael Norwitz
Yes - it's just a cleanup. On Thu, Feb 06, 2020 at 03:20:01AM -0500, Michael S. Tsirkin wrote: > > On Thu, Feb 06, 2020 at 03:17:04AM -0500, Michael S. Tsirkin wrote: > > On Wed, Jan 15, 2020 at 09:57:04PM -0500, Raphael Norwitz wrote: > > > The current vhost_u

Re: [PATCH v2 2/3] Refactor vhost_user_set_mem_table functions

2020-02-10 Thread Raphael Norwitz
Sounds good On Thu, Feb 06, 2020 at 03:21:42AM -0500, Michael S. Tsirkin wrote: > > On Wed, Jan 15, 2020 at 09:57:05PM -0500, Raphael Norwitz wrote: > > vhost_user_set_mem_table() and vhost_user_set_mem_table_postcopy() have > > gotten convoluted, and have some identical c

Re: [PATCH v2 3/3] Lift max memory slots limit imposed by vhost-user

2020-02-10 Thread Raphael Norwitz
On Thu, Feb 06, 2020 at 03:32:38AM -0500, Michael S. Tsirkin wrote: > > On Wed, Jan 15, 2020 at 09:57:06PM -0500, Raphael Norwitz wrote: > > The current vhost-user implementation in Qemu imposes a limit on the > > maximum number of memory slots exposed to a VM using a vhost-use

Re: [PATCH 1/1] vhost-user: Skip unnecessary duplicated VHOST_USER_ADD/REM_MEM_REG requests

2023-01-17 Thread Raphael Norwitz
I’m confused by this “one time request” path. MST - why do we classify SET_MEM_TABLE as a one time request if we send it on every hot-add/hot-remove. In particular I’m tripping over the following in vhost_user_write: /* * For non-vring specific requests, like VHOST_USER_SET_MEM_TABLE, * we j

Re: [PATCH] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement

2022-06-30 Thread Raphael Norwitz
quot; condition. Useless, > because it cannot be null (it's dereferenced right before), and even NIT: if it > it it could be, free() and g_free() do the right thing. Drop the > conditional. > Reviewed-by: Raphael Norwitz > Fixes: Coverity CID 1490290 > Signed-off-by: Ma

Re: [PATCH] block/vhost-user-blk: Fix hang on boot for some odd guests

2023-04-17 Thread Raphael Norwitz
Hey Andrey - apologies for the late reply here. It sounds like you are dealing with a buggy guest, rather than a QEMU issue. > On Apr 10, 2023, at 11:39 AM, Andrey Ryabinin wrote: > > > > On 4/10/23 10:35, Andrey Ryabinin wrote: >> Some guests hang on boot when using the vhost-user-blk-pci de

[PATCH v5] Prevent vhost-user-blk-test hang

2021-09-27 Thread Raphael Norwitz
-user messages and thereby resolves the hang. [1] https://lore.kernel.org/qemu-devel/CAFEAcA8kYpz9LiPNxnWJAPSjc=nv532bedyfynabemeohqb...@mail.gmail.com/ Signed-off-by: Raphael Norwitz Reviewed-by: Eric Blake --- tests/qtest/vhost-user-blk-test.c | 26 +- 1 file change

Re: [PATCH v5] Prevent vhost-user-blk-test hang

2021-09-29 Thread Raphael Norwitz
On Tue, Sep 28, 2021 at 10:55:00AM +0200, Stefan Hajnoczi wrote: > On Mon, Sep 27, 2021 at 05:17:01PM +0000, Raphael Norwitz wrote: > > In the vhost-user-blk-test, as of now there is nothing stoping > > vhost-user-blk in QEMU writing to the socket right after forking off the >

Re: [PATCH v5] Prevent vhost-user-blk-test hang

2021-10-01 Thread Raphael Norwitz
On Thu, Sep 30, 2021 at 10:48:09AM +0100, Stefan Hajnoczi wrote: > On Thu, Sep 30, 2021 at 05:29:06AM +0000, Raphael Norwitz wrote: > > On Tue, Sep 28, 2021 at 10:55:00AM +0200, Stefan Hajnoczi wrote: > > > On Mon, Sep 27, 2021 at 05:17:01PM +0000, Raphael Norwitz wrote: > &g

[PATCH v3 3/6] libvhost-user: Simplify VHOST_USER_REM_MEM_REG

2022-01-16 Thread Raphael Norwitz
From: David Hildenbrand Let's avoid having to manually copy all elements. Copy only the ones necessary to close the hole and perform the operation in-place without a second array. Reviewed-by: Stefan Hajnoczi Signed-off-by: David Hildenbrand Signed-off-by: Raphael Norwitz --- subpro

[PATCH v3 5/6] libvhost-user: prevent over-running max RAM slots

2022-01-16 Thread Raphael Norwitz
the number of RAM slots the device has available before proceeding to process the VHOST_USER_ADD_MEM_REG message. Suggested-by: Stefan Hajnoczi Signed-off-by: Raphael Norwitz --- subprojects/libvhost-user/libvhost-user.c | 8 1 file changed, 8 insertions(+) diff --git a/subprojects

[PATCH v3 0/6] Clean up error handling in libvhost-user memory mapping

2022-01-16 Thread Raphael Norwitz
ree slots * Improved error messages when the backend receives invalid vmsg->fd_num and/or vmeg->size Dropped R-b tags due to non-trivial changes. Thanks, Raphael David Hildenbrand (2): libvhost-user: Simplify VHOST_USER_REM_MEM_REG libvhost-user: fix VHOST_USER_REM_MEM_REG not closing

[PATCH v3 2/6] libvhost-user: Add vu_add_mem_reg input validation

2022-01-16 Thread Raphael Norwitz
a message with a size less than that of a memory region descriptor, we add a check to gracefully report an error and fail the operation rather than crashing. Signed-off-by: Raphael Norwitz --- subprojects/libvhost-user/libvhost-user.c | 15 +++ 1 file changed, 15 insertions(+) diff

[PATCH v3 4/6] libvhost-user: fix VHOST_USER_REM_MEM_REG not closing the fd

2022-01-16 Thread Raphael Norwitz
From: David Hildenbrand We end up not closing the file descriptor, resulting in leaking one file descriptor for each VHOST_USER_REM_MEM_REG message. Fixes: 875b9fd97b34 ("Support individual region unmap in libvhost-user") Cc: Michael S. Tsirkin Cc: Raphael Norwitz Cc: "Marc-An

[PATCH v3 6/6] libvhost-user: handle removal of identical regions

2022-01-16 Thread Raphael Norwitz
ing vu_rem_mem_reg() iterate through all regions in dev->regions[] and delete all matching regions. Suggested-by: Stefan Hajnoczi Signed-off-by: Raphael Norwitz --- subprojects/libvhost-user/libvhost-user.c | 28 +-- 1 file changed, 16 insertions(+), 12 deletions(-) diff -

[PATCH v3 1/6] libvhost-user: Add vu_rem_mem_reg input validation

2022-01-16 Thread Raphael Norwitz
sends a message with a size less than that of a memory region descriptor, we add a check to gracefully report an error and fail the operation rather than crashing. Signed-off-by: Raphael Norwitz --- subprojects/libvhost-user/libvhost-user.c | 15 +++ subprojects/libvhost-user/libvhost

Re: [PATCH v1] libvhost-user: Map shared RAM with MAP_NORESERVE to support virtio-mem with hugetlb

2022-01-16 Thread Raphael Norwitz
x27;t be anything to take care of in regard of > other OS support. > > Without this change, libvhost-user will fail mapping the region if there > are currently not enough huge pages to perform the reservation: > fv_panic: libvhost-user: region mmap error: Cannot allocate memory > &g

Re: [PATCH v2] vhost-user-scsi: avoid unlink(NULL) with fd passing

2022-05-16 Thread Raphael Norwitz
> > Fixes: Coverity CID 1488353 > Fixes: 747421e949fc1eb3ba66b5fcccdb7ba051918241 ("Implements Backend Program > conventions for vhost-user-scsi") > Signed-off-by: Stefan Hajnoczi > --- Reviewed-by: Raphael Norwitz > contrib/vhost-user-scsi/vhost-user-scsi.c | 5 - >

Accelerating non-standard disk types

2022-05-16 Thread Raphael Norwitz
Hey Stefan, We've been thinking about ways to accelerate other disk types such as SATA and IDE rather than translating to SCSI and using QEMU's iSCSI driver, with existing and more performant backends such as SPDK. We think there are some options worth exploring: [1] Keep using the SCSI translati

Re: Accelerating non-standard disk types

2022-05-19 Thread Raphael Norwitz
On Tue, May 17, 2022 at 04:29:17PM +0100, Stefan Hajnoczi wrote: > On Mon, May 16, 2022 at 05:38:31PM +0000, Raphael Norwitz wrote: > > Hey Stefan, > > > > We've been thinking about ways to accelerate other disk types such as > > SATA and IDE rather than translatin

Re: Accelerating non-standard disk types

2022-05-19 Thread Raphael Norwitz
On Tue, May 17, 2022 at 03:53:52PM +0200, Paolo Bonzini wrote: > On 5/16/22 19:38, Raphael Norwitz wrote: > > [1] Keep using the SCSI translation in QEMU but back vDisks with a > > vhost-user-scsi or vhost-user-blk backend device. > > [2] Implement SATA and IDE emulation w

Re: [RFC 0/5] Clean up error handling in libvhost-user memory mapping

2022-01-04 Thread Raphael Norwitz
Ping On Wed, Dec 15, 2021 at 10:29:46PM +, Raphael Norwitz wrote: > Hey Stefan, Marc-Andre, MST, David - > > As promised here is a series cleaning up error handling in the > libvhost-user memory mapping path. Most of these cleanups are > straightforward and have been discussed

Re: [RFC 1/5] libvhost-user: Add vu_rem_mem_reg input validation

2022-01-05 Thread Raphael Norwitz
On Wed, Jan 05, 2022 at 11:00:35AM +, Stefan Hajnoczi wrote: > On Wed, Dec 15, 2021 at 10:29:48PM +0000, Raphael Norwitz wrote: > > Signed-off-by: Raphael Norwitz > > --- > > subprojects/libvhost-user/libvhost-user.c | 6 ++ > > 1 file changed, 6 insertio

Re: [RFC 5/5] libvhost-user: handle removal of identical regions

2022-01-05 Thread Raphael Norwitz
On Wed, Jan 05, 2022 at 11:18:52AM +, Stefan Hajnoczi wrote: > On Wed, Dec 15, 2021 at 10:29:55PM +0000, Raphael Norwitz wrote: > > diff --git a/subprojects/libvhost-user/libvhost-user.c > > b/subprojects/libvhost-user/libvhost-user.c > > index 74a9980194..2f465a

[PATCH v2 1/5] libvhost-user: Add vu_rem_mem_reg input validation

2022-01-05 Thread Raphael Norwitz
Signed-off-by: Raphael Norwitz --- subprojects/libvhost-user/libvhost-user.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index 787f4d2d4f..a6dadeb637 100644 --- a/subprojects/libvhost-user

[PATCH v2 2/5] libvhost-user: Add vu_add_mem_reg input validation

2022-01-05 Thread Raphael Norwitz
Signed-off-by: Raphael Norwitz --- subprojects/libvhost-user/libvhost-user.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index a6dadeb637..d61285e991 100644 --- a/subprojects/libvhost-user

[PATCH v2 4/5] libvhost-user: prevent over-running max RAM slots

2022-01-05 Thread Raphael Norwitz
the number of RAM slots the device has available before proceeding to process the VHOST_USER_ADD_MEM_REG message. Suggested-by: Stefan Hajnoczi Signed-off-by: Raphael Norwitz --- subprojects/libvhost-user/libvhost-user.c | 5 + 1 file changed, 5 insertions(+) diff --git a/subprojects/libvhost

[PATCH v2 0/5] Clean up error handling in libvhost-user memory mapping

2022-01-05 Thread Raphael Norwitz
false instead of true. * vu_rem_mem_reg unmaps all matching regions. * Decriment iterator variable when looping through regions in vu_rem_mem_reg to ensure matching regions aren’t missed. Thanks, Raphael David Hildenbrand (1): libvhost-user: Simplify VHOST_USER_REM_MEM_REG Raphael

[PATCH v2 5/5] libvhost-user: handle removal of identical regions

2022-01-05 Thread Raphael Norwitz
ing vu_rem_mem_reg() iterate through all regions in dev->regions[] and delete all matching regions. Suggested-by: Stefan Hajnoczi Signed-off-by: Raphael Norwitz --- subprojects/libvhost-user/libvhost-user.c | 26 --- 1 file changed, 14 insertions(+), 12 deletions(-) diff -

[PATCH v2 3/5] libvhost-user: Simplify VHOST_USER_REM_MEM_REG

2022-01-05 Thread Raphael Norwitz
From: David Hildenbrand Let's avoid having to manually copy all elements. Copy only the ones necessary to close the hole and perform the operation in-place without a second array. Signed-off-by: David Hildenbrand Signed-off-by: Raphael Norwitz Reviewed-by: Stefan Hajnoczi --- subpro

Re: [PATCH v2 1/5] libvhost-user: Add vu_rem_mem_reg input validation

2022-01-10 Thread Raphael Norwitz
On Mon, Jan 10, 2022 at 04:36:34AM -0500, Michael S. Tsirkin wrote: > On Thu, Jan 06, 2022 at 06:47:26AM +0000, Raphael Norwitz wrote: > > Signed-off-by: Raphael Norwitz > > > Raphael any chance you can add a bit more to commit logs? > E.g. what happens right now if y

Re: [PATCH v2 0/5] Clean up error handling in libvhost-user memory mapping

2022-01-10 Thread Raphael Norwitz
On Mon, Jan 10, 2022 at 10:01:36AM +0100, David Hildenbrand wrote: > On 06.01.22 07:47, Raphael Norwitz wrote: > > Hey Stefan, Marc-Andre, MST, David - > > > > As promised here is a series cleaning up error handling in the > > libvhost-user memory mapping path.

Re: [PATCH v2 4/5] libvhost-user: prevent over-running max RAM slots

2022-01-10 Thread Raphael Norwitz
On Mon, Jan 10, 2022 at 04:40:08AM -0500, Michael S. Tsirkin wrote: > On Thu, Jan 06, 2022 at 06:47:35AM +0000, Raphael Norwitz wrote: > > When VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS support was added to > > libvhost-user, no guardrails were added to protect against QEMU > &

Re: [PATCH v2 5/5] libvhost-user: handle removal of identical regions

2022-01-10 Thread Raphael Norwitz
On Mon, Jan 10, 2022 at 09:58:01AM +0100, David Hildenbrand wrote: > On 06.01.22 07:47, Raphael Norwitz wrote: > > Today if QEMU (or any other VMM) has sent multiple copies of the same > > region to a libvhost-user based backend and then attempts to remove the > > region, onl

Re: [PATCH] vhost-user-scsi: avoid unlink(NULL) with fd passing

2022-04-29 Thread Raphael Norwitz
tions. > > When fd passing is used the UNIX domain socket path is NULL and we must > not call unlink(2). > > Fixes: Coverity CID 1488353 > Fixes: 747421e949fc1eb3ba66b5fcccdb7ba051918241 ("Implements Backend Program > conventions for vhost-user-scsi") > Signed-o

Re: [PATCH] vhost-user: Use correct macro name TARGET_PPC64g

2022-05-04 Thread Raphael Norwitz
On Tue, May 03, 2022 at 03:01:08PM -0300, Murilo Opsfelder Araujo wrote: > The correct name of the macro is TARGET_PPC64. > > Fixes: 27598393a232 ("Lift max memory slots limit imposed by vhost-user") > Reported-by: Fabiano Rosas > Signed-off-by: Murilo Opsfelder Arau

Re: [PATCH v2 0/8] vhost-user-blk: dynamically resize config space based on features

2022-09-01 Thread Raphael Norwitz
> ping Apologies for the late review - busy week. First pass looks good but will review comprehensively tomorrow or over the weekend.

Re: [PATCH v2 1/8] virtio: introduce VirtIOConfigSizeParams & virtio_get_config_size

2022-09-02 Thread Raphael Norwitz
I feel like it would be easier to review if the first 4 patches were squashed together, but that’s not a big deal. For this one: Reviewed-by: Raphael Norwitz On Fri, Aug 26, 2022 at 05:32:41PM +0300, Daniil Tatianin wrote: > This is the first step towards moving all device config s

Re: [PATCH v2 6/8] vhost-user-blk: make it possible to disable write-zeroes/discard

2022-09-02 Thread Raphael Norwitz
On Fri, Aug 26, 2022 at 05:32:46PM +0300, Daniil Tatianin wrote: > It is useful to have the ability to disable these features for > compatibility with older VMs that don't have these implemented. > > Signed-off-by: Daniil Tatianin Reviewed-by: Raphael Norwitz > --- &g

Re: [PATCH v2 4/8] virtio: remove the virtio_feature_get_config_size helper

2022-09-02 Thread Raphael Norwitz
On Fri, Aug 26, 2022 at 05:32:44PM +0300, Daniil Tatianin wrote: > This has no more users and is superseded by virtio_get_config_size. > > Signed-off-by: Daniil Tatianin Reviewed-by: Raphael Norwitz > --- > hw/virtio/virtio.c | 15 --- > include/hw/vi

Re: [PATCH v2 7/8] vhost-user-blk: make 'config_wce' part of 'host_features'

2022-09-02 Thread Raphael Norwitz
On Fri, Aug 26, 2022 at 05:32:47PM +0300, Daniil Tatianin wrote: > No reason to have this be a separate field. This also makes it more akin > to what the virtio-blk device does. > > Signed-off-by: Daniil Tatianin Reviewed-by: Raphael Norwitz > --- > hw/block/vhost-user-

Re: [PATCH v2 2/8] virtio-blk: utilize VirtIOConfigSizeParams & virtio_get_config_size

2022-09-02 Thread Raphael Norwitz
On Fri, Aug 26, 2022 at 05:32:42PM +0300, Daniil Tatianin wrote: > Use the common helper instead of duplicating the same logic. > > Signed-off-by: Daniil Tatianin Reviewed-by: Raphael Norwitz > --- > hw/block/virtio-blk.c | 16 +++- > 1 file changed, 7 insertio

Re: [PATCH v2 8/8] vhost-user-blk: dynamically resize config space based on features

2022-09-02 Thread Raphael Norwitz
of migration failed: Invalid argument > > This is caused by the newer (destination) VM requiring a bigger BAR0 > alignment because it has to cover a bigger configuration space, which > isn't actually needed since those additional config fields are not > active (write-zeroes/discard).

Re: [PATCH v2 3/8] virtio-net: utilize VirtIOConfigSizeParams & virtio_get_config_size

2022-09-02 Thread Raphael Norwitz
On Fri, Aug 26, 2022 at 05:32:43PM +0300, Daniil Tatianin wrote: > Use the new common helper. As an added bonus this also makes use of > config size sanity checking via the 'max_size' field. > > Signed-off-by: Daniil Tatianin > --- > hw/net/virtio-net.c | 8 ++-- > 1 file changed, 6 insertio

Re: [PATCH v2 5/8] virtio-blk: move config size params to virtio-blk-common

2022-09-02 Thread Raphael Norwitz
The vhost-user-blk bits in meson.build and Maintainers should probably be in patch 8? Otherwise LGTM. On Fri, Aug 26, 2022 at 05:32:45PM +0300, Daniil Tatianin wrote: > This way we can reuse it for other virtio-blk devices, e.g > vhost-user-blk, which currently does not control its config space s

Re: [PATCH 1/2] contrib/vhost-user-blk: Replace lseek64 with lseek

2022-12-18 Thread Raphael Norwitz
CE > when using glibc but not with musl. > Other than the nit LGTM Reviewed-by: Raphael Norwitz > Signed-off-by: Khem Raj > Cc: Michael S. Tsirkin > CC: Raphael Norwitz > --- > contrib/vhost-user-blk/vhost-user-blk.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 delet

Re: [PATCH v2] contrib/vhost-user-blk: Replace lseek64 with lseek

2022-12-18 Thread Raphael Norwitz
sing glibc but not with musl. > > Signed-off-by: Khem Raj > Cc: Michael S. Tsirkin > CC: Raphael Norwitz > --- > v2: Fix typo must->musl > > contrib/vhost-user-blk/vhost-user-blk.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git

Re: [PATCH v5 0/3] vhost-user-blk: live resize additional APIs

2024-07-01 Thread Raphael Norwitz
I have no issues with these APIs, but I'm not a QMP expert so others should review those bits. For the vhost-user-blk code: Acked-by: Raphael Norwitz On Tue, Jun 25, 2024 at 8:19 AM Vladimir Sementsov-Ogievskiy wrote: > > v5: > 03: drop extra check on is is runstate running

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-14 Thread Raphael Norwitz
Code looks good. Just a question on the error case you're trying to fix. On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: > > When the vhost-user is reconnecting to the backend, and if the vhost-user > fails > at the get_features in vhost_dev_init(), then the reconnect will fail > and it will not

Re: [PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-14 Thread Raphael Norwitz
The code for these two patches looks fine. Just some questions on the failure case you're trying to fix. On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: > > This reverts commit f02a4b8e6431598612466f76aac64ab492849abf. > > Since the current patch cannot completely fix the lost reconnect > problem

Re: [PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-15 Thread Raphael Norwitz
On Wed, May 15, 2024 at 1:47 AM Li Feng wrote: > > > > > 2024年5月14日 21:58,Raphael Norwitz 写道: > > > > The code for these two patches looks fine. Just some questions on the > > failure case you're trying to fix. > > > > > > On Tue, May 14

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-15 Thread Raphael Norwitz
The case your describing makes sense but now I have some concerns on the vhost_dev_cleanup bit. On Wed, May 15, 2024 at 1:47 AM Li Feng wrote: > > > > > 2024年5月14日 21:58,Raphael Norwitz 写道: > > > > Code looks good. Just a question on the error case you're tryin

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-15 Thread Raphael Norwitz
OK - I'm happy with this approach then. On Wed, May 15, 2024 at 10:48 PM Li Feng wrote: > > > > 2024年5月15日 23:47,Raphael Norwitz 写道: > > The case your describing makes sense but now I have some concerns on > the vhost_dev_cleanup bit. > > On Wed, May 15

Re: [PATCH v4 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-15 Thread Raphael Norwitz
from the guest os, > s->connected has no chance to be set to false, resulting in > subsequent reconnection not being executed. > > The next patch will completely fix this issue with a better approach. > Reviewed-by: Raphael Norwitz > Signed-off-by: Li Feng >

  1   2   3   4   >