Re: [PATCH v4 1/7] linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr()

2025-01-23 Thread Laurent Vivier
Le 22/01/2025 à 22:20, Helge Deller a écrit : * Laurent Vivier : [...] It would be cleaner to replace all the IFA_XXX by their QEMU_IFA_XXX. Thanks for review, Laurent! Below I've merged patch #1 and #7, as suggested by you. Is this OK? Yes, thanks Can you review? Reviewed-by: Laurent Vi

Re: [RFC v4 0/5] Add packed virtqueue to shadow virtqueue

2025-01-23 Thread Eugenio Perez Martin
On Fri, Jan 24, 2025 at 6:47 AM Sahil Siddiq wrote: > > Hi, > > On 1/21/25 10:07 PM, Eugenio Perez Martin wrote: > > On Sun, Jan 19, 2025 at 7:37 AM Sahil Siddiq wrote: > >> > >> Hi, > >> > >> On 1/7/25 1:35 PM, Eugenio Perez Martin wrote: > >>> On Fri, Jan 3, 2025 at 2:06 PM Sahil Siddiq wrote:

[PATCH] target/riscv: rvv: Fix vslide1[up|down].vx unexpected result when XLEN=32 and SEW=64

2025-01-23 Thread Max Chou
When XLEN is 32 and SEW is 64, the original implementation of vslide1up.vx and vslide1down.vx helper functions fills the 32-bit value of rs1 into the first element of the destination vector register (rd), which is a 64-bit element. This commit attempted to resolve the issue by extending the rs1 va

Re: [PATCH v2 0/2] Add me as the maintainer for ivshmem-pci

2025-01-23 Thread Markus Armbruster
Gustavo Romero writes: > Add me as the maintainer for the ivshmem-pci.c device, the ivshmem > server, and the ivshmem client tool. Also, adjust remaining parts left > behind after ivshmem PCI device was renamed from ivshmem.c to > ivshmem-pci.c, like header files, Kconfig, docs, and build scripts

Re: [PATCH v2 0/2] wdt/aspeed: Support software reset mode for AST2600

2025-01-23 Thread Cédric Le Goater
On 1/24/25 04:02, Jamin Lin wrote: v1: Support software reset mode for AST2600 v2: Change to validate WDT_CTRL_RESET_MODE_SOC Jamin Lin (2): aspeed/wdt: Fix coding style aspeed/wdt: Support software reset mode for AST2600 hw/watchdog/wdt_aspeed.c | 19 +-- 1 file

[PULL 5/7] target/loongarch: Add common source file for CSR register

2025-01-23 Thread Bibo Mao
Common source file csr.c is added here, it can be used by both TCG mode and kvm mode. The common code is removed from file tcg/insn_trans/trans_privileged.c.inc to csrc.c Signed-off-by: Bibo Mao --- target/loongarch/csr.c| 114 ++ target/loongarch/csr.h

[PULL 7/7] target/loongarch: Dump all generic CSR registers

2025-01-23 Thread Bibo Mao
CSR registers is import system control registers, it had better dump all CSR registers when VM is running in system mode. Here is dump output example of CSR registers: CSR000: CRMD b4 PRMD 4EUEN 0 MISC 0 CSR004: ECFG 71c1cESTAT

[PULL 1/7] target/loongarch: Add dynamic function access with CSR register

2025-01-23 Thread Bibo Mao
With CSR register, dynamic function access is used for CSR register access in TCG mode, so that csr info can be used by other modules. Signed-off-by: Bibo Mao --- .../tcg/insn_trans/trans_privileged.c.inc | 37 +-- target/loongarch/tcg/tcg_loongarch.h | 12 ++ ta

[PULL 6/7] target/loongarch: Set unused flag with CSR registers

2025-01-23 Thread Bibo Mao
On LA464, some CSR registers are not used such as CSR_SAVE8 - CSR_SAVE15, also CSR registers relative with MCE is not used now. Flag CSRFL_UNUSED is added for these registers, so that it will not dumped. In order to keep compatiblity, these CSR registers are not removed since it is used in vmstate

[PULL 4/7] target/loongarch: Add common header file for CSR registers

2025-01-23 Thread Bibo Mao
Common header file csr.h is added here, it can be used by both TCG mode and kvm mode. Signed-off-by: Bibo Mao --- target/loongarch/csr.h| 25 +++ .../tcg/insn_trans/trans_privileged.c.inc | 16 +--- 2 files changed, 26 insertions(+), 15 deletio

[PULL 3/7] target/loongarch: Add generic csr function type

2025-01-23 Thread Bibo Mao
Parameter type TCGv and TCGv_ptr for function GenCSRRead and GenCSRWrite is not used in non-TCG mode. Generic csr function type is added here with parameter void type, so that it passes to compile with non-TCG mode. Signed-off-by: Bibo Mao --- .../tcg/insn_trans/trans_privileged.c.inc | 27 +

[PULL 0/7] loongarch-to-apply queue

