Re: [PATCH v3] hw/pflash: fix block write start

2024-05-15 Thread Philippe Mathieu-Daudé
! While being at it drop a leftover FIXME. Resolves: #2343 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2343 I suppose we also need: Cc: qemu-sta...@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Fixes: fcc79f2e0955 ("hw/pflash: implement update buffer for block writes")

Re: [PATCH 4/6] cpus: Improve error messages on memsave, pmemsave write error

2024-05-13 Thread Philippe Mathieu-Daudé
On 13/5/24 16:45, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: On 13/5/24 16:17, Markus Armbruster wrote: qmp_memsave() and qmp_pmemsave() report fwrite() error as An IO error has occurred Improve this to writing memory to '' failed Signed-off-by: Markus Armbruster

Re: [PATCH 2/6] dump/win_dump: Improve error messages on write error

2024-05-13 Thread Philippe Mathieu-Daudé
On 13/5/24 16:48, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: On 13/5/24 16:16, Markus Armbruster wrote: create_win_dump() and write_run report qemu_write_full() failure to their callers as An IO error has occurred The errno set by qemu_write_full() is lost. Improve

Re: [PATCH 6/6] qerror: QERR_IO_ERROR is no longer used, drop

2024-05-13 Thread Philippe Mathieu-Daudé
On 13/5/24 16:17, Markus Armbruster wrote: Signed-off-by: Markus Armbruster --- include/qapi/qmp/qerror.h | 3 --- 1 file changed, 3 deletions(-) One less! Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 4/6] cpus: Improve error messages on memsave, pmemsave write error

2024-05-13 Thread Philippe Mathieu-Daudé
On 13/5/24 16:17, Markus Armbruster wrote: qmp_memsave() and qmp_pmemsave() report fwrite() error as An IO error has occurred Improve this to writing memory to '' failed Signed-off-by: Markus Armbruster --- system/cpus.c | 6 -- 1 file changed, 4 insertions(+), 2

Re: [PATCH 1/6] block: Improve error message when external snapshot can't flush

2024-05-13 Thread Philippe Mathieu-Daudé
--- blockdev.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 5/6] migration: Rephrase message on failure to save / load Xen device state

2024-05-13 Thread Philippe Mathieu-Daudé
failed respectively. Signed-off-by: Markus Armbruster --- migration/savevm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 3/6] block/vmdk: Improve error messages on extent write error

2024-05-13 Thread Philippe Mathieu-Daudé
| 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 2/6] dump/win_dump: Improve error messages on write error

2024-05-13 Thread Philippe Mathieu-Daudé
On 13/5/24 16:16, Markus Armbruster wrote: create_win_dump() and write_run report qemu_write_full() failure to their callers as An IO error has occurred The errno set by qemu_write_full() is lost. Improve this to win-dump: failed to write header: and win-dump: failed to

Re: [PATCH v4 11/12] tests/qtest/vhost-user-blk-test: use memory-backend-shm

2024-05-10 Thread Philippe Mathieu-Daudé
/vhost-user-blk-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé (on macOS)

Re: [PATCH v4 08/12] libvhost-user: enable it on any POSIX system

2024-05-10 Thread Philippe Mathieu-Daudé
On 10/5/24 10:56, Stefano Garzarella wrote: On Wed, May 08, 2024 at 12:36:30PM GMT, Philippe Mathieu-Daudé wrote: On 8/5/24 09:44, Stefano Garzarella wrote: The vhost-user protocol is not really Linux-specific so let's enable libvhost-user for any POSIX system. Alternatively add

Re: [PATCH v3 00/28] glib: Replace g_memdup() by g_memdup2()

2024-05-08 Thread Philippe Mathieu-Daudé
On 3/9/21 19:44, Philippe Mathieu-Daudé wrote: Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy

Re: [PATCH] misc: Use QEMU header path relative to include/ directory

2024-05-08 Thread Philippe Mathieu-Daudé
On 7/5/24 16:27, Philippe Mathieu-Daudé wrote: QEMU headers are relative to the include/ directory, not to the project root directory. Remove "include/". See also: https://www.qemu.org/docs/master/devel/style.html#include-directives Signed-off-by: Philippe Mathieu-Daudé --- hw/au

Re: [PATCH v4 00/12] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: The vhost-user protocol is not really Linux-specific, so let's try support QEMU's frontends and backends (including libvhost-user) in any POSIX system with this series. The main use case is to be able to use virtio devices that we don't have built-in

