[PATCH v3 10/10] hw/display/apple-gfx: Replace QemuSemaphore with QemuEvent

2025-05-10 Thread Akihiko Odaki
sem in AppleGFXReadMemoryJob is an one-shot event so it can be converted into QemuEvent, which is more specialized for such a use case. Signed-off-by: Akihiko Odaki --- hw/display/apple-gfx.m | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/display/apple-gfx.m b/

[PATCH v3 09/10] migration/postcopy: Replace QemuSemaphore with QemuEvent

2025-05-10 Thread Akihiko Odaki
thread_sync_sem is an one-shot event so it can be converted into QemuEvent, which is more lightweight. Signed-off-by: Akihiko Odaki --- migration/migration.h| 4 ++-- migration/postcopy-ram.c | 10 +- migration/savevm.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-)

[PATCH v3 08/10] migration/colo: Replace QemuSemaphore with QemuEvent

2025-05-10 Thread Akihiko Odaki
colo_exit_sem and colo_incoming_sem represent one-shot events so they can be converted into QemuEvent, which is more lightweight. Signed-off-by: Akihiko Odaki --- migration/migration.h | 6 +++--- migration/colo.c | 20 ++-- 2 files changed, 13 insertions(+), 13 deletions(-

[PATCH v3 05/10] qemu-thread: Use futex for QemuEvent on Windows

2025-05-10 Thread Akihiko Odaki
Use the futex-based implementation of QemuEvent on Windows to remove code duplication and remove the overhead of event object construction and destruction. Signed-off-by: Akihiko Odaki --- include/qemu/thread-posix.h | 9 --- include/qemu/thread-win32.h | 6 -- include/qemu/thread.h |

[PATCH v3 07/10] migration: Replace QemuSemaphore with QemuEvent

2025-05-10 Thread Akihiko Odaki
rp_pong_acks tells if it has ever received one pong. QemuEvent is better suited for this usage because it represents a boolean rather than integer and will not decrement with the wait operation. pause_event can utilize qemu_event_reset() to discard events. Signed-off-by: Akihiko Odaki --- migra

[PATCH v3 04/10] qemu-thread: Avoid futex abstraction for non-Linux

2025-05-10 Thread Akihiko Odaki
qemu-thread used to abstract pthread primitives into futex for the QemuEvent implementation of POSIX systems other than Linux. However, this abstraction has one key difference: unlike futex, pthread primitives require an explicit destruction, and it must be ordered after wait and wake operations.

[PATCH v3 03/10] futex: Replace __linux__ with CONFIG_LINUX

2025-05-10 Thread Akihiko Odaki
scripts/checkpatch.pl warns for __linux__ saying "architecture specific defines should be avoided". Signed-off-by: Akihiko Odaki --- include/qemu/thread-posix.h | 2 +- util/qemu-thread-posix.c| 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu/thread-posi

[PATCH v3 01/10] futex: Check value after qemu_futex_wait()

2025-05-10 Thread Akihiko Odaki
futex(2) - Linux manual page https://man7.org/linux/man-pages/man2/futex.2.html > Note that a wake-up can also be caused by common futex usage patterns > in unrelated code that happened to have previously used the futex > word's memory location (e.g., typical futex-based implementations of > Pthrea

[PATCH v3 00/10] Improve futex usage

2025-05-10 Thread Akihiko Odaki
off-by: Akihiko Odaki --- Changes in v3: - Fixed race between qemu_event_reset() and qemu_event_set(). - Prepared for spurious pthread_cond_wait() wakeups. - Added patch "futex: Replace __linux__ with CONFIG_LINUX". - Link to v2: https://lore.kernel.org/qemu-devel/20250510-event-v2-0-7

[PATCH v3 06/10] qemu-thread: Use futex if available for QemuLockCnt

2025-05-10 Thread Akihiko Odaki
This unlocks the futex-based implementation of QemuLockCnt to Windows. Signed-off-by: Akihiko Odaki --- include/qemu/lockcnt.h | 2 +- util/lockcnt.c | 7 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/qemu/lockcnt.h b/include/qemu/lockcnt.h index f4b62a3f

[PATCH v3 02/10] futex: Support Windows

2025-05-10 Thread Akihiko Odaki
Windows supports futex-like APIs since Windows 8 and Windows Server 2012. Signed-off-by: Akihiko Odaki --- meson.build | 2 ++ include/qemu/futex.h | 53 ++- tests/unit/test-aio-multithread.c | 2 +- util/lockcnt.c

Re: [PATCH v2 12/14] ui/gtk-gl-area: Remove extra draw call in refresh

2025-05-10 Thread Akihiko Odaki
On 2025/05/10 21:12, Dmitry Osipenko wrote: On 5/10/25 07:52, Akihiko Odaki wrote: On 2025/05/06 21:57, Alex Bennée wrote: From: Dongwon Kim This partially reverts commit 77bf310084dad38b3a2badf01766c659056f1cf2 which causes some guest display corruption when gtk-gl-area is used for GTK rende

Re: [PATCH v2 3/9] qemu-thread: Avoid futex abstraction for non-Linux

2025-05-10 Thread Akihiko Odaki
On 2025/05/11 0:02, Paolo Bonzini wrote: On 5/10/25 10:51, Akihiko Odaki wrote: Add special implementations of qemu_event_set() and qemu_event_wait() using pthread primitives. qemu_event_wait() will ensure qemu_event_set() finishes, and these functions will avoid complex barrier and atomic opera

Re: [PULL 0/6] Ui patches

2025-05-10 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.1 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 00/19] Misc HW patches for 2025-05-08