2025-01-23 Thread Bibo Mao
The following changes since commit cf86770c7aa31ebd6e56f4eeb25c34107f92c51e: Merge tag 'pull-request-2025-01-21v2' of https://gitlab.com/thuth/qemu into staging (2025-01-22 09:59:02 -0500) are available in the Git repository at: https://gitlab.com/bibo-mao/qemu.git tags/pull-loongarch-20250

[PULL 2/7] target/loongarch: Remove static CSR function setting

2025-01-23 Thread Bibo Mao
Since CSR function setting is done dynamically in TCG mode, remove static CSR function setting here. Signed-off-by: Bibo Mao --- .../tcg/insn_trans/trans_privileged.c.inc| 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/loongarch/tcg/insn_trans/t

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-23 Thread Alexey Kardashevskiy
On 24/1/25 14:09, Chenyi Qiang wrote: On 1/24/2025 8:15 AM, Alexey Kardashevskiy wrote: On 22/1/25 16:38, Xiaoyao Li wrote: On 1/22/2025 11:28 AM, Chenyi Qiang wrote: On 1/22/2025 12:35 AM, Peter Xu wrote: On Tue, Jan 21, 2025 at 09:35:26AM +0800, Chenyi Qiang wrote: On 1/21/2025

Re: [RFC v4 0/5] Add packed virtqueue to shadow virtqueue

2025-01-23 Thread Sahil Siddiq
Hi, On 1/21/25 10:07 PM, Eugenio Perez Martin wrote: On Sun, Jan 19, 2025 at 7:37 AM Sahil Siddiq wrote: Hi, On 1/7/25 1:35 PM, Eugenio Perez Martin wrote: On Fri, Jan 3, 2025 at 2:06 PM Sahil Siddiq wrote: Hi, On 12/20/24 12:28 PM, Eugenio Perez Martin wrote: On Thu, Dec 19, 2024 at 8

Re: [PATCH 5/7] memory: Register the RamDiscardManager instance upon guest_memfd creation

2025-01-23 Thread Chenyi Qiang
On 1/24/2025 11:27 AM, Alexey Kardashevskiy wrote: > > > On 21/1/25 00:06, David Hildenbrand wrote: >> On 10.01.25 06:13, Chenyi Qiang wrote: >>> >>> >>> On 1/9/2025 5:32 PM, Alexey Kardashevskiy wrote: On 9/1/25 16:34, Chenyi Qiang wrote: > > > On 1/8/2025 12:47 PM,

[PATCH v7 2/6] coreaudio: Remove extra whitespaces

2025-01-23 Thread Akihiko Odaki
Remove extra whitespaces around parentheses. Signed-off-by: Akihiko Odaki --- audio/coreaudio.m | 108 +++--- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/audio/coreaudio.m b/audio/coreaudio.m index 0b67347ad7e8c43a77af308a1a3a6

[PATCH v7 3/6] coreaudio: Improve naming

2025-01-23 Thread Akihiko Odaki
coreaudio had names that are not conforming to QEMU codding style. coreaudioVoiceOut also had some members that are prefixed with redundant words like "output" or "audio". Global names included "out" to tell they are specific to output devices, but this rule was not completely enforced. The frame s

Re: [PATCH v5 1/4] coreaudio: Improve naming

2025-01-23 Thread Akihiko Odaki
On 2025/01/23 21:28, BALATON Zoltan wrote: On Thu, 23 Jan 2025, Akihiko Odaki wrote: coreaudio had names that are not conforming to QEMU codding style. coreaudioVoiceOut also had some members that are prefixed with redundant words like "output" or "audio". Global names included "out" to tell the

[PATCH v7 6/6] coreaudio: Initialize the buffer for device change

2025-01-23 Thread Akihiko Odaki
Reallocate buffers when the active device change as the required buffer size may differ. Signed-off-by: Akihiko Odaki Reviewed-by: Phil Dennis-Jordan Acked-by: Christian Schoenebeck --- audio/coreaudio.m | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/coreaudio.m b/audio/coreaudio.m

[PATCH v7 4/6] coreaudio: Commit the result of init in the end

2025-01-23 Thread Akihiko Odaki
init_out_device may only commit some part of the result and leave the state inconsistent when it encounters a fatal error or the device gets unplugged during the operation, which is expressed by kAudioHardwareBadObjectError or kAudioHardwareBadDeviceError. Commit the result in the end of the functi

[PATCH v7 5/6] audio: Add functions to initialize buffers

2025-01-23 Thread Akihiko Odaki
These functions can be used to re-initialize buffers when hardware parameters change due to device hotplug, for example. Signed-off-by: Akihiko Odaki Reviewed-by: Phil Dennis-Jordan Reviewed-by: Christian Schoenebeck --- audio/audio_int.h | 2 ++ audio/audio.c | 24 ++-

[PATCH v7 0/6] coreaudio fixes

2025-01-23 Thread Akihiko Odaki
6: - Added patch "coreaudio: Remove unnecessary explicit casts". - Link to v5: https://lore.kernel.org/qemu-devel/20250123-coreaudio-v5-0-6873df421...@daynix.com Changes in v5: - Added patch "coreaudio: Improve naming", removing verbose names like outputDeviceID and audi

[PATCH v7 1/6] coreaudio: Remove unnecessary explicit casts

