Re: [PATCH 7/6] mirror: Allow QMP override to declare target already zero

2025-04-11 Thread Markus Armbruster
Eric Blake writes: > Qemu's attempts to learn whether a destination file starts life with QEMU (multiple times). > all zero contents are just a hueristic. There may be cases where the heuristic > caller is aware of information that qemu cannot learn quickly, in > which case telling qemu what

Re: [PATCH v3 0/3] Enable QEMU NVMe userspace driver on s390x

2025-04-11 Thread Farhan Ali
On 4/11/2025 3:28 PM, Alex Williamson wrote: On Thu, 10 Apr 2025 09:07:51 -0700 Farhan Ali wrote: On 4/3/2025 2:24 PM, Alex Williamson wrote: On Thu, 3 Apr 2025 13:33:17 -0700 Farhan Ali wrote: On 4/3/2025 11:05 AM, Alex Williamson wrote: On Thu, 3 Apr 2025 10:33:52 -0700 Farhan Ali

Re: [PATCH v3 0/3] Enable QEMU NVMe userspace driver on s390x

2025-04-11 Thread Alex Williamson
On Thu, 10 Apr 2025 09:07:51 -0700 Farhan Ali wrote: > On 4/3/2025 2:24 PM, Alex Williamson wrote: > > On Thu, 3 Apr 2025 13:33:17 -0700 > > Farhan Ali wrote: > > > >> On 4/3/2025 11:05 AM, Alex Williamson wrote: > >>> On Thu, 3 Apr 2025 10:33:52 -0700 > >>> Farhan Ali wrote: > >>> > >

Re: [PATCH 0/6] Make blockdev-mirror dest sparse in more cases

2025-04-11 Thread Eric Blake
On Thu, Apr 10, 2025 at 08:04:50PM -0500, Eric Blake wrote: > When mirroring images, it makes sense for the destination to be sparse > even if it was not connected with "discard":"unmap"; the only time the > destination should be fully allocated is if the user pre-allocated it, > or if the source w

Re: [PATCH 1/6] mirror: Skip pre-zeroing destination if it is already zero

2025-04-11 Thread Vladimir Sementsov-Ogievskiy
On 11.04.25 04:04, Eric Blake wrote: When doing a sync=full mirroring, QMP drive-mirror requests full zeroing if it did not just create the destination, and blockdev-mirror requests full zeroing unconditionally. This is because during a full sync, we must ensure that the portions of the disk tha

Re: [PATCH v3 05/12] iotests/common.rc: add disk_usage function

2025-04-11 Thread Eric Blake
On Fri, Sep 13, 2024 at 07:39:35PM +0300, Andrey Drobyshev wrote: > Move the definition from iotests/250 to common.rc. This is used to > detect real disk usage of sparse files. In particular, we want to use > it for checking subclusters-based discards. > > Signed-off-by: Andrey Drobyshev > Revi

Re: [PATCH 08/10] hw/9pfs: Allow using hw/9pfs with emscripten

2025-04-11 Thread Kohei Tokunaga
Hi Paolo, > > Emscripten's fiber does not support submitting coroutines to other > > threads. > > Does it work as long as the thread does not rewind? The structure used by Fiber includes a thread-specific field related to rewind [1], which prevents it from being shared across threads. The behavio

Re: [PATCH v2 2/2] block/io: skip head/tail requests on EINVAL