2025-05-10 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.1 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 00/28] vfio queue

2025-05-10 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.1 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 0/6] Versioned machine type deprecation policy patches

2025-05-10 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.1 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 0/3] Block patches

2025-05-10 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.1 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL v1 0/2] xen: mapcache: Fixes

2025-05-10 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.1 for any user-visible changes. signature.asc Description: PGP signature

Re: [PATCH v5 21/24] target/m68k: Implement packed decimal real loads and stores

2025-05-10 Thread Andreas Schwab
On Mai 07 2025, Richard Henderson wrote: > +/* Convert the 3 digit decimal exponent to binary. */ > +exp = ((hi >> 24) & 0xf) > ++ ((hi >> 20) & 0xf) * 10 > ++ ((hi >> 16) & 0xf) * 100; This is backwards. An exponent of 123 is stored as 0x0123, not 0x0321. > +

[PATCH] hw/net/e1000: fix stack-buffer-overflow in e1000_receive_iov

2025-05-10 Thread Zheng Huang
This patch fixes a stack-buffer-overflow bug in e1000_receive_iov(). When receiving a broken eth iov (only 1 iov and len < ETH_HLEN, 4 in the crash sample), origin logic will continue by copy iov to min_buf. The subsequent program will perform error vlan packet checking on the buffer content that

Re: [PATCH] ui/gtk: Properly apply x/y scale when rendering GL area

2025-05-10 Thread Weifeng Liu
Hi Marc-André, I am WIP on a patch set including a successor of this one as well as other fixes, doc and refactoring regarding scale handling. Hopefully the patch set would make scale handling into good shape. I will send the patch set out ASAP. Best regards, Weifeng On Mon, 2025-04-28 at 15:23

Re: [PATCH] ui/gtk: Properly apply x/y scale when rendering GL area

2025-05-10 Thread Weifeng Liu
Hi Marc-André, I am WIP on a patch set including a successor of this one as well as other fixes, doc and refactoring regarding scale handling. Hopefully the patch set would make scale handling into good shape. I will send the patch set out ASAP. Best regards, Weifeng On Mon, 2025-04-28 at 15:23

Re: [PATCH v2 3/9] qemu-thread: Avoid futex abstraction for non-Linux

2025-05-10 Thread Paolo Bonzini
On 5/10/25 10:51, Akihiko Odaki wrote: Add special implementations of qemu_event_set() and qemu_event_wait() using pthread primitives. qemu_event_wait() will ensure qemu_event_set() finishes, and these functions will avoid complex barrier and atomic operations. Unfortunately not... Signed-off

[PATCH v4 15/22] arm: qemu: Add a 64-bit SPL build