2025-01-23 Thread Akihiko Odaki
coreaudio had unnecessary explicit casts and they had extra whitespaces around them so remove them. Signed-off-by: Akihiko Odaki --- audio/coreaudio.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/coreaudio.m b/audio/coreaudio.m index cadd729d50537850d81718b928

Re: [PATCH v5 3/4] audio: Add functions to initialize buffers

2025-01-23 Thread Akihiko Odaki
On 2025/01/23 17:43, Philippe Mathieu-Daudé wrote: Hi Akihiko, On 23/1/25 08:18, Akihiko Odaki wrote: These functions can be used to re-initialize buffers when hardware parameters change due to device hotplug, for example. Signed-off-by: Akihiko Odaki Reviewed-by: Phil Dennis-Jordan Reviewed

Re: [PATCH v5 1/4] coreaudio: Improve naming

2025-01-23 Thread Akihiko Odaki
On 2025/01/23 21:24, BALATON Zoltan wrote: On Thu, 23 Jan 2025, Akihiko Odaki wrote: coreaudio had names that are not conforming to QEMU codding style. coreaudioVoiceOut also had some members that are prefixed with redundant words like "output" or "audio". Global names included "out" to tell the

[PATCH v6 5/5] coreaudio: Initialize the buffer for device change

2025-01-23 Thread Akihiko Odaki
Reallocate buffers when the active device change as the required buffer size may differ. Signed-off-by: Akihiko Odaki Reviewed-by: Phil Dennis-Jordan Acked-by: Christian Schoenebeck --- audio/coreaudio.m | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/coreaudio.m b/audio/coreaudio.m

[PATCH v6 3/5] coreaudio: Commit the result of init in the end

2025-01-23 Thread Akihiko Odaki
init_out_device may only commit some part of the result and leave the state inconsistent when it encounters a fatal error or the device gets unplugged during the operation, which is expressed by kAudioHardwareBadObjectError or kAudioHardwareBadDeviceError. Commit the result in the end of the functi

[PATCH v6 4/5] audio: Add functions to initialize buffers

2025-01-23 Thread Akihiko Odaki
These functions can be used to re-initialize buffers when hardware parameters change due to device hotplug, for example. Signed-off-by: Akihiko Odaki Reviewed-by: Phil Dennis-Jordan Reviewed-by: Christian Schoenebeck --- audio/audio_int.h | 2 ++ audio/audio.c | 24 ++-

[PATCH v6 1/5] coreaudio: Remove unnecessary explicit casts

2025-01-23 Thread Akihiko Odaki
coreaudio had unnecessary explicit casts and they had extra whitespaces around them so remove them. Signed-off-by: Akihiko Odaki --- audio/coreaudio.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/coreaudio.m b/audio/coreaudio.m index cadd729d50537850d81718b928

[PATCH v6 0/5] coreaudio fixes

2025-01-23 Thread Akihiko Odaki
This series contains two fixes for coreaudio. See each one for details. Signed-off-by: Akihiko Odaki --- Changes in v6: - Added patch "coreaudio: Remove unnecessary explicit casts". - Link to v5: https://lore.kernel.org/qemu-devel/20250123-coreaudio-v5-0-6873df421...@daynix.com Cha

[PATCH v6 2/5] coreaudio: Improve naming

2025-01-23 Thread Akihiko Odaki
coreaudio had names that are not conforming to QEMU codding style. coreaudioVoiceOut also had some members that are prefixed with redundant words like "output" or "audio". Global names included "out" to tell they are specific to output devices, but this rule was not completely enforced. The frame s

RE: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets disabled

2025-01-23 Thread Duan, Zhenzhong
>-Original Message- >From: Jason Wang >Subject: Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets >disabled > >On Fri, Jan 24, 2025 at 11:30 AM Jason Wang wrote: >> >> On Fri, Jan 24, 2025 at 10:44 AM Duan, Zhenzhong >> wrote: >> > >> > >> > >> > >-Original Messa

Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets disabled

2025-01-23 Thread Jason Wang
On Fri, Jan 24, 2025 at 11:30 AM Jason Wang wrote: > > On Fri, Jan 24, 2025 at 10:44 AM Duan, Zhenzhong > wrote: > > > > > > > > >-Original Message- > > >From: Eric Auger > > >Subject: Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU > > >gets > > >disabled > > > > > >Hi

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-23 Thread Chenyi Qiang
Sorry I missed this mail. On 1/21/2025 11:38 PM, Peter Xu wrote: > On Tue, Jan 21, 2025 at 05:00:45PM +0800, Chenyi Qiang wrote: + +/* block size and alignment */ +uint64_t block_size; >>> >>> Can we always fetch it from the MR/ramblock? If this is needed, better add >>> som

Re: [PATCH 5/7] memory: Register the RamDiscardManager instance upon guest_memfd creation

2025-01-23 Thread Alexey Kardashevskiy
On 21/1/25 00:06, David Hildenbrand wrote: On 10.01.25 06:13, Chenyi Qiang wrote: On 1/9/2025 5:32 PM, Alexey Kardashevskiy wrote: On 9/1/25 16:34, Chenyi Qiang wrote: On 1/8/2025 12:47 PM, Alexey Kardashevskiy wrote: On 13/12/24 18:08, Chenyi Qiang wrote: Introduce the realize()/un

Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets disabled