2025-04-11 Thread Eric Blake
On Fri, Apr 11, 2025 at 10:18:55AM +0200, Hanna Czenczek wrote: > > if (ret && ret != -ENOTSUP) { > > -goto out; > > +if (ret == -EINVAL && (offset % align != 0 || num % align != > > 0)) { > > Could use `(offset | num) % align != 0`, but either way: Use of | and

Re: [PATCH 1/2] file-posix: probe discard alignment on Linux block devices

2025-04-11 Thread Eric Blake
On Wed, Apr 09, 2025 at 02:29:13PM -0400, Stefan Hajnoczi wrote: > Populate the pdiscard_alignment block limit so the block layer is able > align discard requests correctly. > > Signed-off-by: Stefan Hajnoczi > --- > block/file-posix.c | 56 +- > 1 fil

Re: [PATCH v6] block/file-posix.c: Use pwritev2() with RWF_DSYNC for FUA

2025-04-11 Thread Eric Blake
On Mon, Apr 07, 2025 at 08:47:30AM -0700, Pinku Deb Nath wrote: > Full Unit Access (FUA) is an optimization where a disk write with the > flag set will be persisted to disk immediately instead of potentially > remaining in the disk's write cache. > > This commit address the todo task > for using p

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-04-11 Thread Kevin Wolf
Am 10.04.2025 um 17:28 hat Paolo Bonzini geschrieben: > On Thu, Apr 10, 2025 at 4:25 PM Paolo Bonzini wrote: > > You should set ret = 0 here to avoid going down the > > scsi_sense_from_errno() path. > > > > Otherwise, > > > > Reviewed-by: Paolo Bonzini > > Okay, going down the scsi_sense_from_er

Re: [PATCH 00/10] Enable QEMU to run on browsers

2025-04-11 Thread Pierrick Bouvier
On 4/11/25 07:36, Kohei Tokunaga wrote: Hi Pierrick, thank you for the feedback. > first, congrats for this work! > It would be really nice to have this available upstream, starting with a > modest TCI port, before having the tcg backend also. Sure, I'll split the patch series, starting with

Re: [PATCH 00/10] Enable QEMU to run on browsers

2025-04-11 Thread Kohei Tokunaga
Hi Daniel, > On Wed, Apr 09, 2025 at 03:21:15PM -0400, Stefan Hajnoczi wrote: > > On Mon, Apr 07, 2025 at 11:45:51PM +0900, Kohei Tokunaga wrote: > > > This patch series enables QEMU's system emulator to run in a browser using > > > Emscripten. > > > It includes implementations and workarounds to

[PATCH 7/6] mirror: Allow QMP override to declare target already zero

2025-04-11 Thread Eric Blake
Qemu's attempts to learn whether a destination file starts life with all zero contents are just a hueristic. There may be cases where the caller is aware of information that qemu cannot learn quickly, in which case telling qemu what to assume about the destination can make the mirror operation fas

Re: [PATCH 00/10] Enable QEMU to run on browsers

2025-04-11 Thread Kohei Tokunaga
Hi Pierrick, thank you for the feedback. > first, congrats for this work! > It would be really nice to have this available upstream, starting with a > modest TCI port, before having the tcg backend also. Sure, I'll split the patch series, starting with the TCI port. > Do you have recent informat

Re: [PATCH 00/10] Enable QEMU to run on browsers

2025-04-11 Thread Kohei Tokunaga
Hi Paolo, > > > The biggest problem I'm seeing is we no longer support 64-bit guests on > > > 32-bit hosts, and don't plan to revert that. > > > > Yes, so the sixth patch ("[PATCH 06/10] include/exec: Allow using 64bit > > guest addresses on emscripten") should be considered as a temporary > > wor

[PATCH v2 2/2] scsi-disk: Advertise FUA support by default

2025-04-11 Thread Alberto Faria
Allow the guest to submit FUA requests directly, instead of forcing it to emulate them using a regular flush. Signed-off-by: Alberto Faria --- hw/core/machine.c | 1 + hw/scsi/scsi-disk.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/machine.c b/hw/core/machine.

[PATCH v2 1/2] scsi-disk: Add native FUA write support

2025-04-11 Thread Alberto Faria
Simply propagate the FUA flag on write requests to the driver. The block layer will emulate it if necessary. Signed-off-by: Alberto Faria --- hw/scsi/scsi-disk.c | 43 ++- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/hw/scsi/scsi-disk.c

[PATCH v2 0/2] scsi-disk: Add FUA write support

2025-04-11 Thread Alberto Faria
Add scsi-disk support for Force Unit Access (FUA) writes. The first patch lets us avoid FUA emulation when the underlying driver supports it natively. The second patch makes scsi-disk devices advertise FUA support by default. v2: - Drop FUA write emulation logic since the block layer already does

Re: [PATCH 05/10] meson: Add wasm build in build scripts

2025-04-11 Thread Kohei Tokunaga
Hi Paolo, > > > >> has_int128_type is set to false on emscripten as of now to avoid errors by > > > >> libffi. > > > > > > What is the error here? How hard would it be to test for it? > > > > When has_int128_type=true, I encountered a runtime error from libffi. To > > reproduce this, we need to a

Re: [PATCH 02/10] various: Define macros for dependencies on emscripten

2025-04-11 Thread Kohei Tokunaga
Hi Paolo, > > +#ifdef EMSCRIPTEN > > +/* > > + * emscripten exposes copy_file_range declaration but doesn't provide the > > + * implementation in the final link. Define the stub here but avoid type > > + * conflict with the emscripten's header. > > + */ > > +ssize_t copy_file_range(int in_fd, off_

Re: [PATCH 01/10] various: Fix type conflict of GLib function pointers

2025-04-11 Thread Kohei Tokunaga
Hi Paolo, > > On emscripten, function pointer casts can cause function call failure. > > This commit fixes the function definition to match to the type of the > > function call. > > > > - qtest_set_command_cb passed to g_once should match to GThreadFunc > > Sending an alternative patch that doesn'

Re: [PATCH 07/10] tcg: Add a TCG backend for WebAssembly

2025-04-11 Thread Philippe Mathieu-Daudé
Hi Kohei, On 7/4/25 16:45, Kohei Tokunaga wrote: A TB consists of a wasmTBHeader followed by the data listed below. The wasmTBHeader contains pointers for each element: - TCI code - Wasm code - Array of function indices imported into the Wasm instance - Counter tracking the number of TB executi

Re: [PATCH 08/10] hw/9pfs: Allow using hw/9pfs with emscripten

2025-04-11 Thread Kohei Tokunaga
Hi Christian, > > Emscripten's fiber does not support submitting coroutines to other > > threads. So this commit modifies hw/9pfs/coth.h to disable this behavior > > when compiled with Emscripten. > > The lack of being able to dispatch a coroutine to a worker thread is one > thing, however it woul

Re: [PATCH 00/10] Enable QEMU to run on browsers

2025-04-11 Thread Daniel P . Berrangé
On Wed, Apr 09, 2025 at 03:21:15PM -0400, Stefan Hajnoczi wrote: > On Mon, Apr 07, 2025 at 11:45:51PM +0900, Kohei Tokunaga wrote: > > This patch series enables QEMU's system emulator to run in a browser using > > Emscripten. > > It includes implementations and workarounds to address browser enviro

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-04-11 Thread Paolo Bonzini
On Fri, Apr 11, 2025 at 12:18 PM Kevin Wolf wrote: > > Okay, going down the scsi_sense_from_errno() path is more or less > > harmless because status and sense end up unused; even though ENODEV is > > not something that the function handles, that can be added as a > > cleanup in 10.1. > > Yes, it c

Re: [RFC PATCH-for-8.0 09/10] hw/virtio: Extract vhost_user_ram_slots_max() to vhost-user-target.c

2025-04-11 Thread Philippe Mathieu-Daudé
On 10/4/25 19:29, Pierrick Bouvier wrote: On 4/10/25 10:21, Philippe Mathieu-Daudé wrote: On 10/4/25 16:36, Pierrick Bouvier wrote: On 4/10/25 05:14, Philippe Mathieu-Daudé wrote: Hi Pierrick, On 13/12/22 00:05, Philippe Mathieu-Daudé wrote: The current definition of VHOST_USER_MAX_RAM_SLOTS

Re: Configuring onboard devices, in particular memory contents

2025-04-11 Thread Cédric Le Goater
On 4/11/25 11:08, Kane Chen wrote: Hi Markus, Thank you for the background information. Since the OTP device is part of the Secure Boot Controller (SBC), I plan to register it in the global table. I believe this will simplify usage. Meanwhile, based on Philippe's comment, I’m working on `aspe

Re: [PATCH 00/10] Enable QEMU to run on browsers

2025-04-11 Thread Paolo Bonzini
On 4/10/25 15:13, Kohei Tokunaga wrote: > The biggest problem I'm seeing is we no longer support 64-bit guests on > 32-bit hosts, and don't plan to revert that. Yes, so the sixth patch ("[PATCH 06/10] include/exec: Allow using 64bit guest addresses on emscripten") should be considered as a tempo

RE: Configuring onboard devices, in particular memory contents (was: [PATCH v1 0/1] hw/misc/aspeed_sbc: Implement OTP memory and controller)

2025-04-11 Thread Kane Chen
Hi Markus, Thank you for the background information. Since the OTP device is part of the Secure Boot Controller (SBC), I plan to register it in the global table. I believe this will simplify usage. Meanwhile, based on Philippe's comment, I’m working on `aspeed_otp.c` to handle low-level OTP op

Re: [PATCH v2 2/2] block/io: skip head/tail requests on EINVAL

2025-04-11 Thread Hanna Czenczek
On 10.04.25 20:41, Stefan Hajnoczi wrote: When guests send misaligned discard requests, the block layer breaks them up into a misaligned head, an aligned main body, and a misaligned tail. The file-posix block driver on Linux returns -EINVAL on misaligned discard requests. This causes bdrv_co_pdi

Re: [PATCH v2 1/2] file-posix: probe discard alignment on Linux block devices

2025-04-11 Thread Hanna Czenczek
On 10.04.25 20:41, Stefan Hajnoczi wrote: Populate the pdiscard_alignment block limit so the block layer is able align discard requests correctly. Signed-off-by: Stefan Hajnoczi --- block/file-posix.c | 56 +- 1 file changed, 55 insertions(+), 1 de