2025-05-10 Thread Simon Glass
Add an 64-bit SPL build for qemu so we can test the standard passage feature. Include a binman definition so that SPL and U-Boot are in the same image. This requires adding a proper devicetree file for qemu_arm. It is only used for the SPL build. Avoid using the QEMU devicetree in U-Boot proper,

[PATCH v4 14/22] arm: qemu: Add an SPL build

2025-05-10 Thread Simon Glass
Add an SPL build for qemu so we can test the standard passage feature. Include a binman definition so that SPL and U-Boot are in the same image. This requires adding a proper devicetree file for qemu_arm. It is only used for the SPL build. Avoid using the QEMU devicetree in U-Boot proper, so we c

Re: [PATCH v2 12/14] ui/gtk-gl-area: Remove extra draw call in refresh

2025-05-10 Thread Dmitry Osipenko
On 5/10/25 07:52, Akihiko Odaki wrote: > On 2025/05/06 21:57, Alex Bennée wrote: >> From: Dongwon Kim >> >> This partially reverts commit 77bf310084dad38b3a2badf01766c659056f1cf2 >> which causes some guest display corruption when gtk-gl-area >> is used for GTK rendering (e.g. Wayland Compositor) p

Re: [PATCH 01/10] qapi: expose rtc-reset-reinjection command unconditionally

2025-05-10 Thread Markus Armbruster
Daniel P. Berrangé writes: > This removes the TARGET_I386 condition from the rtc-reset-reinjection > command. This requires providing a QMP command stub for non-i386 target. > This in turn requires moving the command out of misc-target.json, since > that will trigger symbol poisoning errors when

Re: [PATCH RFC 00/10] qapi: remove all TARGET_* conditionals from the schema

2025-05-10 Thread Markus Armbruster
PATCH 10 empties out and deletes qapi/machine-target.json. PATCH 04 empties out qapi/misc-target.json without deleting it. Missing: * Delete qapi/misc-target.json * Delete entry F: qapi/machine-target.json in MAINTAINERS * Delete dead logic around qapi_specific_outputs in qapi/meson.build The

[PATCH v2 7/9] migration/colo: Replace QemuSemaphore with QemuEvent

2025-05-10 Thread Akihiko Odaki
colo_exit_sem and colo_incoming_sem represent one-shot events so they can be converted into QemuEvent, which is more lightweight. Signed-off-by: Akihiko Odaki --- migration/migration.h | 6 +++--- migration/colo.c | 20 ++-- 2 files changed, 13 insertions(+), 13 deletions(-

[PATCH v2 9/9] hw/display/apple-gfx: Replace QemuSemaphore with QemuEvent

2025-05-10 Thread Akihiko Odaki
sem in AppleGFXReadMemoryJob is an one-shot event so it can be converted into QemuEvent, which is more specialized for such a use case. Signed-off-by: Akihiko Odaki --- hw/display/apple-gfx.m | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/display/apple-gfx.m b/

[PATCH v2 1/9] futex: Check value after qemu_futex_wait()

2025-05-10 Thread Akihiko Odaki
futex(2) - Linux manual page https://man7.org/linux/man-pages/man2/futex.2.html > Note that a wake-up can also be caused by common futex usage patterns > in unrelated code that happened to have previously used the futex > word's memory location (e.g., typical futex-based implementations of > Pthrea

[PATCH v2 8/9] migration/postcopy: Replace QemuSemaphore with QemuEvent

2025-05-10 Thread Akihiko Odaki
thread_sync_sem is an one-shot event so it can be converted into QemuEvent, which is more lightweight. Signed-off-by: Akihiko Odaki --- migration/migration.h| 4 ++-- migration/postcopy-ram.c | 10 +- migration/savevm.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-)

[PATCH v2 4/9] qemu-thread: Use futex for QemuEvent on Windows

2025-05-10 Thread Akihiko Odaki
Use the futex-based implementation of QemuEvent on Windows to remove code duplication and remove the overhead of event object construction and destruction. Signed-off-by: Akihiko Odaki --- include/qemu/thread-posix.h | 9 --- include/qemu/thread-win32.h | 6 -- include/qemu/thread.h |

[PATCH v2 6/9] migration: Replace QemuSemaphore with QemuEvent