2025-01-23 Thread Jason Wang
On Fri, Jan 24, 2025 at 10:44 AM Duan, Zhenzhong wrote: > > > > >-Original Message- > >From: Eric Auger > >Subject: Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets > >disabled > > > >Hi Jason, > > > > > >On 1/23/25 2:34 AM, Jason Wang wrote: > >> On Wed, Jan 22, 2025

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-23 Thread Chenyi Qiang
On 1/24/2025 8:15 AM, Alexey Kardashevskiy wrote: > > > On 22/1/25 16:38, Xiaoyao Li wrote: >> On 1/22/2025 11:28 AM, Chenyi Qiang wrote: >>> >>> >>> On 1/22/2025 12:35 AM, Peter Xu wrote: On Tue, Jan 21, 2025 at 09:35:26AM +0800, Chenyi Qiang wrote: > > > On 1/21/2025 2:33 AM

[PATCH v2 1/2] aspeed/wdt: Fix coding style

2025-01-23 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/watchdog/wdt_aspeed.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c index 81f5c5189a..22e94e7b9c 100644 --- a/hw/

[PATCH v2 2/2] aspeed/wdt: Support software reset mode for AST2600

2025-01-23 Thread Jamin Lin via
On the AST2400 and AST2500 platforms, the system can only be reset by enabling the WDT (Watchdog Timer) and waiting for the WDT timeout. However, starting from the AST2600 platform, the reset event can be triggered directly and intentionally by software, without relying on the WDT timeout. This me

[PATCH v2 0/2] wdt/aspeed: Support software reset mode for AST2600

2025-01-23 Thread Jamin Lin via
v1: Support software reset mode for AST2600 v2: Change to validate WDT_CTRL_RESET_MODE_SOC Jamin Lin (2): aspeed/wdt: Fix coding style aspeed/wdt: Support software reset mode for AST2600 hw/watchdog/wdt_aspeed.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-)

[PATCH v2] hw/usb/hcd-ehci: Fix debug printf format string

2025-01-23 Thread BALATON Zoltan
The variable is uint64_t so needs %ld instead of %d. Fixes: 3ae7eb88c47 ("ehci: fix overflow in frame timer code") Signed-off-by: BALATON Zoltan --- hw/usb/hcd-ehci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 6c4c14c895..b09

RE: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets disabled

2025-01-23 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets >disabled > >Hi Jason, > > >On 1/23/25 2:34 AM, Jason Wang wrote: >> On Wed, Jan 22, 2025 at 3:55 PM Eric Auger wrote: >>> Hi Jason, >>> >>> >>> On 1/22/25 8:17 AM, Jason

RE: [PATCH v1 2/2] aspeed/wdt: Support software reset mode for AST2600

2025-01-23 Thread Jamin Lin
Hi Cedric, > From: Cédric Le Goater > Sent: Friday, January 24, 2025 2:45 AM > To: Jamin Lin ; Peter Maydell > ; Steven Lee ; Troy > Lee ; Andrew Jeffery ; > Joel Stanley ; open list:ASPEED BMCs > ; open list:All patches CC here > > Cc: Troy Lee ; Yunlin Tang > > Subject: Re: [PATCH v1 2/2] as

Re: [RFC PATCH 00/10] rust: remaining part of qdev bindings

2025-01-23 Thread Zhao Liu
On Fri, Jan 17, 2025 at 08:39:53PM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 20:39:53 +0100 > From: Paolo Bonzini > Subject: [RFC PATCH 00/10] rust: remaining part of qdev bindings > X-Mailer: git-send-email 2.47.1 > > This is what I have left for qdev bindings, including 1) reference

Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets disabled

2025-01-23 Thread Jason Wang
On Thu, Jan 23, 2025 at 4:31 PM Eric Auger wrote: > > Hi Jason, > > > On 1/23/25 2:34 AM, Jason Wang wrote: > > On Wed, Jan 22, 2025 at 3:55 PM Eric Auger wrote: > >> Hi Jason, > >> > >> > >> On 1/22/25 8:17 AM, Jason Wang wrote: > >>> On Wed, Jan 22, 2025 at 12:25 AM Eric Auger wrote: > Hi

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-23 Thread Alexey Kardashevskiy
On 22/1/25 16:38, Xiaoyao Li wrote: On 1/22/2025 11:28 AM, Chenyi Qiang wrote: On 1/22/2025 12:35 AM, Peter Xu wrote: On Tue, Jan 21, 2025 at 09:35:26AM +0800, Chenyi Qiang wrote: On 1/21/2025 2:33 AM, Peter Xu wrote: On Mon, Jan 20, 2025 at 06:54:14PM +0100, David Hildenbrand wrote:

[PATCH v1 0/4] x86-disas: port x86-mini disassembler to QEMU