Re: [PATCH v4 03/12] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported

2024-05-08 Thread Philippe Mathieu-Daudé
Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé

Re: [PATCH v4 08/12] libvhost-user: enable it on any POSIX system

2024-05-08 Thread Philippe Mathieu-Daudé
ned-off-by: Stefano Garzarella --- meson.build | 2 +- subprojects/libvhost-user/libvhost-user.h | 2 +- subprojects/libvhost-user/libvhost-user.c | 60 +-- 3 files changed, 59 insertions(+), 5 deletions(-) Reviewed-by: Philippe Mathieu-Daud

Re: [PATCH v4 09/12] contrib/vhost-user-blk: enable it on any POSIX system

2024-05-08 Thread Philippe Mathieu-Daudé
Otherwise, Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé

Re: [PATCH v4 07/12] vhost-user: enable frontends on any POSIX system

2024-05-08 Thread Philippe Mathieu-Daudé
-by: Stefano Garzarella --- meson.build| 1 - hw/net/vhost_net.c | 5 + hw/block/Kconfig | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé on macOS: Tested-by: Philippe Mathieu-Daudé

Re: [PATCH v4 06/12] contrib/vhost-user-*: use QEMU bswap helper functions

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 12:13, Philippe Mathieu-Daudé wrote: On 8/5/24 09:44, Stefano Garzarella wrote: Let's replace the calls to le*toh() and htole*() with qemu/bswap.h helpers to make the code more portable. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Stefano Garzarella ---   contrib/vhost-user

Re: [PATCH v4 05/12] contrib/vhost-user-blk: fix bind() using the right size of the address

2024-05-08 Thread Philippe Mathieu-Daudé
, addrlen can be specified as sizeof(struct sockaddr_un). So let's follow the last advice and simplify the code as well. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Stefano Garzarella --- contrib/vhost-user-blk/vhost-user-blk.c | 4 +--- 1 file changed, 1 insertion

Re: [PATCH v4 01/12] libvhost-user: set msg.msg_control to NULL when it is empty

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if the `struct msghdr` has the field `msg_controllen` set to 0, but `msg_control` is not NULL. Reviewed-by: Eric Blake Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v4 02/12] libvhost-user: fail vu_message_write() if sendmsg() is failing

2024-05-08 Thread Philippe Mathieu-Daudé
(+) Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé

Re: [PATCH v4 06/12] contrib/vhost-user-*: use QEMU bswap helper functions

2024-05-08 Thread Philippe Mathieu-Daudé
On 8/5/24 09:44, Stefano Garzarella wrote: Let's replace the calls to le*toh() and htole*() with qemu/bswap.h helpers to make the code more portable. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Stefano Garzarella --- contrib/vhost-user-blk/vhost-user-blk.c | 9 + contrib

[PATCH] misc: Use QEMU header path relative to include/ directory

2024-05-07 Thread Philippe Mathieu-Daudé
QEMU headers are relative to the include/ directory, not to the project root directory. Remove "include/". See also: https://www.qemu.org/docs/master/devel/style.html#include-directives Signed-off-by: Philippe Mathieu-Daudé --- hw/audio/virtio-snd.c | 2 +- hw/rtc/ls7a_rtc.c

Re: [PATCH] iotests/pylintrc: allow up to 10 similar lines

2024-04-30 Thread Philippe Mathieu-Daudé
/pylintrc +++ b/tests/qemu-iotests/pylintrc @@ -55,4 +55,4 @@ max-line-length=79 [SIMILARITIES] -min-similarity-lines=6 +min-similarity-lines=10 Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH] block/copy-before-write: use uint64_t for timeout in nanoseconds

2024-04-29 Thread Philippe Mathieu-Daudé
OnCbwError on_cbw_error; -uint32_t cbw_timeout_ns; +uint64_t cbw_timeout_ns; Reviewed-by: Philippe Mathieu-Daudé

[PULL 5/5] block/gluster: Remove deprecated RDMA protocol handling

2024-04-24 Thread Philippe Mathieu-Daudé
in commit e9a54265f5 ("hw/rdma: Deprecate the pvrdma device and the rdma subsystem") released in v8.2. Cc: Prasanna Kumar Kalever Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Michael S. Tsirkin Message-Id: <20240328130255.52257-4-phi...@linaro.org> -

[PULL 3/5] hw/timer: Remove the ALTERA_TIMER model

