[PATCH v4] hw/audio/virtio-snd: Always use little endian audio format

2024-04-22 Thread Philippe Mathieu-Daudé
: Philippe Mathieu-Daudé --- Supersedes: <20240422142056.3023-1-phi...@linaro.org> v4: always LE (MST) --- hw/audio/virtio-snd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c index c80b58bf5d..ba4fff7302 100644 --- a/hw/audio/vi

Re: [PATCH v3] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 23:02, Michael S. Tsirkin wrote: On Mon, Apr 22, 2024 at 04:20:56PM +0200, Philippe Mathieu-Daudé wrote: Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-

Re: [PATCH] target/arm: Restrict translation disabled alignment check to VMSA

2024-04-22 Thread Philippe Mathieu-Daudé
both VMSA and PMSA sections, and the language about default Device type and alignment traps, is in the VMSA section. To the best of my knowledge, Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH intel_iommu 3/7] intel_iommu: make types match

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 17:52, CLEMENT MATHIEU--DRIF wrote: The 'level' field in vtd_iotlb_key is an uint8_t. We don't need to store level as an int in vtd_lookup_iotlb Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH intel_iommu 5/7] intel_iommu: extract device IOTLB invalidation logic

2024-04-22 Thread Philippe Mathieu-Daudé
+2941,7 @@ static bool vtd_process_device_iotlb_desc(IntelIOMMUState *s, return false; } + Spurious newline ;) Reviewed-by: Philippe Mathieu-Daudé /*

Re: [PATCH v2] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 15:45, Manos Pitsidianakis wrote: On Mon, 22 Apr 2024 16:13, Philippe Mathieu-Daudé wrote: Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Hey Philippe, can you clarify what do you mean by they can change endianness

[PATCH v3] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philippe Mathieu-Daudé --- v2: Use virtio_is_big_endian()

Re: [PATCH v1 3/4] virtio-snd: factor card removal out of unrealize()

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 14:52, Manos Pitsidianakis wrote: Extract audio card removal logic out of the device unrealize callback so that it can be re-used in follow up commits. Signed-off-by: Manos Pitsidianakis --- hw/audio/virtio-snd.c | 20 ++-- 1 file changed, 14 insertions(+), 6

Re: [PATCH v1 2/4] virtio-snd: factor card setup out of realize func

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 14:52, Manos Pitsidianakis wrote: Extract audio card setup logic out of the device realize callback so that it can be re-used in follow up commits. Signed-off-by: Manos Pitsidianakis --- hw/audio/virtio-snd.c | 72 --- 1 file changed, 41

Re: [PATCH v1 1/4] virtio-snd: add virtio_snd_is_config_valid()

2024-04-22 Thread Philippe Mathieu-Daudé
Hi Manos, On 22/4/24 14:52, Manos Pitsidianakis wrote: Factor out virtio_snd_config value validation in a separate function, in order to re-use it in follow up commits. Signed-off-by: Manos Pitsidianakis --- hw/audio/virtio-snd.c | 47 ++- 1 file

[PATCH v2] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philippe Mathieu-Daudé --- hw/audio/virtio-snd.c | 8 +

Re: [PATCH] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 15:04, Philippe Mathieu-Daudé wrote: Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philip

[PATCH] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philippe Mathieu-Daudé --- hw/audio/virtio-snd.c | 8 +

[PATCH] hw/arm/npcm7xx: Store derivative OTP fuse key in little endian

2024-04-22 Thread Philippe Mathieu-Daudé
Use little endian for derivative OTP fuse key. Cc: qemu-sta...@nongnu.org Fixes: c752bb079b ("hw/nvram: NPCM7xx OTP device model") Suggested-by: Avi Fishman Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/npcm7xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --gi

Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu()

2024-04-22 Thread Philippe Mathieu-Daudé
On 13/12/22 14:53, Peter Maydell wrote: On Tue, 13 Dec 2022 at 12:52, Philippe Mathieu-Daudé wrote: This partly revert commit d48751ed4f ("xilinx-ethlite: Simplify byteswapping to/from brams") which states the packet data is stored in big-endian. Signed-off-by: Philippe Mat

Re: [PATCH] pythondeps.toml: warn about updates needed to docs/requirements.txt

2024-04-22 Thread Philippe Mathieu-Daudé
(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 17/24] exec: Include missing 'qemu/log-for-trace.h' header in 'exec/log.h'

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 11:05, Philippe Mathieu-Daudé wrote: On 21/4/24 18:44, Richard Henderson wrote: On 4/18/24 12:25, Philippe Mathieu-Daudé wrote: "exec/log.h" accesses the qemu_loglevel variable, which is declared in "qemu/log-for-trace.h". Signed-off-by: Philippe Mathieu-Daudé

Re: [PATCH] hw/misc : Correct 5 spaces indents in stm32l4x5_exti

2024-04-22 Thread Philippe Mathieu-Daudé
On 21/4/24 16:14, Inès Varhol wrote: Signed-off-by: Inès Varhol --- hw/misc/stm32l4x5_exti.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu-Daudé and queued, thanks!

[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(-)

Re: [PATCH] backends/cryptodev-builtin: Fix local_error leaks

2024-04-22 Thread Philippe Mathieu-Daudé
"Cannot find a valid session id: %" PRIu64 "", - op_info->session_id); +error_report("Cannot find a valid session id: %" PRIu64 "", + op_info->session_id); return -VIRTIO_CRYPTO_INVSESS; } Reviewed-by: Philippe Mathieu-Daudé

Re: Support Apple Silicon acceleration for x86 / x86_64 guests

2024-04-22 Thread Philippe Mathieu-Daudé
(Cc'ing Cameron in case someone at Apple can help) & @osy86 @rth7680 @agraf @akihiko.odaki My understanding is binaries need to be signed to enable TSO (like Rosetta 2), but as an open source project we can not sign the qemu-system-x86_64 binary, thus QEMU can't use TSO. IIUC we did the best

Re: [PATCH 17/24] exec: Include missing 'qemu/log-for-trace.h' header in 'exec/log.h'

2024-04-22 Thread Philippe Mathieu-Daudé
On 21/4/24 18:44, Richard Henderson wrote: On 4/18/24 12:25, Philippe Mathieu-Daudé wrote: "exec/log.h" accesses the qemu_loglevel variable, which is declared in "qemu/log-for-trace.h". Signed-off-by: Philippe Mathieu-Daudé ---   include/exec/log.h | 1 +   1 file changed,

Re: [PATCH] hw/core/clock: always iterate through childs in clock_propagate_period

2024-04-19 Thread Philippe Mathieu-Daudé
On 19/4/24 18:08, Raphael Poggi wrote: Hi Peter, Le ven. 19 avr. 2024 à 16:08, Peter Maydell a écrit : On Thu, 18 Apr 2024 at 21:39, Raphael Poggi wrote: Hi Philippe, Le jeu. 18 avr. 2024 à 20:43, Philippe Mathieu-Daudé a écrit : Hi Raphael, On 18/4/24 21:16, Raphael Poggi wrote

Re: [PATCH 0/3] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean

2024-04-19 Thread Philippe Mathieu-Daudé
On 18/4/24 12:04, Zhao Liu wrote: From: Zhao Liu --- Zhao Liu (3): hw/cxl/cxl-cdat: Make ct3_load_cdat() return boolean hw/cxl/cxl-cdat: Make ct3_build_cdat() return boolean hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean Since Jonathan Ack'ed the series, I'm queuing it

Re: [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions

2024-04-19 Thread Philippe Mathieu-Daudé
On 19/4/24 13:05, Philippe Mathieu-Daudé wrote: We need to use get_address() to get an address from cpu_gpr[], since $zero is "special" (NULL). Cc: qemu-sta...@nongnu.org Fixes: e05da09b7c ("target/riscv: implement Zicbom extension") Reported-by: Zhiwei Jiang (姜智伟) Sig

[PATCH] target/riscv: Use get_address() to get address with Zicbom extensions

2024-04-19 Thread Philippe Mathieu-Daudé
We need to use get_address() to get an address from cpu_gpr[], since $zero is "special" (NULL). Fixes: e05da09b7c ("target/riscv: implement Zicbom extension") Reported-by: Zhiwei Jiang (姜智伟) Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/insn_trans/trans_rvzicbo.c

Re: [PATCH] tcg: Fix the overflow in indexing tcg_ctx->temps

2024-04-19 Thread Philippe Mathieu-Daudé
On 19/4/24 12:21, Peter Maydell wrote: On Fri, 19 Apr 2024 at 10:37, 姜智伟 wrote: Peter Maydell wrote: I feel like this might be a bug elsewhere. Can you provide a repro binary and command line? The test file has been attached with RISCV CBO instruction as the first instruction to execute,

hw/virtio: qtest failure in virtio_init_region_cache() on macOS

2024-04-19 Thread Philippe Mathieu-Daudé
Hi, On macOS, the fuzz-virtio-scsi-test triggers virtio_error(vdev, "Cannot map used") from virtio_init_region_cache(): QTEST_QEMU_BINARY=./qemu-system-x86_64 tests/qtest/fuzz-virtio-scsi-test # Start of x86_64 tests # Start of fuzz tests # starting QEMU: exec ./qemu-system-x86_64 ... -M

Re: [PATCH] target/s390x: Remove KVM stubs in cpu_models.h

2024-04-19 Thread Philippe Mathieu-Daudé
On 19/4/24 11:06, Philippe Mathieu-Daudé wrote: Since the calls are elided when KVM is not available, we can remove the stubs (which are never compiled). Inspired-by: Thomas Huth > Signed-off-by: Philippe Mathieu-Daudé --- RFC: untested =) Now tested! Inspired by https://lore.kernel.

Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean

2024-04-19 Thread Philippe Mathieu-Daudé
On 19/4/24 10:44, Zhao Liu wrote: Hi Thomas, On Fri, Apr 19, 2024 at 09:50:46AM +0200, Thomas Huth wrote: Date: Fri, 19 Apr 2024 09:50:46 +0200 From: Thomas Huth Subject: Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean On 19/04/2024 08.57, Zhao

[RFC PATCH] target/s390x: Remove KVM stubs in cpu_models.h

2024-04-19 Thread Philippe Mathieu-Daudé
Since the calls are elided when KVM is not available, we can remove the stubs (which are never compiled). Inspired-by: Thomas Huth > Signed-off-by: Philippe Mathieu-Daudé --- RFC: untested =) Inspired by https://lore.kernel.org/qemu-devel/0ae778e1-b4aa-4021-bdbc-4c6a663db...@redhat.

Re: [PATCH v2 4/4] docs/about: Deprecate the old "UltraSparc" CPU names that contain a "+"

2024-04-19 Thread Philippe Mathieu-Daudé
On 19/4/24 10:48, Thomas Huth wrote: For consistency we should drop the names with a "+" in it in the long run. Reviewed-by: Mark Cave-Ayland Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 9 + 1 file changed, 9 insertions(+) Reviewed-by: Philippe Mathieu-Daudé

[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 0/6] s390x/cpu_models: Misc cleanup on returned error code and local @err variables

2024-04-19 Thread Philippe Mathieu-Daudé
target/s390x/cpu_models: Drop local @err in get_max_cpu_model() target/s390x/cpu_models: Make kvm_s390_apply_cpu_model() return boolean target/s390x/cpu_models_sysemu: Drop local @err in apply_cpu_model() Series: Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean

2024-04-19 Thread Philippe Mathieu-Daudé
On 19/4/24 08:57, Zhao Liu wrote: From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make kvm_s390_get_host_cpu_model() return boolean and check the returned boolean in get_max_cpu_model() instead of accessing @err.

Re: [PATCH v7 0/5] ui/console: Private QemuDmaBuf struct

2024-04-19 Thread Philippe Mathieu-Daudé
On 19/4/24 00:05, dongwon@intel.com wrote: From: Dongwon Kim This series introduces privacy enhancements to the QemuDmaBuf struct and its contained data to bolster security. it accomplishes this by introducing of helper functions for allocating, deallocating, and accessing individual

Re: [PATCH v7 5/5] ui/dmabuf: New dmabuf.c and dmabuf.h for QemuDmaBuf struct and helpers

2024-04-19 Thread Philippe Mathieu-Daudé
On 19/4/24 00:05, dongwon@intel.com wrote: From: Dongwon Kim Create new header and source files to encapsulate QemuDmaBuf struct and its data for privatization. Suggested-by: Marc-André Lureau Cc: Philippe Mathieu-Daudé Cc: Daniel P. Berrangé Cc: Vivek Kasireddy Signed-off-by: Dongwon

Re: [PATCH] hw/core/clock: always iterate through childs in clock_propagate_period

2024-04-18 Thread Philippe Mathieu-Daudé
Hi Raphael, On 18/4/24 21:16, Raphael Poggi wrote: When dealing with few clocks depending with each others, sometimes we might only want to update the multiplier/diviser on a specific clock (cf clockB in drawing below) and call "clock_propagate(clockA)" to update the childs period according to

Re: [PATCH 00/24] include/exec: Rework (part 2)

2024-04-18 Thread Philippe Mathieu-Daudé
On 18/4/24 21:24, Philippe Mathieu-Daudé wrote: Reordering exec/, second round. Mostly splitting: - TCG LDST API (to "exec/cpu_ldst.h") - CPU TLB APIs (to "exec/cputlb.h") from "exec/cpu-all.h" and "exec/exec-all.h", and reducing inclusions of "hw/co

[PATCH 16/24] exec: Move GUEST_ADDR_MAX definition to 'cpu_ldst.h'

2024-04-18 Thread Philippe Mathieu-Daudé
GUEST_ADDR_MAX is only used in accel/tcg/user-exec.c and "exec/cpu_ldst.h". Move it from "exec/cpu-all.h" to "exec/cpu_ldst.h" so we can avoid including "exec/cpu-all.h" in accel/tcg/user-exec.c. Signed-off-by: Philippe Mathieu-

[PATCH 23/24] exec: Remove 'disas/disas.h' from 'exec/log.h'

2024-04-18 Thread Philippe Mathieu-Daudé
"exec/log.h" doesn't require "disas/disas.h". Remove it, including it in the sources when required. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/log.h | 1 - target/avr/translate.c | 1 + target/hexagon/translate.c | 1 + target/loong

[PATCH 17/24] exec: Include missing 'qemu/log-for-trace.h' header in 'exec/log.h'

2024-04-18 Thread Philippe Mathieu-Daudé
"exec/log.h" accesses the qemu_loglevel variable, which is declared in "qemu/log-for-trace.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/log.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/log.h b/include/exec/log.h index 4a7375a45

[PATCH 18/24] plugins: Include missing 'qemu/bitmap.h' header

2024-04-18 Thread Philippe Mathieu-Daudé
"qemu/plugin.h" uses DECLARE_BITMAP(), which is declared in "qemu/bitmap.h". Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/plugin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index 12a96cea2a..41db748eda 10064

[PATCH 21/24] plugins: Un-inline qemu_plugin_disable_mem_helpers()

2024-04-18 Thread Philippe Mathieu-Daudé
"qemu/plugin.h" only include the huge "hw/core/cpu.h" because qemu_plugin_disable_mem_helpers() accesses CPUState::plugin_mem_cbs. In order to avoid including it, un-inline qemu_plugin_disable_mem_helpers(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/plugin.h

[PATCH 22/24] exec: Remove 'exec/tswap.h' from 'exec/cpu-all.h'

2024-04-18 Thread Philippe Mathieu-Daudé
"exec/cpu-all.h" doesn't require "exec/tswap.h". Remove it, including it in the sources when required. Signed-off-by: Philippe Mathieu-Daudé --- hw/xtensa/bootparam.h | 1 + include/exec/cpu-all.h | 1 - accel/tcg/translator.c | 1 + hw/arm/boot.c

[PATCH 12/24] exec: Move CPUTLBEntry helpers to cputlb.c

2024-04-18 Thread Philippe Mathieu-Daudé
The following CPUTLBEntry helpers are only used in accel/tcg/cputlb.c: - tlb_index() - tlb_entry() - tlb_read_idx() - tlb_addr_write() Move them to this file, allowing to remove the huge "cpu.h" header inclusion from "exec/cpu_ldst.h". Signed-off-by: Philippe Mathieu

[PATCH 10/24] exec: Reduce tlb_set_dirty() declaration scope

2024-04-18 Thread Philippe Mathieu-Daudé
tlb_set_dirty() is only used in accel/tcg/cputlb.c, where it is defined. Declare it statically, removing the stub. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/exec-all.h | 1 - accel/stubs/tcg-stub.c | 4 accel/tcg/cputlb.c | 2 +- 3 files changed, 1 insertion(+), 6

[PATCH 19/24] gdbstub: Avoid including 'cpu.h' in 'gdbstub/helpers.h'

2024-04-18 Thread Philippe Mathieu-Daudé
We only need the "exec/tswap.h" and "cpu-param.h" headers. Only include "cpu.h" in the target gdbstub.c source files. Signed-off-by: Philippe Mathieu-Daudé --- include/gdbstub/helpers.h | 3 ++- target/avr/gdbstub.c | 1 + target/tricore/gdbstub.c | 1 +

[PATCH 24/24] exec: Remove unnecessary inclusions of 'hw/core/cpu.h'

2024-04-18 Thread Philippe Mathieu-Daudé
When "hw/core/cpu.h" is not required, remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h| 1 - include/exec/cpu-defs.h | 1 - include/hw/boards.h | 1 - include/hw/ppc/openpic.h | 1 - include/sysemu/hw_accel.h | 1 - 5 files changed, 5 deletion

Re: [PATCH 02/24] exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header

2024-04-18 Thread Philippe Mathieu-Daudé
On 18/4/24 21:25, Philippe Mathieu-Daudé wrote: The CPUBreakpoint and CPUWatchpoint structures are declared in "hw/core/cpu.h", which contains declarations related to CPUState and CPUClass. Some source files only require the BP/WP definitions and don't need to pull in all CPU* API

[PATCH 14/24] exec: Rename 'exec/user/guest-base.h' as 'user/guest-base.h'

2024-04-18 Thread Philippe Mathieu-Daudé
The include/user/ directory contains the user-emulation specific headers. Move guest-base.h there too. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h | 2 +- include/{exec => }/user/guest-base.h | 4 ++-- tcg/tcg.c| 2 +- 3 fi

[PATCH 20/24] hw/xtensa: Include missing 'exec/cpu-common.h' in 'bootparam.h'

2024-04-18 Thread Philippe Mathieu-Daudé
cpu_physical_memory_write() is declared in "exec/cpu-common.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/xtensa/bootparam.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xtensa/bootparam.h b/hw/xtensa/bootparam.h index ade7891ec5..f57ff850bc 100644 --- a/hw/xtensa/b

[PATCH 11/24] exec: Move tlb_reset_dirty*() declarations to 'exec/cputlb.h'

2024-04-18 Thread Philippe Mathieu-Daudé
Declare tlb_reset_dirty() and tlb_reset_dirty_range_all() in "exec/cputlb.h". Restrict tlb_reset_dirty_range_all() to TCG accel. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 12 +++- include/exec/exec-all.h | 3 --- include/exec/ram_addr.h | 1

[PATCH 09/24] physmem: Restrict TCG CPU IOTLB code to TCG accel

2024-04-18 Thread Philippe Mathieu-Daudé
Restrict iotlb_to_section(), address_space_translate_for_iotlb() and memory_region_section_get_iotlb() to TCG. Declare them in "exec/cputlb.h". Declare iotlb_to_section() using the MemoryRegionSection typedef. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputl

[PATCH 13/24] target/sparc: Replace abi_ulong by uint32_t for TARGET_ABI32

2024-04-18 Thread Philippe Mathieu-Daudé
We have abi_ulong == uint32_t for the 32-bit ABI. Use the generic type to avoid to depend on the "exec/user/abitypes.h" header. Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sparc/gdbstub.

[PATCH 07/24] exec: Un-inline tlb_vaddr_to_host() and declare it in 'exec/cputlb.h'

2024-04-18 Thread Philippe Mathieu-Daudé
Declare tlb_vaddr_to_host() in "exec/cputlb.h" with the CPU TLB API. Un-inline the user emulation definition to avoid including "exec/cpu_ldst.h" (which declares g2h) in "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- inc

[PATCH 15/24] exec: Restrict inclusion of 'user/guest-base.h'

2024-04-18 Thread Philippe Mathieu-Daudé
Declare 'have_guest_base' in "user/guest-base.h". Very few files require this header, so explicitly include it there instead of "exec/cpu-all.h" which is used in many source files. Assert this user-specific header is only included from user emulation. Signed-off-by: Ph

[PATCH 04/24] exec: Restrict TCG specific declarations of 'cputlb.h'

2024-04-18 Thread Philippe Mathieu-Daudé
Avoid TCG specific declarations being used from non-TCG accelerators. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h index 6da1462c4f..ef18642a32 100644 --- a/include/exec

[PATCH 06/24] exec: Have guest_addr_valid() methods take abi_ptr/size_t arguments

2024-04-18 Thread Philippe Mathieu-Daudé
abi_ulong is target specific, replace by abi_ptr which isn't. Use size_t for the @len type. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index

[PATCH 08/24] physmem: Move TCG CPU IOTLB methods around

2024-04-18 Thread Philippe Mathieu-Daudé
The next commit will restrict TCG specific code in physmem.c using some #ifdef'ry. In order to keep it simple, move iotlb_to_section() and memory_region_section_get_iotlb() around close together. Signed-off-by: Philippe Mathieu-Daudé --- system/physmem.c | 50

[PATCH 05/24] exec: Restrict 'cpu_ldst.h' to TCG accelerator

2024-04-18 Thread Philippe Mathieu-Daudé
"exec/cpu_ldst.h" is specific to TCG, do not allow its inclusion from other accelerators. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index

[PATCH 01/24] exec: Declare MMUAccessType type in 'mmu-access-type.h' header

2024-04-18 Thread Philippe Mathieu-Daudé
s-type.h" header. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h| 1 + include/exec/exec-all.h| 1 + include/exec/mmu-access-type.h | 18 ++ include/hw/core/cpu.h | 8 +--- 4 files changed, 21 insertions(+), 7 deletions(-) c

[PATCH 03/24] hw/core: Avoid including the full 'hw/core/cpu.h' in 'tcg-cpu-ops.h'

2024-04-18 Thread Philippe Mathieu-Daudé
Only include what is required, avoiding the full CPUState API from the huge "hw/core/cpu.h" header. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/tcg-cpu-ops.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/inclu

[PATCH 00/24] include/exec: Rework (part 2)

2024-04-18 Thread Philippe Mathieu-Daudé
446-1-phi...@linaro.org> or https://gitlab.com/philmd/qemu/-/commits/exec-next Philippe Mathieu-Daudé (24): exec: Declare MMUAccessType type in 'mmu-access-type.h' header exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header hw/core: Avoid including the full 'hw/core

[PATCH 02/24] exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header

2024-04-18 Thread Philippe Mathieu-Daudé
point.h" header. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/breakpoint.h | 23 +++ include/hw/core/cpu.h | 16 +--- target/arm/internals.h| 1 + target/ppc/internal.h | 1 + target/riscv/debug.h | 2 ++ 5 files changed, 28 inserti

Re: [PATCH 5/5] target/arm: Enable FEAT_Spec_FPACC for -cpu max

2024-04-18 Thread Philippe Mathieu-Daudé
/arm/tcg/cpu64.c| 4 2 files changed, 5 insertions(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 2/5] target/arm: Enable FEAT_CSV2_3 for -cpu max

2024-04-18 Thread Philippe Mathieu-Daudé
deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH 0/2] include: Rename some expanded headers using '.h.inc' suffix

2024-04-18 Thread Philippe Mathieu-Daudé
Per our Coding Style: If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion. Rename elf_ops.h and host/load-extract/store-insert headers. Philippe Mathieu-Daudé (2): hw/elf_ops: Rename

[PATCH 1/2] hw/elf_ops: Rename elf_ops.h -> elf_ops.h.inc

2024-04-18 Thread Philippe Mathieu-Daudé
use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion. Therefore rename "hw/elf_ops.h" as "hw/elf_ops.h.inc". Signed-off-by: Philippe Mathieu-Daudé --- include/hw/{elf_ops.h =

[PATCH 2/2] accel/tcg: Rename load-extract/store-insert headers using .h.inc suffix

2024-04-18 Thread Philippe Mathieu-Daudé
use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion. Therefore rename 'store-insert-al16.h' as 'store-insert-al16.h.inc' and 'load-extract-al16-al8.h' as 'load-extract-al16-al8.h.inc'. Signed-off-by: Ph

Re: [PATCH 0/3] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean

2024-04-18 Thread Philippe Mathieu-Daudé
On 18/4/24 12:04, Zhao Liu wrote: From: Zhao Liu --- Zhao Liu (3): hw/cxl/cxl-cdat: Make ct3_load_cdat() return boolean hw/cxl/cxl-cdat: Make ct3_build_cdat() return boolean hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean Series: Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 3/3] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean

2024-04-18 Thread Philippe Mathieu-Daudé
On 18/4/24 12:04, Zhao Liu wrote: From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. With returned boolean, there's no need to dereference @errp to check failure case. Suggested-by: Markus Armbruster Signed-off-by: Zhao

Re: [PATCH-for-9.1 v2 2/3] target/nios2: Remove the deprecated Nios II target

2024-04-18 Thread Philippe Mathieu-Daudé
On 27/3/24 15:48, Philippe Mathieu-Daudé wrote: The Nios II target is deprecated since v8.2 in commit 9997771bc1 ("target/nios2: Deprecate the Nios II architecture"). Remove: - Buildsys / CI infra - User emulation - System emulation (10m50-ghrd & nios2-generic-nommu machines) - Te

Re: [PATCH 09/21] semihosting/uaccess: Avoid including 'cpu.h'

2024-04-18 Thread Philippe Mathieu-Daudé
On 17/4/24 21:14, Richard Henderson wrote: On 4/17/24 11:27, Philippe Mathieu-Daudé wrote: "semihosting/uaccess.h" only requires declarations from "exec/cpu-defs.h". Avoid including the huge "cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by:

Re: [PATCH 13/21] accel/tcg: Un-inline retaddr helpers to 'user-retaddr.h'

2024-04-18 Thread Philippe Mathieu-Daudé
On 17/4/24 21:30, Richard Henderson wrote: On 4/17/24 11:27, Philippe Mathieu-Daudé wrote: set_helper_retaddr() is only used in accel/tcg/user-exec.c. clear_helper_retaddr() is only used in accel/tcg/user-exec.c Here should be "accel/tcg/cpu-exec.c", fixed. and accel/tcg/u

[PATCH 12/21] target/ppc/excp_helper: Avoid 'abi_ptr' in system emulation

2024-04-17 Thread Philippe Mathieu-Daudé
'abi_ptr' is a user specific type. The system emulation equivalent is 'target_ulong'. Use it in ppc_ldl_code() to emphasis this is not an user emulation function. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Nicholas Piggin Reviewed-by: Thomas Huth Message-Id: <20231211212003.21686-18-

[PATCH 11/21] exec/cpu-all: Reduce 'qemu/rcu.h' header inclusion

2024-04-17 Thread Philippe Mathieu-Daudé
"exec/cpu-all.h" doesn't need definitions from "qemu/rcu.h", however "exec/ram_addr.h" does. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20231211212003.21686-17-phi...@linaro.org> --- include/exec/cpu-all.h | 1 - in

[PATCH 21/21] exec: Declare abi_ptr type in its own 'abi_ptr.h' header

2024-04-17 Thread Philippe Mathieu-Daudé
The abi_ptr type is declared in "exec/cpu_ldst.h" with all the load/store helpers. Some source files requiring abi_ptr type don't need the load/store helpers. In order to simplify, create a new "exec/abi_ptr.h" header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richar

[PATCH 19/21] exec: Move [b]tswapl() declarations to 'exec/user/tswap-target.h'

2024-04-17 Thread Philippe Mathieu-Daudé
tswapl() and bswaptls() are target-dependent and only used by user emulation. Move their definitions to a new header: "exec/user/tswap-target.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20231212123401.37493-17-phi...@linaro.org>

[PATCH 16/21] exec/cpu-all: Remove unused 'qemu/thread.h' header

2024-04-17 Thread Philippe Mathieu-Daudé
Nothing is required from "qemu/thread.h" in "exec/cpu-all.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20231212123401.37493-13-phi...@linaro.org> --- include/exec/cpu-all.h | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH 07/21] accel: Include missing 'exec/cpu_ldst.h' header

2024-04-17 Thread Philippe Mathieu-Daudé
Theses files call cpu_ldl_code() which is declared in "exec/cpu_ldst.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20231211212003.21686-5-phi...@linaro.org> --- accel/tcg/translator.c| 1 + target/hexagon/translate.c| 1 + t

[PATCH 17/21] exec/cpu-all: Remove unused tswapls() definitions

2024-04-17 Thread Philippe Mathieu-Daudé
Last use of tswapls() was removed 2 years ago in commit aee14c77f4 ("linux-user: Rewrite do_getdents, do_getdents64"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20231212123401.37493-15-phi...@linaro.org> --- include/exec/cpu-all.h | 2 -- 1

[PATCH 20/21] exec/user: Do not include 'cpu.h' in 'abitypes.h'

2024-04-17 Thread Philippe Mathieu-Daudé
"exec/user/abitypes.h" requires: - "exec/cpu-defs.h" (TARGET_LONG_BITS) - "exec/tswap.h" (tswap32) In order to avoid "cpu.h", pick the minimum required headers. Assert this user-specific header is only included from user emulation

[PATCH 18/21] exec: Declare target_words_bigendian() in 'exec/tswap.h'

2024-04-17 Thread Philippe Mathieu-Daudé
We usually check target endianess before swapping values, so target_words_bigendian() declaration makes sense in "exec/tswap.h" with the target swapping helpers. Remove "hw/core/cpu.h" when it was only included to get the target_words_bigendian() declaration. Signed-off-

[PATCH 06/21] target: Define TCG_GUEST_DEFAULT_MO in 'cpu-param.h'

2024-04-17 Thread Philippe Mathieu-Daudé
t for TCG. By moving the TCG_GUEST_DEFAULT_MO definition to "cpu-param.h", we can simplify various accel/tcg includes. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Acked-by: Nicholas Piggin Message-Id: <20231211212003.21686-4-phi...@linaro.org> --- target/alpha/cpu-param

[PATCH 15/21] accel/tcg: Include missing 'hw/core/cpu.h' header

2024-04-17 Thread Philippe Mathieu-Daudé
tcg_cpu_init_cflags() accesses CPUState fields, so requires "hw/core/cpu.h" to get its structure definition. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20231212123401.37493-12-phi...@linaro.org> --- accel/tcg/tcg-accel-ops.c | 2 ++ 1

[PATCH 08/21] gdbstub: Include missing 'hw/core/cpu.h' header

2024-04-17 Thread Philippe Mathieu-Daudé
Functions such gdb_get_cpu_pid() dereference CPUState so require the structure declaration from "hw/core/cpu.h": static uint32_t gdb_get_cpu_pid(CPUState *cpu) { ... return cpu->cluster_index + 1; } Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Warner Los

[PATCH 14/21] target/i386: Include missing 'exec/exec-all.h' header

2024-04-17 Thread Philippe Mathieu-Daudé
The XRSTOR instruction ends calling tlb_flush(), declared in "exec/exec-all.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20231211212003.21686-13-phi...@linaro.org> --- target/i386/tcg/fpu_helper.c | 1 + 1 file changed, 1 insertio

[PATCH 09/21] semihosting/uaccess: Avoid including 'cpu.h'

2024-04-17 Thread Philippe Mathieu-Daudé
"semihosting/uaccess.h" only requires declarations from "exec/cpu-defs.h". Avoid including the huge "cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20231211212003.21686-6-phi...@linaro.org> --- include/semihosting

[PATCH 10/21] semihosting/guestfd: Remove unused 'semihosting/uaccess.h' header

2024-04-17 Thread Philippe Mathieu-Daudé
Nothing in guestfd.c requires "semihosting/uaccess.h" nor "qemu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20231212123401.37493-8-phi...@linaro.org> --- semihosting/guestfd.c | 5 + 1 file changed, 1 insertion(+),

[PATCH 13/21] accel/tcg: Un-inline retaddr helpers to 'user-retaddr.h'

2024-04-17 Thread Philippe Mathieu-Daudé
; header (restricted to accel/tcg/). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20231211212003.21686-19-phi...@linaro.org> --- accel/tcg/user-retaddr.h | 28 include/exec/cpu_ldst.h | 28 ++-- acc

[PATCH 05/21] exec: Expose 'target_page.h' API to user emulation

2024-04-17 Thread Philippe Mathieu-Daudé
User-only objects might benefit from the "exec/target_page.h" API, which allows to build some objects once for all targets. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Message-Id: <20231211212003.21686-3-phi...@linaro.org>

[PATCH 01/21] gdbstub: Simplify #ifdef'ry in helpers.h

2024-04-17 Thread Philippe Mathieu-Daudé
Slightly simplify by checking NEED_CPU_H definition in header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240322161439.6448-2-phi...@linaro.org> --- include/gdbstub/helpers.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff

[PATCH 00/21] exec/next for 9.1

2024-04-17 Thread Philippe Mathieu-Daudé
Hi, This series contains the patches I'm going to send in a pull request once the final 9.0 tag is out. Sending now since I'll post another series based on it. Also available here for convenience: https://gitlab.com/philmd/qemu/-/commits/exec-next Regards, Phil. Philippe Mathieu-Daudé (21

[PATCH 04/21] exec: Include 'cpu.h' before validating CPUArchState placement

2024-04-17 Thread Philippe Mathieu-Daudé
CPUArchState 'env' field is defined within the ArchCPU structure, so we need to include each target "cpu.h" header which defines it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Warner Losh Message-Id: <20231211212003.21686-2-phi...@linaro.org> --- include/exec/cpu-all

[PATCH 03/21] exec: Rename NEED_CPU_H -> COMPILING_PER_TARGET

2024-04-17 Thread Philippe Mathieu-Daudé
a /* COMPILING_PER_TARGET */ comment after the '#endif' when the block is large. Inspired-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240322161439.6448-4-phi...@linaro.org> --- meson.build| 4 ++-- include/exec/cpu-