2025-01-23 Thread Michael Clark
a port of an embeddable x86 disassembler to QEMU. - https://github.com/michaeljclark/qemu/tree/x86-mini - https://github.com/michaeljclark/x86/tree/x86-mini # x86-mini disassembler the x86-mini library is a lightweight x86 encoder, decoder, and disassembler that uses extensions to the Intel inst

[PATCH v1 2/4] x86-disas: add x86-mini metadata documentation

2025-01-23 Thread Michael Clark
add detailed information on the instruction opcode encoding format for LEX/VEX/EVEX prefix, map and opcode encoding, the operand encoding format, the field order encoding format and notes on instruction synthesis for parameterized opcodes. Signed-off-by: Michael Clark --- docs/x86-metadata.txt |

[PATCH v1 3/4] x86-disas: add x86-mini metadata tablegen script

2025-01-23 Thread Michael Clark
the x86-mini metadata tablegen python script reads instruction set metadata CSV files and translates them into tables used by the disassembler. it generates the following tables: - x86_opc_table that encodes prefix, map, and opcode - x86_opr_table that encodes instruction operands - x86_ord_table

[PATCH 14/20] accel/tcg: Move cpu_memory_rw_debug() user implementation to user-exec.c

2025-01-23 Thread Philippe Mathieu-Daudé
cpu_memory_rw_debug() system implementation is defined in system/physmem.c. Move the user one to accel/tcg/user-exec.c to simplify cpu-target.c maintenance. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/user-exec.c | 92 + cpu-target.c | 102 +-

[PATCH 09/20] accel/tcg: Restrict 'icount_align_option' global to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
Since commit 740b1759734 ("cpu-timers, icount: new modules") we don't need to expose icount_align_option to all the system code, we can restrict it to TCG. Since it is used as a boolean, declare it as 'bool' type. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-common.h | 2 ++ incl

[PATCH 18/20] cpus: Have cpu_exec_initfn() per user / system emulation

2025-01-23 Thread Philippe Mathieu-Daudé
Slighly simplify cpu-target.c again by extracting cpu_exec_initfn() to cpu-{system,user}.c, adding an empty stub for user emulation. Signed-off-by: Philippe Mathieu-Daudé --- Good enough for now... --- cpu-target.c | 9 - hw/core/cpu-system.c | 7 +++ hw/core/cpu-user.c | 5

[PATCH 11/20] accel: Rename 'hw/core/accel-cpu.h' -> 'accel/accel-cpu-target.h'

2025-01-23 Thread Philippe Mathieu-Daudé
AccelCPUClass is for accelerator to initialize target specific features of a vCPU. Not really related to hardware emulation, rename "hw/core/accel-cpu.h" as "accel/accel-cpu-target.h" (using the explicit -target suffix). More importantly, target specific header often access the target specific def

[PATCH 08/20] accel/tcg: Restrict tlb_init() / destroy() to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
Move CPU TLB related methods to accel/tcg/ scope, in "internal-common.h". Suggested-by: Richard Henderson Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-common.h | 11 +++ include/exec/exec-all.h | 16 accel/tcg/user-exec

Re: [PATCH 02/20] user: Extract common MMAP API to 'user/mmap.h'

2025-01-23 Thread Philippe Mathieu-Daudé
On 24/1/25 00:43, Philippe Mathieu-Daudé wrote: Keep common MMAP-related declarations in a single place. Note, this disable ThreadSafetyAnalysis on Linux for: - mmap_fork_start() - mmap_fork_end(). Signed-off-by: Philippe Mathieu-Daudé I forgot to include: Reviewed-by: Warner Losh --- b

[PATCH 05/20] cpus: Keep default fields initialization in cpu_common_initfn()

2025-01-23 Thread Philippe Mathieu-Daudé
cpu_common_initfn() is our target agnostic initializer, while cpu_exec_initfn() is the target specific one. The %as and %num_ases fields are not target specific, so initialize them in the common helper. Signed-off-by: Philippe Mathieu-Daudé --- cpu-target.c | 3 --- hw/core/cpu-common.c

[PATCH 16/20] cpus: Restrict cpu_common_post_load() code to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
CPU_INTERRUPT_EXIT was removed in commit 3098dba01c7 ("Use a dedicated function to request exit from execution loop"), tlb_flush() and tb_flush() are related to TCG accelerator. Signed-off-by: Philippe Mathieu-Daudé --- cpu-target.c | 33 +++-- 1 file changed, 19 inse

[PATCH 19/20] cpus: Register VMState per user / system emulation

2025-01-23 Thread Philippe Mathieu-Daudé
Simplify cpu-target.c by extracting mixed vmstate code into the cpu_vmstate_register() / cpu_vmstate_unregister() helpers, implemented in cpu-user.c and cpu-system.c. Signed-off-by: Philippe Mathieu-Daudé --- XXX: tlb_flush() temporary declared manually. Only 2 more CONFIG_USER_ONLY to go. ---

[PATCH 00/20] accel: Simplify cpu-target.c (omnibus)

2025-01-23 Thread Philippe Mathieu-Daudé
Yet another cleanup series before respining the "extract TCG fields from CPUState" series. Before that, we try to clarify a bit the code around CPU creation. Target specific code is reduced further. Some intermixed User/System is separated, making maintenance simpler IMHO. Since my local branch is