2024-04-24 Thread Philippe Mathieu-Daudé
The ALTERA_TIMER was only used by Nios II machines, which have been removed. Since it has no direct user, remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240327144806.11319-4-phi...@linaro.org> --- hw/timer/altera_timer.c

[PULL 1/5] MAINTAINERS: Update Sriram Yagnaraman mail address

2024-04-24 Thread Philippe Mathieu-Daudé
From: Sriram Yagnaraman Due to company policies, I have changed my mail address. Updating MAINTAINERS and .mailmap to show my latest mail address. Signed-off-by: Sriram Yagnaraman Message-ID: <20240228080625.2412372-1-sriram.yagnara...@ericsson.com> Signed-off-by: Philippe Mathieu

[PULL 0/5] Housekeeping patches for 2024-04-24

2024-04-24 Thread Philippe Mathieu-Daudé
GlusterFS RDMA protocol handling - Update Sriram Yagnaraman mail address Philippe Mathieu-Daudé (4): target/nios2: Remove the deprecated Nios II target hw/timer: Remove the ALTERA_TIMER model hw/rdma: Remove deprecated pvrdma device

[PATCH v2] tests/unit: Remove debug statements in test-nested-aio-poll.c

2024-04-22 Thread Philippe Mathieu-Daudé
oll_false 0x16bb26164 io_read 0x16bb26164 < io_poll_ready 88/100 qemu:unit / test-nested-aio-pollOK Reviewed-by: Eric Blake Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-nested-aio-poll.c | 7 --- 1 file changed, 7 deletions(-)

[PATCH] tests/unit: Remove debug statements in test-nested-aio-poll.c

2024-04-19 Thread Philippe Mathieu-Daudé
oll_false 0x16bb26164 io_read 0x16bb26164 < io_poll_ready 88/100 qemu:unit / test-nested-aio-pollOK Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-nested-aio-poll.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/tests/unit/test-nested-aio-poll.c b/tests/unit/tes

Re: [PATCH v2] tests/qtest : Use `g_assert_cmphex` instead of `g_assert_cmpuint`

2024-04-15 Thread Philippe Mathieu-Daudé
46 - tests/qtest/sse-timer-test.c | 4 +- tests/qtest/stm32l4x5_exti-test.c | 138 - tests/qtest/stm32l4x5_syscfg-test.c| 74 ++--- 10 files changed, 151 insertions(+), 151 deletions(-) Thanks for the generic cleanup! Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 01/13] tests: Remove Ubuntu 20.04 container

2024-04-12 Thread Philippe Mathieu-Daudé
| 1 - 2 files changed, 158 deletions(-) delete mode 100644 tests/docker/dockerfiles/ubuntu2004.docker Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH] dma-helpers: Fix iovec alignment

2024-04-12 Thread Philippe Mathieu-Daudé
On 12/4/24 10:06, Stefan Fritsch wrote: Commit 99868af3d0 changed the hardcoded constant BDRV_SECTOR_SIZE to a dynamic field 'align' but introduced a bug. qemu_iovec_discard_back() is now passed the wanted iov length instead of the actually required amount that should be removed from the end of

Re: [PATCH v2 09/13] util/hexdump: Replace sprintf() by g_string_append_printf()

2024-04-11 Thread Philippe Mathieu-Daudé
On 11/4/24 12:15, Philippe Mathieu-Daudé wrote: sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Replace sprintf() by GString API in order to avoid: [426/1310] Compiling C object libqemuutil.a.p/util_hexdump.c.o util/hexdump.c

[PATCH v2 09/13] util/hexdump: Replace sprintf() by g_string_append_printf()

2024-04-11 Thread Philippe Mathieu-Daudé
)buf[b + i]); ^ util/hexdump.c:37:21: warning: 'sprintf' is deprecated: line += sprintf(line, " "); ^ 2 warnings generated. Signed-off-by: Philippe Mathieu-Daudé --- util/hexdump.c | 17 - 1 file changed, 8 insertions(+), 9 dele

[PATCH v2 05/13] hw/mips/malta: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/malta.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 9fc6a7d313..5d33aa5123 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -857,7 +857,8 @@ static char *rng_seed_he

[PATCH v2 13/13] backends/tpm: Use qemu_hexdump_line() to avoid sprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] p += sprintf(p, "%.2X ", buffer[i]); ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Ste

[PATCH v2 08/13] util/hexdump: Have qemu_hexdump_line() return heap allocated buffer