[PATCH 02/21] hw/core: Remove check on NEED_CPU_H in tcg-cpu-ops.h

2024-04-17 Thread Philippe Mathieu-Daudé
Commit fd3f7d24d4 ("include/hw/core: Remove i386 conditional on fake_user_interrupt") remove the need to check on NEED_CPU_H. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240322161439.6448-3-phi...@linaro.org> --- include/hw/core/tcg-cpu-

Re: [PATCH v2 2/4] hw/i2c: Fix checkpatch line over 80 chars warnings

2024-04-17 Thread Philippe Mathieu-Daudé
On 17/4/24 08:24, Cédric Le Goater wrote: Hello, On 4/16/24 20:47, Philippe Mathieu-Daudé wrote: We are going to modify these lines, fix their style in order to avoid checkpatch.pl warnings:    WARNING: line over 80 characters Signed-off-by: Philippe Mathieu-Daudé ---   include/hw/i2c/i2c.h

Re: [PATCH v2] migration/colo: Fix bdrv_graph_rdlock_main_loop: Assertion `!qemu_in_coroutine()' failed.

2024-04-17 Thread Philippe Mathieu-Daudé
On 17/4/24 08:47, Zhang, Chen wrote: -Original Message- From: Philippe Mathieu-Daudé Sent: Wednesday, April 17, 2024 2:14 PM To: Li Zhijian ; Zhang, Hailiang ; pet...@redhat.com; faro...@suse.de Cc: qemu-devel@nongnu.org; Zhang, Chen ; Wen Congyang ; Xie Changlong Subject: Re

Re: [PATCH v2] migration/colo: Fix bdrv_graph_rdlock_main_loop: Assertion `!qemu_in_coroutine()' failed.

2024-04-17 Thread Philippe Mathieu-Daudé
On 17/4/24 04:56, Li Zhijian via wrote: bdrv_activate_all() should not be called from the coroutine context, move it to the QEMU thread colo_process_incoming_thread() with the bql_lock protected. The backtrace is as follows: #4 0x561af7948362 in bdrv_graph_rdlock_main_loop () at

  1   2   3   4   5   6   7   8   9   10   >