[PATCH 20/20] cpus: Build cpu_exec_[un]realizefn() methods once

2025-01-23 Thread Philippe Mathieu-Daudé
Now that cpu_exec_realizefn() and cpu_exec_unrealizefn() methods don't use any target specific definition anymore, we can move them to cpu-common.c to be able to build them once. Signed-off-by: Philippe Mathieu-Daudé --- Eventually they'll be absorbed within cpu_common_[un]realizefn(). --- cpu-t

[PATCH 17/20] cpus: Have cpu_class_init_props() per user / system emulation

2025-01-23 Thread Philippe Mathieu-Daudé
Rather than maintaining a mix of system / user code for CPU class properties, move system properties to cpu-system.c and user ones to the new cpu-user.c unit. Signed-off-by: Philippe Mathieu-Daudé --- cpu-target.c | 58 hw/core/cpu-system.c |

[PATCH 15/20] cpus: Fix style in cpu-target.c

2025-01-23 Thread Philippe Mathieu-Daudé
Fix style on code we are going to modify. Signed-off-by: Philippe Mathieu-Daudé --- cpu-target.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index 6d8b7825746..a2999e7c3c0 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -47,12 +47,15 @

[PATCH 13/20] accel: Forward-declare AccelOpsClass in 'qemu/typedefs.h'

2025-01-23 Thread Philippe Mathieu-Daudé
The heavily imported "system/cpus.h" header includes "accel-ops.h" to get AccelOpsClass type declaration. Reduce headers pressure by forward declaring it in "qemu/typedefs.h", where we already declare the AccelCPUState type. Reduce "system/cpus.h" inclusions by only including "system/accel-ops.h"

[PATCH 10/20] accel/tcg: Rename 'hw/core/tcg-cpu-ops.h' -> 'accel/tcg/cpu-ops.h'

2025-01-23 Thread Philippe Mathieu-Daudé
TCGCPUOps structure makes more sense in the accelerator context rather than hardware emulation. Move it under the accel/tcg/ scope. Mechanical change doing: $ sed -i -e 's,hw/core/tcg-cpu-ops.h,accel/tcg/cpu-ops.h,g' \ $(git grep -l hw/core/tcg-cpu-ops.h) Signed-off-by: Philippe Mathieu-Dau

[PATCH 03/20] gdbstub: Check for TCG before calling tb_flush()

2025-01-23 Thread Philippe Mathieu-Daudé
Use the tcg_enabled() check so the compiler can elide the call when TCG isn't available, allowing to remove the tb_flush() stub. Signed-off-by: Philippe Mathieu-Daudé --- accel/stubs/tcg-stub.c | 4 gdbstub/system.c | 5 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --g

[PATCH 06/20] accel/kvm: Remove unused 'system/cpus.h' header in kvm-cpus.h

2025-01-23 Thread Philippe Mathieu-Daudé
Missed in commit b86f59c7155 ("accel: replace struct CpusAccel with AccelOpsClass") which removed the single CpusAccel use. Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-cpus.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/accel/kvm/kvm-cpus.h b/accel/kvm/kvm-cpus.h index b54352

[PATCH 12/20] accel/accel-cpu-target.h: Include missing 'cpu.h' header

2025-01-23 Thread Philippe Mathieu-Daudé
CPU_RESOLVING_TYPE is declared per target in "cpu.h". Include it (along with "qom/object.h") to avoid when moving code around: include/accel/accel-cpu-target.h:26:50: error: expected ')' 26 | DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) |

[PATCH 04/20] cpus: Cache CPUClass early in instance_init() handler

2025-01-23 Thread Philippe Mathieu-Daudé
Cache CPUClass as early as possible, when the instance is initialized. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- cpu-target.c | 3 --- hw/core/cpu-common.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu-target.c b/cpu-target.c

[PATCH 02/20] user: Extract common MMAP API to 'user/mmap.h'

2025-01-23 Thread Philippe Mathieu-Daudé
Keep common MMAP-related declarations in a single place. Note, this disable ThreadSafetyAnalysis on Linux for: - mmap_fork_start() - mmap_fork_end(). Signed-off-by: Philippe Mathieu-Daudé --- bsd-user/qemu.h| 12 +--- include/user/mmap.h| 32

[PATCH 07/20] accel/tcg: Build tcg_flags helpers as common code

2025-01-23 Thread Philippe Mathieu-Daudé
While cpu-exec.c is build for each target,tcg_flags helpers aren't target specific. Move them to cpu-exec-common.c to build them once. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec-common.c | 33 + accel/tcg/cpu-exec.c| 32 --

[PATCH 01/20] qemu/compiler: Absorb 'clang-tsa.h'

2025-01-23 Thread Philippe Mathieu-Daudé
We already have "qemu/compiler.h" for compiler-specific arrangements, automatically included by "qemu/osdep.h" for each source file. No need to explicitly include a header for a Clang particularity. Suggested-by: Pierrick Bouvier Reviewed-by: Pierrick Bouvier Reviewed-by: Alex Bennée Reviewed-b