2024-04-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/cutils.h | 10 +++--- hw/virtio/vhost-vdpa.c | 5 +++-- util/hexdump.c | 12 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 70ca4b876b

[PATCH v2 12/13] hw/dma/pl330: Use qemu_hexdump_line() to avoid sprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
buf[b + i]); ^ Signed-off-by: Philippe Mathieu-Daudé --- hw/dma/pl330.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index 70a502d245..0435378b7e 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -15,6 +15,7 @@ */ #include &qu

[PATCH v2 02/13] hw/vfio/pci: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- hw/vfio/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index

[PATCH v2 11/13] hw/ide/atapi: Use qemu_hexdump_line() to avoid sprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
ot;\n"); ^ Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/atapi.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 73ec373184..27b6aa59fd 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -24,6 +24,7 @@ */ #include "qemu/osd

[PATCH v2 03/13] hw/ppc/spapr: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] sprintf(mem_name, "memory@%" HWADDR_PRIx, start); ^ 1 warning generated. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/s

[PATCH v2 07/13] util/hexdump: Rename @offset argument in qemu_hexdump_line()

2024-04-11 Thread Philippe Mathieu-Daudé
@offset argument is more descriptive than @b. Inverse @bufptr <-> @offset arguments order. Document qemu_hexdump_line(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/cutils.h | 11 +-- hw/virtio/vhost-vdpa.c | 8 util/hexdump.c | 16 -

[PATCH v2 00/13] misc: Remove sprintf() due to macOS deprecation

2024-04-11 Thread Philippe Mathieu-Daudé
. Regards, Phil. [*] https://forums.developer.apple.com/forums/thread/714675 Philippe Mathieu-Daudé (13): ui/console-vc: Replace sprintf() by snprintf() hw/vfio/pci: Replace sprintf() by snprintf() hw/ppc/spapr: Replace sprintf() by snprintf() hw/mips/malta: Add re-usable rng_seed_hex_new

[PATCH v2 10/13] hw/scsi/scsi-disk: Use qemu_hexdump_line() to avoid sprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
^ Signed-off-by: Philippe Mathieu-Daudé --- hw/scsi/scsi-disk.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 4bd7af9d0c..4f914df5c2 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2648,16 +2648,12 @@ st

[PATCH v2 06/13] system/qtest: Replace sprintf() by g_string_append_printf()

2024-04-11 Thread Philippe Mathieu-Daudé
generated. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- system/qtest.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/system/qtest.c b/system/qtest.c index 6da58b3874..22bf1a33dc 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -601,9 +601,9

[PATCH v2 01/13] ui/console-vc: Replace sprintf() by snprintf()

2024-04-11 Thread Philippe Mathieu-Daudé
1 warning generated. Signed-off-by: Philippe Mathieu-Daudé --- ui/console-vc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/console-vc.c b/ui/console-vc.c index 899fa11c94..847d5fb174 100644 --- a/ui/console-vc.c +++ b/ui/console-vc.c @@ -821,7 +821,7 @@ static void

[PATCH v2 04/13] hw/mips/malta: Add re-usable rng_seed_hex_new() method

2024-04-11 Thread Philippe Mathieu-Daudé
Extract common code from reinitialize_rng_seed() and load_kernel() to rng_seed_hex_new(). Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/malta.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index af74008c82

Re: [PATCH 00/12] misc: Remove sprintf() due to macOS deprecation

2024-04-11 Thread Philippe Mathieu-Daudé
On 11/4/24 00:27, BALATON Zoltan wrote: On Wed, 10 Apr 2024, Richard Henderson wrote: On 4/10/24 06:06, Philippe Mathieu-Daudé wrote: Hi, sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Is snprintf also deprecated? It might

Re: [PATCH 01/12] ui/console-vc: Replace sprintf() by g_strdup_printf()

2024-04-11 Thread Philippe Mathieu-Daudé
On 11/4/24 09:47, Gerd Hoffmann wrote: Hi, Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. -char response[40]; +g_autofree char *response = NULL; -sprintf(response,

[PATCH 05/12] system/qtest: Replace sprintf() by g_string_append_printf()

2024-04-10 Thread Philippe Mathieu-Daudé
generated. Signed-off-by: Philippe Mathieu-Daudé --- system/qtest.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/system/qtest.c b/system/qtest.c index 6da58b3874..22bf1a33dc 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -601,9 +601,9 @@ static void qtest_proce

[PATCH 07/12] util/hexdump: Have qemu_hexdump_line() return heap allocated buffer

2024-04-10 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/cutils.h | 10 +++--- hw/virtio/vhost-vdpa.c | 5 +++-- util/hexdump.c | 12 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 70ca4b876b

[PATCH 08/12] util/hexdump: Replace sprintf() by g_string_append_printf()

2024-04-10 Thread Philippe Mathieu-Daudé
)buf[b + i]); ^ util/hexdump.c:37:21: warning: 'sprintf' is deprecated: line += sprintf(line, " "); ^ 2 warnings generated. Signed-off-by: Philippe Mathieu-Daudé --- util/hexdump.c | 17 - 1 file changed, 8 insertions(+), 9 dele