2025-05-10 Thread Akihiko Odaki
rp_pong_acks tells if it has ever received one pong. QemuEvent is better suited for this usage because it represents a boolean rather than integer and will not decrement with the wait operation. pause_event can utilize qemu_event_reset() to discard events. Signed-off-by: Akihiko Odaki --- migra

[PATCH v2 0/9] Improve futex usage

2025-05-10 Thread Akihiko Odaki
In a recent discussion, Phil Dennis-Jordan pointed out a quirk in QemuEvent destruction due to futex-like abstraction, which prevented the usage of QemuEvent in new and existing code[1]. With some more thoughts after this discussion, I also found other problem and room of improvement in futex usage

[PATCH v2 5/9] qemu-thread: Use futex if available for QemuLockCnt

2025-05-10 Thread Akihiko Odaki
This unlocks the futex-based implementation of QemuLockCnt to Windows. Signed-off-by: Akihiko Odaki --- include/qemu/lockcnt.h | 2 +- util/lockcnt.c | 7 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/qemu/lockcnt.h b/include/qemu/lockcnt.h index f4b62a3f

[PATCH v2 3/9] qemu-thread: Avoid futex abstraction for non-Linux

2025-05-10 Thread Akihiko Odaki
qemu-thread used to abstract pthread primitives into futex for the QemuEvent implementation of POSIX systems other than Linux. However, this abstraction has one key difference: unlike futex, pthread primitives require an explicit destruction, and it must be ordered after wait and wake operations.

[PATCH v2 2/9] futex: Support Windows

2025-05-10 Thread Akihiko Odaki
Windows supports futex-like APIs since Windows 8 and Windows Server 2012. Signed-off-by: Akihiko Odaki --- meson.build | 2 ++ include/qemu/futex.h | 52 ++- tests/unit/test-aio-multithread.c | 2 +- util/lockcnt.c

[PATCH 5/6] MAX78000 TRNG Implementation

2025-05-10 Thread jcksn
This patch implements the True Random Number Generator for the MAX78000 SOC Signed-off-by: Jackson Donaldson --- hw/arm/Kconfig | 1 + hw/arm/max78000_soc.c | 9 ++- hw/misc/Kconfig | 3 + hw/misc/max78000_gcr.c | 3 + hw/misc/max78000_

[PATCH] virtio-net: Add queues for RSS during migration

2025-05-10 Thread Akihiko Odaki
virtio_net_pre_load_queues() inspects vdev->guest_features to tell if VIRTIO_NET_F_RSS or VIRTIO_NET_F_MQ is enabled to infer the required number of queues. This works for VIRTIO_NET_F_MQ but it doesn't for VIRTIO_NET_F_RSS because only the lowest 32 bits of vdev->guest_features is set at the point

Re: [PATCH 09/13] qapi: transform target specific 'if' in runtime checks

2025-05-10 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Wed, May 07, 2025 at 04:14:39PM -0700, Pierrick Bouvier wrote: >> Signed-off-by: Pierrick Bouvier >> --- >> qapi/machine-target.json | 84 >> qapi/misc-target.json| 48 --- >> scripts/qapi/expr.py

[PATCH 0/6] MAX78000FTHR Implementation

2025-05-10 Thread jcksn
This patch series implements basic support for the MAX78000FTHR machine https://github.com/JacksonDonaldson/max78000Test Contains instructions for building a test program against the MAX78000FTHR as well as results of the test suite run on QEMU and hardware. Jackson Donaldson (6): MAX78000: Add

[PATCH 4/6] MAX78000 GCR implementation

2025-05-10 Thread jcksn
This patch implements the Global Control Register for the MAX78000 SOC Signed-off-by: Jackson Donaldson --- hw/arm/Kconfig | 1 + hw/arm/max78000_soc.c | 9 +- hw/misc/Kconfig| 3 + hw/misc/max78000_gcr.c | 285 ++

[PATCH 6/6] MAX78000 AES implementation

2025-05-10 Thread jcksn
This commit implements AES encryption/decryption functionality for the MAX78000 SOC Signed-off-by: Jackson Donaldson --- hw/arm/Kconfig | 1 + hw/arm/max78000_soc.c | 12 +- hw/misc/Kconfig| 3 + hw/misc/max78000_aes.c | 215 +