Re: [PATCH] hw/usb/hcd-ehci: Fix debug printf format string

2025-01-23 Thread Philippe Mathieu-Daudé
Hi Zoltan, On 23/1/25 22:48, BALATON Zoltan wrote: The variable is uint64_t so needs %ld instead of %d. Actually the format is PRIu64. Fixes: 3ae7eb88c47 ("ehci: fix overflow in frame timer code") Signed-off-by: BALATON Zoltan --- hw/usb/hcd-ehci.c | 2 +- 1 file changed, 1 insertion(+

[PATCH 10/15] target/ppc: Restrict ppc_tcg_hv_emu() to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
Make is_prefix_insn_excp() prototype but have it guarded by a tcg_enabled() check. Inline part of it in powerpc_excp_books(). Extract POWERPC_EXCP_HV_EMU handling code to ppc_tcg_hv_emu(), also exposing its prototype in "internal.h". Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/internal

[RFC PATCH 01/15] hw/ppc/spapr: Restrict CONFER hypercall to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
TODO: Add PPC folks why :) Signed-off-by: Philippe Mathieu-Daudé --- RFC: Missing appropriate commit description... hw/ppc/spapr_hcall.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index f8ab7670630..dbf30358a1a 100644 --- a/hw/ppc/spapr_hca

[PATCH 12/15] target/ppc: Fix style in excp_helper.c

2025-01-23 Thread Philippe Mathieu-Daudé
Fix style in do_rfi() before moving the code around. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/excp_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 48e08d65bd7..661d9650d9f 100644 --- a/target/ppc

[PATCH 07/15] target/ppc: Restrict powerpc_checkstop() to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
Expose powerpc_checkstop() prototype, and move it to tcg-excp_helper.c, only built when TCG is available. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/internal.h| 2 ++ target/ppc/excp_helper.c | 26 -- target/ppc/tcg-excp_helper.c | 28 ++

[PATCH 11/15] target/ppc: Restrict various common helpers to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
Move helpers common to system/user emulation to tcg-excp_helper.c. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/excp_helper.c | 141 -- target/ppc/tcg-excp_helper.c | 143 +++ 2 files changed, 143 insertions(+), 141 dele

[PATCH 06/15] target/ppc: Ensure powerpc_checkstop() is only called under TCG

2025-01-23 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/excp_helper.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 8956466db1d..b08cd53688c 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -

[PATCH 05/15] target/ppc: Move ppc_ldl_code() to tcg-excp_helper.c

2025-01-23 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/excp_helper.c | 21 - target/ppc/tcg-excp_helper.c | 18 ++ 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index b05eb7f5aec..8956466d

[PATCH 13/15] target/ppc: Make powerpc_excp() prototype public

2025-01-23 Thread Philippe Mathieu-Daudé
In order to move TCG specific code dependent on powerpc_excp() in the next commit, expose its prototype in "internal.h". Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/internal.h| 1 + target/ppc/excp_helper.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target

[PATCH 03/15] target/ppc: Make ppc_ldl_code() declaration public

2025-01-23 Thread Philippe Mathieu-Daudé
We are going to move code calling ppc_ldl_code() out of excp_helper.c where it is defined. Expose its declaration for few commits, until eventually making it static again once everything is moved. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/internal.h| 2 ++ target/ppc/excp_helper.c

[PATCH 14/15] target/ppc: Restrict various system helpers to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
We don't need to expose ppc_ldl_code() anymore. Similarly, make raise_exception() scope local. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu.h | 1 - target/ppc/internal.h| 2 - target/ppc/excp_helper.c | 414 -- target/ppc/t