[PATCH 12/12] backends/tpm: Use qemu_hexdump_line() to avoid sprintf()

2024-04-10 Thread Philippe Mathieu-Daudé
only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] p += sprintf(p, "%.2X ", buffer[i]); ^ Signed-off-by: Philippe Mathieu-Daudé --- backends/tpm/tpm_u

[PATCH 04/12] hw/mips/malta: Replace sprintf() by g_string_append_printf()

2024-04-10 Thread Philippe Mathieu-Daudé
e snprintf(3) instead. [-Wdeprecated-declarations] hw/mips/malta.c:951:9: warning: 'sprintf' is deprecated: sprintf(rng_seed_hex + i * 2, "%02x", rng_seed[i]); ^ Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/malta.c | 22 +- 1 file ch

[PATCH 11/12] hw/dma/pl330: Use qemu_hexdump_line() to avoid sprintf()

2024-04-10 Thread Philippe Mathieu-Daudé
buf[b + i]); ^ Signed-off-by: Philippe Mathieu-Daudé --- hw/dma/pl330.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index 70a502d245..0435378b7e 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -15,6 +15,7 @@ */ #include &qu

[PATCH 03/12] hw/ppc/spapr: Replace sprintf() by g_strdup_printf()

2024-04-10 Thread Philippe Mathieu-Daudé
to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] sprintf(mem_name, "memory@%" HWADDR_PRIx, start); ^ 1 warning generated. Signed-off-by: Philippe Mathieu-Daudé --- hw/p

[PATCH 09/12] hw/scsi/scsi-disk: Use qemu_hexdump_line() to avoid sprintf()

2024-04-10 Thread Philippe Mathieu-Daudé
^ Signed-off-by: Philippe Mathieu-Daudé --- hw/scsi/scsi-disk.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 4bd7af9d0c..4f914df5c2 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2648,16 +2648,12 @@ st

[PATCH 06/12] util/hexdump: Rename @offset argument in qemu_hexdump_line()

2024-04-10 Thread Philippe Mathieu-Daudé
@offset argument is more descriptive than @b. Inverse @bufptr <-> @offset arguments order. Document qemu_hexdump_line(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/cutils.h | 11 +-- hw/virtio/vhost-vdpa.c | 8 util/hexdump.c | 16 -

[PATCH 02/12] hw/vfio/pci: Replace sprintf() by g_strdup_printf()

2024-04-10 Thread Philippe Mathieu-Daudé
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use g_strdup_printf() instead. Signed-off-by: Philippe Mathieu-Daudé --- hw/vfio/pci.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio

[PATCH 10/12] hw/ide/atapi: Use qemu_hexdump_line() to avoid sprintf()

2024-04-10 Thread Philippe Mathieu-Daudé
ot;\n"); ^ Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/atapi.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 73ec373184..27b6aa59fd 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -24,6 +24,7 @@ */ #include "qemu/osd

[PATCH 01/12] ui/console-vc: Replace sprintf() by g_strdup_printf()

2024-04-10 Thread Philippe Mathieu-Daudé
^ 1 warning generated. Signed-off-by: Philippe Mathieu-Daudé --- ui/console-vc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/console-vc.c b/ui/console-vc.c index 899fa11c94..b455db436d 100644 --- a/ui/console-vc.c +++ b/ui/console-vc.c @@ -648,7 +648,7 @@ s

[PATCH 00/12] misc: Remove sprintf() due to macOS deprecation

2024-04-10 Thread Philippe Mathieu-Daudé
://forums.developer.apple.com/forums/thread/714675 Philippe Mathieu-Daudé (12): ui/console-vc: Replace sprintf() by g_strdup_printf() hw/vfio/pci: Replace sprintf() by g_strdup_printf() hw/ppc/spapr: Replace sprintf() by g_strdup_printf() hw/mips/malta: Replace sprintf() by g_string_append_printf() system

[PULL 08/16] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-10 Thread Philippe Mathieu-Daudé
eviewed-by: Richard Henderson Reviewed-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240409135944.24997-4-phi...@linaro.org> --- hw/block/nand.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/block/nand.c b/hw/block/nand.c index 5a31d78b6b..e

[PULL 14/16] hw/sd/sdhci: Do not update TRNMOD when Command Inhibit (DAT) is set

2024-04-10 Thread Philippe Mathieu-Daudé
rd SD host controller") Buglink: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58813 Reported-by: Alexander Bulekov Reported-by: Chuhong Yuan Signed-off-by: Peter Maydell Message-Id: Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240409145524.27913-1-phi...@linaro.org> --

[PULL 06/16] hw/block/nand: Factor nand_load_iolen() method out

2024-04-10 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Reviewed-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240409135944.24997-2-phi...@linaro.org> --- hw/block/nand.c | 35 ++- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/hw/block/nand.

[PULL 07/16] hw/block/nand: Have blk_load() take unsigned offset and return boolean

2024-04-10 Thread Philippe Mathieu-Daudé
Negative offset is meaningless, use unsigned type. Return a boolean value indicating success. Reviewed-by: Richard Henderson Reviewed-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240409135944.24997-3-phi...@linaro.org> --- hw/block/nand.c | 14 ++

Re: [PATCH-for-9.0 v2] hw/sd/sdhci: Do not update TRNMOD when Command Inhibit (DAT) is set

2024-04-09 Thread Philippe Mathieu-Daudé
On 9/4/24 17:01, Peter Maydell wrote: On Tue, 9 Apr 2024 at 15:55, Philippe Mathieu-Daudé wrote: Per "SD Host Controller Standard Specification Version 3.00": * 2.2.5 Transfer Mode Register (Offset 00Ch) Writes to this register shall be ignored when the Command In

Re: [PATCH-for-9.0] hw/sd/sdhci: Discard excess of data written to Buffer Data Port register

2024-04-09 Thread Philippe Mathieu-Daudé
On 9/4/24 13:35, Peter Maydell wrote: On Mon, 8 Apr 2024 at 17:42, Peter Maydell wrote: So another approach here would be... That said, this is all quite complicated looking, so for 9.0 and backports at least this patch is fine. Your patch looks like the correct fix, and doesn't seem that

[PATCH-for-9.0 v2] hw/sd/sdhci: Do not update TRNMOD when Command Inhibit (DAT) is set

2024-04-09 Thread Philippe Mathieu-Daudé
rd SD host controller") Buglink: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58813 Reported-by: Alexander Bulekov Reported-by: Chuhong Yuan Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- Peter, since it is your patch, can I replace the Suggested-by y

Re: [PATCH-for-9.0 v2 0/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-09 Thread Philippe Mathieu-Daudé
On 9/4/24 16:18, Kevin Wolf wrote: Am 09.04.2024 um 15:59 hat Philippe Mathieu-Daudé geschrieben: Fix for https://gitlab.com/qemu-project/qemu/-/issues/1446 Since v1: - Addressed Kevin trivial suggestions (unsigned offset) You already kept the Reviewed-by tags, but looks good to me. Less

Re: [PATCH-for-9.0 v2 0/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-09 Thread Philippe Mathieu-Daudé
On 9/4/24 15:59, Philippe Mathieu-Daudé wrote: Fix for https://gitlab.com/qemu-project/qemu/-/issues/1446 Since v1: - Addressed Kevin trivial suggestions (unsigned offset) $ git backport-diff Key: [] : patches are identical [] : number of functional differences between upstream

[PATCH-for-9.0 v2 3/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-09 Thread Philippe Mathieu-Daudé
ewed-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nand.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/block/nand.c b/hw/block/nand.c index 5a31d78b6b..e2433c25bd 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -255,7 +255,9

[PATCH-for-9.0 v2 1/3] hw/block/nand: Factor nand_load_iolen() method out

2024-04-09 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Reviewed-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nand.c | 35 ++- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/hw/block/nand.c b/hw/block/nand.c index d1435f2207..f33eb2d552 100644

[PATCH-for-9.0 v2 2/3] hw/block/nand: Have blk_load() take unsigned offset and return boolean

2024-04-09 Thread Philippe Mathieu-Daudé
Negative offset is meaningless, use unsigned type. Return a boolean value indicating success. Reviewed-by: Richard Henderson Reviewed-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nand.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw

[PATCH-for-9.0 v2 0/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-09 Thread Philippe Mathieu-Daudé
Fix for https://gitlab.com/qemu-project/qemu/-/issues/1446 Since v1: - Addressed Kevin trivial suggestions (unsigned offset) Philippe Mathieu-Daudé (3): hw/block/nand: Factor nand_load_iolen() method out hw/block/nand: Have blk_load() take unsigned offset and return boolean hw/block/nand

Re: [PATCH-for-9.0? 0/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-09 Thread Philippe Mathieu-Daudé
On 8/4/24 17:45, Mauro Matteo Cascella wrote: On Mon, Apr 8, 2024 at 10:36 AM Philippe Mathieu-Daudé wrote: Fix for https://gitlab.com/qemu-project/qemu/-/issues/1446 Does hw/block/nand meet the security requirements for CVE assignment? => https://www.qemu.org/docs/master/sys

Re: [PATCH-for-9.0? 3/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-08 Thread Philippe Mathieu-Daudé
On 8/4/24 18:39, Richard Henderson wrote: On 4/7/24 22:36, Philippe Mathieu-Daudé wrote: nand_command() and nand_getio() don't check @offset points into the block, nor the available data length (s->iolen) is not negative. In order to fix: - check the offset is in ra

[RFC PATCH-for-9.0? 1/2] hw/sd/sdcard: Avoid OOB in sd_read_byte() during unexpected CMD switch

2024-04-08 Thread Philippe Mathieu-Daudé
/p/oss-fuzz/issues/detail?id=36240 Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 807b5d3de3..16d8d52a78 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1826,6 +1826,12 @@ send_response: break;

[PATCH-for-9.1 2/2] hw/sd/sdcard: Assert @data_offset is in range

2024-04-08 Thread Philippe Mathieu-Daudé
Prevent out-of-bound access with assertions. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 16d8d52a78..c081211582 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1875,6 +1875,7 @@ void

[PATCH-for-9.0? 0/2] hw/sd/sdcard: Avoid OOB in sd_read_byte()

2024-04-08 Thread Philippe Mathieu-Daudé
Since this is Fix day, I went over this old bug: https://gitlab.com/qemu-project/qemu/-/issues/487 It happens to be a QEMU implementation detail not really related to the spec. Philippe Mathieu-Daudé (2): hw/sd/sdcard: Avoid OOB in sd_read_byte() during unexpected CMD switch hw/sd/sdcard

Re: [PATCH-for-9.0? 3/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-08 Thread Philippe Mathieu-Daudé
On 8/4/24 10:36, Philippe Mathieu-Daudé wrote: nand_command() and nand_getio() don't check @offset points into the block, nor the available data length (s->iolen) is not negative. In order to fix: - check the offset is in range in nand_blk_load_NAND_PAGE_SIZE(), - do not set @iolen if blk_l

[PATCH-for-9.0? 2/3] hw/block/nand: Have blk_load() return boolean indicating success

2024-04-08 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nand.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/block/nand.c b/hw/block/nand.c index 6fa9038bb5..3627c799b5 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -84,7 +84,11 @@ struct NANDFlashState

[PATCH-for-9.0? 1/3] hw/block/nand: Factor nand_load_iolen() method out

2024-04-08 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nand.c | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/hw/block/nand.c b/hw/block/nand.c index d1435f2207..6fa9038bb5 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -243,9 +243,25

[PATCH-for-9.0? 0/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-08 Thread Philippe Mathieu-Daudé
Fix for https://gitlab.com/qemu-project/qemu/-/issues/1446 Philippe Mathieu-Daudé (3): hw/block/nand: Factor nand_load_iolen() method out hw/block/nand: Have blk_load() return boolean indicating success hw/block/nand: Fix out-of-bound access in NAND block buffer hw/block/nand.c | 50

[PATCH-for-9.0? 3/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-08 Thread Philippe Mathieu-Daudé
in commit 3e3d5815cb ("NAND Flash memory emulation and ECC calculation helpers for use by NAND controllers"). Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1446 Reported-by: Qiang Liu Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nand.c | 8 +++- 1 file changed, 7 insert

Re: [PATCH for-9.1 v3 08/11] contrib/vhost-user-blk: enable it on any POSIX system

2024-04-04 Thread Philippe Mathieu-Daudé
Hi Stefano, On 4/4/24 14:23, Stefano Garzarella wrote: Let's make the code more portable by using the "qemu/bswap.h" API and adding defines from block/file-posix.c to support O_DIRECT in other systems (e.g. macOS). vhost-user-server.c is a dependency, let's enable it for any POSIX system.

Re: [PATCH for-9.1 v3 05/11] contrib/vhost-user-blk: fix bind() using the right size of the address

2024-04-04 Thread Philippe Mathieu-Daudé
-by: Philippe Mathieu-Daudé

Re: [PATCH for-9.1 v3 01/11] libvhost-user: set msg.msg_control to NULL when it is empty

2024-04-04 Thread Philippe Mathieu-Daudé
--- subprojects/libvhost-user/libvhost-user.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Philippe Mathieu-Daudé

[PATCH-for-9.0] hw/sd/sdhci: Discard excess of data written to Buffer Data Port register

2024-04-04 Thread Philippe Mathieu-Daudé
mium.org/p/oss-fuzz/issues/detail?id=58813 Reported-by: Alexander Bulekov Reported-by: Chuhong Yuan Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sdhci.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index c5e0bc018b..2dd88fa139 100644

Re: [PATCH-for-9.1 v2 0/3] rdma: Remove RDMA subsystem and pvrdma device

2024-04-03 Thread Philippe Mathieu-Daudé
On 28/3/24 14:02, Philippe Mathieu-Daudé wrote: Since v1: - split in 3 (Thomas) - justify gluster removal Philippe Mathieu-Daudé (3): hw/rdma: Remove pvrdma device and rdmacm-mux helper migration: Remove RDMA protocol handling block/gluster: Remove RDMA protocol handling Patch 2

[PULL 11/15] plugins: fix -Werror=maybe-uninitialized false-positive

2024-04-02 Thread Philippe Mathieu-Daudé
From: Marc-André Lureau ../plugins/loader.c:405:15: error: ‘ctx’ may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Marc-André Lureau Reviewed-by: Pierrick Bouvier Message-ID: <20240328102052.3499331-15-marcandre.lur...@redhat.com> Signed-off-by: Philippe Mathieu

[PULL 09/15] hw/i386/pc: Restrict CXL to PCI-based machines

2024-04-02 Thread Philippe Mathieu-Daudé
CXL is based on PCIe. In is pointless to initialize its context on non-PCI machines. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Jonathan Cameron Message-ID: <20240327161642.33574-1-phi...@linaro.org> --- hw/i386/pc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PULL 14/15] hw/xen_evtchn: Initialize flush_kvm_routes

2024-04-02 Thread Philippe Mathieu-Daudé
From: Artem Chernyshev In xen_evtchn_soft_reset() variable flush_kvm_routes can be used before being initialized. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Oleg Sviridov Signed-off-by: Artem Chernyshev Reviewed-by: Philippe Mathieu-Daudé Message-ID

[PULL 15/15] hw/net/virtio-net: fix qemu set used ring flag even vhost started

2024-04-02 Thread Philippe Mathieu-Daudé
Message-ID: <20240402045109.97729-1-yaj...@nvidia.com> [PMD: Use unlikely()] Signed-off-by: Philippe Mathieu-Daudé --- hw/net/virtio-net.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index a6ff000cd9..58014a92ad 100644 --- a/hw/net/virtio-net.c +++

[PULL 12/15] hw/nvme: fix -Werror=maybe-uninitialized

2024-04-02 Thread Philippe Mathieu-Daudé
default value. Signed-off-by: Marc-André Lureau Reviewed-by: Klaus Jensen Message-ID: <20240328102052.3499331-18-marcandre.lur...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/

[PULL 01/15] accel/tcg/plugin: Remove CONFIG_SOFTMMU_GATE definition

2024-04-02 Thread Philippe Mathieu-Daudé
The CONFIG_SOFTMMU_GATE definition was never used, remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id: <20240313213339.82071-2-phi...@linaro.org> --- accel/tcg/plugin-gen.c | 6 -- 1 file changed, 6 deletions(-) diff

[PULL 08/15] MAINTAINERS: Fix error-report.c entry

2024-04-02 Thread Philippe Mathieu-Daudé
ot;util: rename qemu-error.c to match its header name") Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240327115539.3860270-1-zhao1@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

  1   2   3   4   5   6   7   8   9   10   >