[PATCH 15/15] target/ppc: Restrict ATTN helper to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
Move helper_attn() to tcg-excp_helper.c and make raise_exception_err() static. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu.h | 2 -- target/ppc/excp_helper.c | 20 target/ppc/tcg-excp_helper.c | 13 - 3 files changed, 12 insertions(+

[PATCH 04/15] target/ppc: Move TCG specific exception handlers to tcg-excp_helper.c

2025-01-23 Thread Philippe Mathieu-Daudé
Move the TCGCPUOps handlers to a new unit: tcg-excp_helper.c, only built when TCG is selected. See in target/ppc/cpu_init.c: #ifdef CONFIG_TCG static const TCGCPUOps ppc_tcg_ops = { ... .do_unaligned_access = ppc_cpu_do_unaligned_access, .do_transaction_failed = ppc_cpu_

[PATCH 09/15] target/ppc: Restrict exception helpers to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
Move exception helpers to tcg-excp_helper.c so they are only built when TCG is selected. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/excp_helper.c | 34 target/ppc/tcg-excp_helper.c | 38 2 files changed, 38 inser

[PATCH 08/15] target/ppc: Remove raise_exception_ra()

2025-01-23 Thread Philippe Mathieu-Daudé
Introduced in commit db789c6cd33 ("ppc: Provide basic raise_exception_* functions"), raise_exception_ra() has never been used. Remove as dead code. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu.h | 2 -- target/ppc/excp_helper.c | 6 -- 2 files changed, 8 deletions(-) dif

[PATCH 02/15] hw/ppc/spapr: Restrict part of PAGE_INIT hypercall to TCG

2025-01-23 Thread Philippe Mathieu-Daudé
Restrict the tb_flush() call to TCG. Assert we are using KVM or TCG. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/spapr_hcall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index dbf30358a1a..4f1933b8da6 100644 --- a/hw/pp

[PATCH 00/15] target/ppc: Move TCG code from excp_helper.c to tcg-excp_helper.c

2025-01-23 Thread Philippe Mathieu-Daudé
Hi, This series is a simply a cleanup restricting TCG specific exception-related code to TCG, by moving code to a new unit named 'tcg-excp_helper.c'. I ended doing it as a preliminary cleanup for the "Extract TCG state from CPUState". Diffstat shows 1K lines moved, but the patches are trivial to

[PATCH] hw/usb/hcd-ehci: Fix debug printf format string

2025-01-23 Thread BALATON Zoltan
The variable is uint64_t so needs %ld instead of %d. Signed-off-by: BALATON Zoltan --- hw/usb/hcd-ehci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 6c4c14c895..23b3e20fdb 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @

[PATCH] tests/qtest/qom-test: Test retrieval of machine class properties

2025-01-23 Thread Thomas Huth
There were recently some crashes that occurred when trying to retrieve the properties of machines. Let's add a test to avoid regression here. Signed-off-by: Thomas Huth --- Based-on: <20250117192106.471029-1-th...@redhat.com> Based-on: <20250123204708.1560305-1-th...@redhat.com> tests/qtest/

[PATCH RESEND] hw/i386/microvm: Fix crash that occurs when introspecting the microvm machine

2025-01-23 Thread Thomas Huth
QEMU currently crashes when you try to inspect the properties of the microvm machine: $ echo '{ "execute": "qmp_capabilities" } { "execute": "qom-list-properties","arguments": { "typename": "microvm-machine"}}' | \ ./qemu-system-x86_64 -qmp stdio {"QMP": {"version": {"qemu

Re: [RFC PATCH] Fix race in live migration failure path

2025-01-23 Thread Peter Xu
On Thu, Jan 23, 2025 at 06:05:28PM +, Shivam Kumar wrote: > > > > On 23 Jan 2025, at 9:57 PM, Peter Xu wrote: > > > > !---| > > CAUTION: External Email > > > > |

[RFC 1/6] ui: add more cursor helper methods

2025-01-23 Thread Daniel P . Berrangé
This adds helper methods to the QEMUCursor APIs for multiplying / unmultiplying the alpha channel into the RGB components; for swapping the RGB component order; for copying cursor objects; auto-freeing cursor objects. Signed-off-by: Daniel P. Berrangé --- include/ui/console.h | 6 ++ ui/cur

[RFC 5/6] ui/sdl: load cursor in RGBA8888 format not BGRA8888

2025-01-23 Thread Daniel P . Berrangé
The SDL code was loading cursor data in BGRA format which masked the problem with virtio-gpu not supplying data in RGBA format. Now that virtio-gpu is fixed, the SDL code needs to be fixed to match. Signed-off-by: Daniel P. Berrangé --- ui/sdl2.c | 2 +- 1 file changed, 1 insertion(+), 1

[RFC 6/6] ui: add ability to dump the raw cursor bytes

2025-01-23 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- hw/display/virtio-gpu.c | 1 + include/ui/console.h| 1 + ui/cursor.c | 21 + 3 files changed, 23 insertions(+) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 9952658df2..84836f52c4 100644 --- a/hw/

[RFC 3/6] hw/display/virtio-gpu: fix pixel ordering from BGRA8888 to RGBA8888

2025-01-23 Thread Daniel P . Berrangé
Currently both the VNC and GTK displays are rendering coloured cursors with RGB components reversed. This originates with the data received from the guest, so virtio-gpu must reverse this again to get it back to the natural RGBA order expected by backends. Signed-off-by: Daniel P. Berrangé --

[RFC 2/6] hw/display/virtio-gpu.c: reverse alpha pre-multiplication

2025-01-23 Thread Daniel P . Berrangé
The cursor data we receive from the guest has had the alpha channel pre-multiplied into the RGB components. Reverse this before passing the cursor onto the backends. Without doing this, areas of the cursor with alpha are much less saturated than they are intended to be. This effect is visible with

[RFC 4/6] ui/vnc: pre-multiply alpha with alpha cursor

2025-01-23 Thread Daniel P . Berrangé
The RFB specification for the alpha cursor encoding requires that the alpha channel is pre-multiplied into the RGB components. This worked by luck previously since the virtio-gpu device was not reversing the pre-multiplication on data received from the guest. Now virtio-gpu is fixed, the VNC server

[RFC 0/6] RFC: hw/display/virtio-gpu: problems with coloured cursors

2025-01-23 Thread Daniel P . Berrangé
Help needed ! This is not for merge, just demo. I started working on a simple bug in the GTK-VNC 'alpha cursor' encoding support and in testing that uncovered what appear to be several bugs in QEMU related to cursor handling across different components. The two core behaviours are seen: * In so

  1   2   >