Re: [RFC PATCH 14/34] exec: [CPUTLB] Move PAGE_* macros to common header

2024-01-26 Thread Richard Henderson
On 1/24/24 09:54, Richard Henderson wrote: On 1/20/24 00:40, Anton Johansson wrote: These don't vary across targets and are used in soon-to-be common code (cputlb.c). Signed-off-by: Anton Johansson ---   include/exec/cpu-all.h    | 24   include/exec/cpu-common.h | 30

Re: [PATCH v2] cpu-exec: simplify jump cache management

2024-01-26 Thread Richard Henderson
On 1/23/24 07:57, Richard Henderson wrote: On 1/23/24 01:34, Paolo Bonzini wrote: Unless I'm missing something egregious, the jmp cache is only every populated with a valid entry by the same thread that reads the cache. Therefore, the contents of any valid entry are always consistent and there

Re: [PATCH 00/10] Clean up includes

2024-01-26 Thread Michael Tokarev
25.01.2024 19:33, Peter Maydell : This series makes a bunch of automated edits with the clean-includes script. The script performs three related cleanups: * Ensure .c files include qemu/osdep.h first. * Including it in a .h is redundant, since the .c already includes it. Drop such

Re: [PATCH 05/10] acpi: Clean up includes

2024-01-26 Thread Richard Henderson
On 1/26/24 02:34, Peter Maydell wrote: This commit was created with scripts/clean-includes: ./scripts/clean-includes --git acpi include/hw/*/*acpi.h hw/*/*acpi.c All .c should include qemu/osdep.h first. The script performs three related cleanups: * Ensure .c files include qemu/osdep.h

Re: [PATCH 04/10] aspeed: Clean up includes

2024-01-26 Thread Richard Henderson
On 1/26/24 02:34, Peter Maydell wrote: This commit was created with scripts/clean-includes. All .c should include qemu/osdep.h first. The script performs three related cleanups: * Ensure .c files include qemu/osdep.h first. * Including it in a .h is redundant, since the .c already includes

Re: [PATCH 03/10] disas/riscv: Clean up includes

2024-01-26 Thread Richard Henderson
On 1/26/24 02:34, Peter Maydell wrote: This commit was created with scripts/clean-includes: ./scripts/clean-includes --git disas/riscv disas/riscv*[ch] All .c should include qemu/osdep.h first. The script performs three related cleanups: * Ensure .c files include qemu/osdep.h first. *

Re: [PATCH 02/10] hyperv: Clean up includes

2024-01-26 Thread Richard Henderson
On 1/26/24 02:34, Peter Maydell wrote: This commit was created with scripts/clean-includes: ./scripts/clean-includes --git hyperv hw/hyperv/*.[ch] All .c should include qemu/osdep.h first. The script performs three related cleanups: * Ensure .c files include qemu/osdep.h first. * Including

Re: [PATCH v2 02/23] scripts/coccinelle: Add cpu_env.cocci_template script

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Add a Coccinelle script to convert the following slow path (due to the QOM cast macro): _CPU(..)->env to the following fast path: cpu_env(..) Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 +

Re: [PATCH v2 23/23] target/sparc: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:04, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.c | 14 -- target/sparc/gdbstub.c | 3 +--

Re: [PATCH v2 22/23] target/xtensa: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:04, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/xtensa/dbg_helper.c | 3 +-- target/xtensa/exc_helper.c | 3 +--

Re: [PATCH v2 21/23] target/tricore: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:04, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/tricore/cpu.c | 20 target/tricore/gdbstub.c | 6 ++

Re: [PATCH v2 20/23] target/sh4: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:04, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/sh4/cpu.c | 15 +-- target/sh4/gdbstub.c | 6 ++

Re: [PATCH v2 19/23] target/s390x: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:04, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/s390x/cpu-dump.c| 3 +-- target/s390x/gdbstub.c | 6 ++

Re: [PATCH v2 18/23] target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:04, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/rx/gdbstub.c | 6 ++ target/rx/helper.c| 6 ++ target/rx/translate.c |

Re: [PATCH v2 17/23] target/riscv: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/arch_dump.c | 6 ++ target/riscv/cpu.c | 17 +

Re: [PATCH v2 16/23] target/ppc: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/mpc8544_guts.c | 3 +-- hw/ppc/pnv.c | 3 +--

Re: [PATCH v2 15/23] target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/openrisc/gdbstub.c | 3 +-- target/openrisc/interrupt.c | 6 ++

Re: [PATCH v2 14/23] target/nios2: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/cpu.c| 15 +++ target/nios2/helper.c | 3 +--

Re: [PATCH v2 13/23] target/mips: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.c | 11 +++--- target/mips/gdbstub.c

Re: [PATCH v2 12/23] target/microblaze: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/helper.c| 3 +-- target/microblaze/translate.c | 3 +-- 2 files

Re: [PATCH v2 11/23] target/m68k: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/m68k/cpu.c | 30 ++ target/m68k/gdbstub.c | 6

Re: [PATCH v2 10/23] target/i386: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hvf/vmx.h | 13 +++--- hw/i386/vmmouse.c |

Re: [PATCH v2 09/23] target/i386/hvf: Use CPUState typedef

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: QEMU coding style recommend using structure typedefs: https://www.qemu.org/docs/master/devel/style.html#typedefs Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hvf/x86.h | 26 +- target/i386/hvf/x86_descr.h

Re: [PATCH v2 08/23] target/hppa: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/hppa/cpu.c| 8 ++-- target/hppa/int_helper.c | 8 ++--

Re: [PATCH v2 07/23] target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/cris/cpu.c | 5 + target/cris/gdbstub.c | 9 +++--

Re: [PATCH v2 06/23] target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/avr/cpu.c | 27 +++ target/avr/gdbstub.c | 6 ++

Re: [PATCH v2 05/23] target/arm: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/arm_gicv3_cpuif_common.c | 5 + target/arm/cpu.c | 19

Re: [PATCH v2 04/23] target/alpha: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.c| 31 +++ target/alpha/gdbstub.c|

Re: [PATCH v2 03/23] bulk: Call in place single use cpu_env()

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: Avoid CPUArchState local variable when cpu_env() is used once. Mechanical patch using the following Coccinelle spatch script: @@ type CPUArchState; identifier env; expression cs; @@ { -CPUArchState *env = cpu_env(cs);

Re: [PATCH v2 01/23] hw/acpi/cpu: Use CPUState typedef

2024-01-26 Thread Richard Henderson
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote: QEMU coding style recommend using structure typedefs: https://www.qemu.org/docs/master/devel/style.html#typedefs Signed-off-by: Philippe Mathieu-Daudé --- include/hw/acpi/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH] target/arm: Reinstate "vfp" property on AArch32 CPUs

2024-01-26 Thread Richard Henderson
On 1/27/24 05:34, Peter Maydell wrote: In commit 4315f7c614743 we restructured the logic for creating the VFP related properties to avoid testing the aa32_simd_r32 feature on AArch64 CPUs. However in the process we accidentally stopped exposing the "vfp" QOM property on AArch32 TCG CPUs. This

Re: [PATCH] {linux,bsd}-user: Fail mmap() if size doesn't fit into host's size_t

2024-01-26 Thread Richard Henderson
On 1/26/24 06:07, Ilya Leoshkevich wrote: s390x's branch-relative-long test fails with the following error message on 32-bit hosts: qemu-s390x: ../accel/tcg/user-exec.c:493: page_set_flags: Assertion `last <= GUEST_ADDR_MAX' failed. The root cause is that the size passed to mmap() by

Re: [PATCH 0/2] Enable -Wvla, forbidding use of variable length arrays

2024-01-26 Thread Richard Henderson
On 1/26/24 03:32, Peter Maydell wrote: Peter Maydell (2): tests/qtest/xlnx-versal-trng-test.c: Drop use of variable length array meson: Enable -Wvla Reviewed-by: Richard Henderson r~

Re: [PATCH] target/arm: Add ID_AA64ZFR0_EL1.B16B16 to the exposed-to-userspace set

2024-01-26 Thread Richard Henderson
On 1/25/24 23:43, Peter Maydell wrote: In kernel commit 5d5b4e8c2d9ec ("arm64/sve: Report FEAT_SVE_B16B16 to userspace") Linux added ID_AA64ZFR0_el1.B16B16 to the set of ID register fields which it exposes to userspace. Update our exported_bits mask to include this. (This doesn't yet change

Re: [PATCH v2 1/2] target/s390x: Emulate CVDG

2024-01-26 Thread Richard Henderson
On 1/25/24 22:29, Ilya Leoshkevich wrote: CVDG is the same as CVD, except that it converts 64 bits into 128, rather than 32 into 64. Create a new helper, which uses Int128 wrappers. Reported-by: Ido Plat Signed-off-by: Ilya Leoshkevich --- target/s390x/helper.h| 1 +

Re: [PATCH v6 0/4] accel/tcg: Move perf and debuginfo support to tcg

2024-01-26 Thread Richard Henderson
On 1/25/24 15:46, Philippe Mathieu-Daudé wrote: Since v5: - Use v4 instead of v3... - Rebased on commit 53e8868d69 ("meson: remove OS definitions from config_targetos") Ilya Leoshkevich (4): accel/tcg: Make use of qemu_target_page_mask() in perf.c tcg: Make tb_cflags() usable from

Re: hexagon: modeling a shared lock state

2024-01-26 Thread Richard Henderson
On 1/26/24 02:28, Brian Cain wrote: static void do_hwlock(CPUHexagonState *env, bool *lock) { bql_lock(); if (*lock) { env->hwlock_pending = true; cs->halted = true; cs->exception_index = EXCP_HALTED; bql_unlock(); cpu_loop_exit(cs);

Re: [PULL 00/17] aspeed queue

2024-01-26 Thread Ninad Palsule
' of https://repo.or.cz/qemu/armbru into staging (2024-01-26 10:21:27 +) are available in the Git repository at:    https://github.com/legoater/qemu/ tags/pull-aspeed-20240126 for you to fetch changes up to b40769f4b49d15485ffaaa7acade3e3593ee6daa:    hw/fsi: Update MAINTAINER list (2024-01-26

[PATCH 2/5] migration/multifd: Move multifd_socket_ops to socket.c

2024-01-26 Thread Fabiano Rosas
Code movement only. Signed-off-by: Fabiano Rosas --- migration/multifd.c | 59 --- migration/multifd.h | 2 ++ migration/socket.c | 61 - 3 files changed, 62 insertions(+), 60 deletions(-) diff --git

[PATCH 5/5] migration/multifd: Move zero copy flag into multifd_socket_setup

2024-01-26 Thread Fabiano Rosas
The generic multifd save setup code should not be responsible for deciding how the client code is going to send the data. Since the zero copy feature is supported only by the socket migration, move the setting of the flag into the socket specific function. Signed-off-by: Fabiano Rosas ---

[PATCH 3/5] migration/multifd: Add multifd_ops->send

2024-01-26 Thread Fabiano Rosas
The zero page feature is not supported by the compression methods. It is exclusive to the socket migration. Add a 'send' hook so we can move that complexity into a multifd_socket_send() function. Signed-off-by: Fabiano Rosas --- migration/multifd-zlib.c | 10 ++ migration/multifd-zstd.c

[PATCH 0/5] migration/multifd: Prerequisite cleanups for ongoing work

2024-01-26 Thread Fabiano Rosas
Hi, Here are two cleanups that are prerequiste for the fixed-ram work, but also affect the other series on the list at the moment, so I want to make sure it works for everyone: 1) Separate multifd_ops from compression. The multifd_ops are currently coupled with the multifd_compression

[PATCH 4/5] migration/multifd: Simplify zero copy send

2024-01-26 Thread Fabiano Rosas
During the multifd send phase, the multifd packet header is included as the first element of the iovec, except in the special case of a socket migration with zero copy enabled. In that case the packet header is sent separately. To avoid the first position of the iovec being empty, we play with the

[PATCH 1/5] migration/multifd: Separate compression ops from non-compression

2024-01-26 Thread Fabiano Rosas
For multifd we currently choose exclusively between migration using compression or migration without compression. The compression method is chosen via the multifd_compression parameter (none, zlib, zstd). We've been using the 'none' value to mean the regular socket migration. Rename the

[PATCH v2 21/23] target/tricore: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/tricore/cpu.c | 20 target/tricore/gdbstub.c | 6 ++ target/tricore/helper.c| 3 +--

[PATCH v2 03/23] bulk: Call in place single use cpu_env()

2024-01-26 Thread Philippe Mathieu-Daudé
Avoid CPUArchState local variable when cpu_env() is used once. Mechanical patch using the following Coccinelle spatch script: @@ type CPUArchState; identifier env; expression cs; @@ { -CPUArchState *env = cpu_env(cs); ... when != env - env + cpu_env(cs) ... when

[PATCH v2 20/23] target/sh4: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/sh4/cpu.c | 15 +-- target/sh4/gdbstub.c | 6 ++ target/sh4/helper.c| 11 +++

[PATCH v2 16/23] target/ppc: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/mpc8544_guts.c | 3 +-- hw/ppc/pnv.c | 3 +-- hw/ppc/pnv_xscom.c| 5 + hw/ppc/ppce500_spin.c

[PATCH v2 04/23] target/alpha: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.c| 31 +++ target/alpha/gdbstub.c| 6 ++ target/alpha/helper.c | 12

[PATCH v2 23/23] target/sparc: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.c | 14 -- target/sparc/gdbstub.c | 3 +-- target/sparc/int32_helper.c | 3 +--

[PATCH v2 22/23] target/xtensa: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/xtensa/dbg_helper.c | 3 +-- target/xtensa/exc_helper.c | 3 +-- target/xtensa/gdbstub.c| 6 ++ target/xtensa/helper.c | 9

[PATCH v2 10/23] target/i386: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hvf/vmx.h | 13 +++--- hw/i386/vmmouse.c | 6 ++--- hw/i386/xen/xen-hvm.c | 3

[PATCH v2 07/23] target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/cris/cpu.c | 5 + target/cris/gdbstub.c | 9 +++-- target/cris/helper.c| 12 target/cris/translate.c

[PATCH v2 13/23] target/mips: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.c | 11 +++--- target/mips/gdbstub.c | 6 ++ target/mips/kvm.c

[PATCH v2 12/23] target/microblaze: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/helper.c| 3 +-- target/microblaze/translate.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git

[PATCH v2 14/23] target/nios2: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/cpu.c| 15 +++ target/nios2/helper.c | 3 +-- target/nios2/nios2-semi.c | 6 ++ 3 files changed, 6

[PATCH v2 15/23] target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/openrisc/gdbstub.c | 3 +-- target/openrisc/interrupt.c | 6 ++ target/openrisc/translate.c | 3 +-- 3 files changed, 4

[PATCH v2 08/23] target/hppa: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/hppa/cpu.c| 8 ++-- target/hppa/int_helper.c | 8 ++-- target/hppa/mem_helper.c | 3 +-- 3 files changed, 5

[PATCH v2 19/23] target/s390x: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/s390x/cpu-dump.c| 3 +-- target/s390x/gdbstub.c | 6 ++ target/s390x/helper.c | 3 +--

[PATCH v2 18/23] target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/rx/gdbstub.c | 6 ++ target/rx/helper.c| 6 ++ target/rx/translate.c | 3 +-- 3 files changed, 5 insertions(+), 10

[PATCH v2 17/23] target/riscv: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/arch_dump.c | 6 ++ target/riscv/cpu.c | 17 + target/riscv/cpu_helper.c | 14 --

[PATCH v2 06/23] target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/avr/cpu.c | 27 +++ target/avr/gdbstub.c | 6 ++ target/avr/helper.c | 10 +++--- 3 files changed,

[PATCH v2 11/23] target/m68k: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- target/m68k/cpu.c | 30 ++ target/m68k/gdbstub.c | 6 ++ target/m68k/helper.c| 3 +--

[PATCH v2 09/23] target/i386/hvf: Use CPUState typedef

2024-01-26 Thread Philippe Mathieu-Daudé
QEMU coding style recommend using structure typedefs: https://www.qemu.org/docs/master/devel/style.html#typedefs Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hvf/x86.h | 26 +- target/i386/hvf/x86_descr.h | 14 +++--- target/i386/hvf/x86_emu.h |

[PATCH v2 05/23] target/arm: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/arm_gicv3_cpuif_common.c | 5 + target/arm/cpu.c | 19 +-- target/arm/debug_helper.c| 8

[PATCH v2 02/23] scripts/coccinelle: Add cpu_env.cocci_template script

2024-01-26 Thread Philippe Mathieu-Daudé
Add a Coccinelle script to convert the following slow path (due to the QOM cast macro): _CPU(..)->env to the following fast path: cpu_env(..) Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + scripts/coccinelle/cpu_env.cocci_template | 92

[PATCH v2 01/23] hw/acpi/cpu: Use CPUState typedef

2024-01-26 Thread Philippe Mathieu-Daudé
QEMU coding style recommend using structure typedefs: https://www.qemu.org/docs/master/devel/style.html#typedefs Signed-off-by: Philippe Mathieu-Daudé --- include/hw/acpi/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h

[PATCH v2 00/23] hw, target: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
Use cpu_env() -- which is fast path -- when possible. Bulk conversion using Coccinelle spatch (script included). Since v1: - Avoid CPU() cast (Paolo) - Split per targets (Thomas) Philippe Mathieu-Daudé (23): hw/acpi/cpu: Use CPUState typedef scripts/coccinelle: Add cpu_env.cocci_template

Re: Re: [PATCH v4 4/4] hw/misc/pvpanic: add support for normal shutdowns

2024-01-26 Thread Thomas Weißschuh
Hi Alejandro, On 2024-01-26 13:47:33-0500, Alejandro Jimenez wrote: > On 1/7/24 09:05, Thomas Weißschuh wrote: > > Shutdown requests are normally hardware dependent. > > By extending pvpanic to also handle shutdown requests, guests can > > submit such requests with an easily implementable and

Re: [PATCH 2/2] bulk: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-26 Thread Philippe Mathieu-Daudé
On 26/1/24 18:09, Thomas Huth wrote: On 25/01/2024 17.56, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé ---   114 files changed, 273 insertions(+), 548

Re: spapr watchdog vs watchdog_perform_action() / QMP watchdog-set-action

2024-01-26 Thread Markus Armbruster
Peter Maydell writes: > Hi; one of the "bitesized tasks" we have listed is to convert > watchdog timers which directly call qemu_system_reset_request() on > watchdog timeout to call watchdog_perform_action() instead. This > means they honour the QMP commands that let the user specifiy > the

[PATCH 1/3] hw/display : Add device DM163

2024-01-26 Thread Inès Varhol
This device implements the IM120417002 colors shield v1.1 for Arduino (which relies on the DM163 8x3-channel led driving logic) and features a simple display of an 8x8 RGB matrix. The columns of the matrix are driven by the DM163 and the rows are driven externally. Signed-off-by: Arnaud Minier

[PATCH 3/3] tests/qtest : Add testcase for DM163

2024-01-26 Thread Inès Varhol
`test_dm163_bank()` Checks that the pin "sout" of the DM163 led driver outputs the values received on pin "sin" with the expected latency (depending on the bank). `test_dm163_gpio_connection()` Check that changes to relevant STM32L4x5 GPIO pins are prpagated to the DM163 device. Signed-off-by:

[PATCH 0/3] Add device DM163 (led driver, matrix colors shield & display)

2024-01-26 Thread Inès Varhol
This device implements the IM120417002 colors shield v1.1 for Arduino (which relies on the DM163 8x3-channel led driving logic) and features a simple display of an 8x8 RGB matrix. This color shield can be plugged on the Arduino board (or the B-L475E-IOT01A board) to drive an 8x8 RGB led matrix.

[PATCH 2/3] hw/arm : Connect DM163 to STM32L4x5

2024-01-26 Thread Inès Varhol
Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/arm/Kconfig | 1 + hw/arm/stm32l4x5_soc.c | 55 +- include/hw/arm/stm32l4x5_soc.h | 3 ++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/hw/arm/Kconfig

[PATCH] target/arm: Reinstate "vfp" property on AArch32 CPUs

2024-01-26 Thread Peter Maydell
In commit 4315f7c614743 we restructured the logic for creating the VFP related properties to avoid testing the aa32_simd_r32 feature on AArch64 CPUs. However in the process we accidentally stopped exposing the "vfp" QOM property on AArch32 TCG CPUs. This mostly hasn't had any ill effects because

Re: [PATCH v4 4/4] hw/misc/pvpanic: add support for normal shutdowns

2024-01-26 Thread Alejandro Jimenez
Hi Thomas, On 1/7/24 09:05, Thomas Weißschuh wrote: Shutdown requests are normally hardware dependent. By extending pvpanic to also handle shutdown requests, guests can submit such requests with an easily implementable and cross-platform mechanism. Signed-off-by: Thomas Weißschuh ---

Re: [PATCH v1 2/3] virtio-gpu.c: add resource_destroy class method

2024-01-26 Thread Manos Pitsidianakis
On Fri, 26 Jan 2024 at 17:22, Philippe Mathieu-Daudé wrote: > > Hi Manos, > > On 26/1/24 15:41, Manos Pitsidianakis wrote: > > When destroying/unrefing resources, devices such as virtio-gpu-rutabaga > > need to do their own bookkeeping (free rutabaga resources that are > > associated with the

Re: [PATCH 0/2] accel/kvm: Sanitize KVM_HAVE_MCE_INJECTION definition

2024-01-26 Thread Paolo Bonzini
On Wed, Jan 24, 2024 at 4:54 PM Philippe Mathieu-Daudé wrote: > > Trivial replacement of KVM_HAVE_MCE_INJECTION by > KVM_ARCH_HAVE_MCE_INJECTION (not the "ARCH_" difference). I am confused, why can't you just rename the symbol and instead you go through this change? Paolo > Philippe

Re: [PULL 00/15] Migration 20240126 patches

2024-01-26 Thread Peter Maydell
lable in the Git repository at: > > https://gitlab.com/peterx/qemu.git tags/migration-20240126-pull-request > > for you to fetch changes up to 24b0c2ec956ca225282f81470f7c26f5bb844885: > > Make 'uri' optiona

Re: [PATCH v1 2/3] virtio-gpu.c: add resource_destroy class method

2024-01-26 Thread Manos Pitsidianakis
On Fri, 26 Jan 2024 at 20:09, Alex Bennée wrote: > > Manos Pitsidianakis writes: > > > When destroying/unrefing resources, devices such as virtio-gpu-rutabaga > > need to do their own bookkeeping (free rutabaga resources that are > > associated with the virtio_gpu_simple_resource). > > > > This

Re: [PATCH v1 2/3] virtio-gpu.c: add resource_destroy class method

2024-01-26 Thread Alex Bennée
Manos Pitsidianakis writes: > When destroying/unrefing resources, devices such as virtio-gpu-rutabaga > need to do their own bookkeeping (free rutabaga resources that are > associated with the virtio_gpu_simple_resource). > > This commit adds a class method so that virtio-gpu-rutabaga can

Re: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER and VIRTIO_F_NOTIFICATION_DATA feature

2024-01-26 Thread Eugenio Perez Martin
On Fri, Jan 26, 2024 at 9:59 AM Wentao Jia wrote: > > Hi, Eugenio > > Thanks for you comments, Our team has made new change about the patch, > these features in hw/virtio/virtio.h:DEFINE_VIRTIO_COMMON_FEATURES, > they are turned off by default , and can be turned on from at qemu command > line >

[PATCH v4 28/47] hw/arm/npcm7xx: use qemu_configure_nic_device, allow emc0/emc1 as aliases

2024-01-26 Thread David Woodhouse
From: David Woodhouse Also update the test to specify which device to attach the test socket to, and remove the comment lamenting the fact that we can't do so. Signed-off-by: David Woodhouse --- hw/arm/npcm7xx.c | 16 +--- tests/qtest/npcm7xx_emc-test.c | 18

[PATCH v4 43/47] hw/xtensa/xtfpga: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/xtensa/xtfpga.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index fbad1c83a3..f49e6591dc 100644 --- a/hw/xtensa/xtfpga.c +++

[PATCH v4 13/47] hw/mips/malta: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse The Malta board setup code would previously place the first NIC into PCI slot 11 if was a PCNet card, and the rest (including the first if it was anything other than a PCNet card) would be dynamically assigned. Now it will place any PCNet NIC into slot 11, and then

[PATCH v4 14/47] hw/mips/loongson3_virt: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/mips/loongson3_virt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 33eae01eca..caedde2df0 100644 ---

[PATCH v4 01/47] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Most code which directly accesses nd_table[] and nb_nics uses them for one of two things. Either "I have created a NIC device and I'd like a configuration for it", or "I will create a NIC device *if* there is a configuration for it". With some variants on the theme around

[PATCH v4 46/47] net: remove qemu_show_nic_models(), qemu_find_nic_model()

2024-01-26 Thread David Woodhouse
From: David Woodhouse These old functions can be removed now too. Let net_param_nic() print the full set of network devices directly, and also make it note that a list more specific to this platform/config will be available by using '-nic model=help' instead. Signed-off-by: David Woodhouse ---

[PATCH v4 39/47] hw/openrisc/openrisc_sim: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/openrisc/openrisc_sim.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index 35da123aef..bffd6f721f 100644 ---

[PATCH v4 18/47] hw/sh4/r2d: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Previously, the first PCI NIC would be assigned to slot 2 even if the user override the model and made it something other than an rtl8139 which is the default. Everything else would be dynamically assigned. Now, the first rtl8139 gets slot 2 and everything else is dynamic.

[PATCH v4 45/47] hw/pci: remove pci_nic_init_nofail()

2024-01-26 Thread David Woodhouse
From: David Woodhouse This function is no longer used, as all its callers have been converted to use pci_init_nic_devices() instead. Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/pci/pci.c | 72 include/hw/pci/pci.h | 3

[PATCH v4 06/47] hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs

2024-01-26 Thread David Woodhouse
From: David Woodhouse When instantiating XenBus itself, for each NIC which is configured with either the model unspecified, or set to to "xen" or "xen-net-device", create a corresponding xen-net-device for it. Now we can revert the previous more hackish version which relied on the platform code

[PATCH v4 17/47] hw/ppc: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/ppc/e500.c | 4 +--- hw/ppc/mac_newworld.c | 4 +--- hw/ppc/mac_oldworld.c | 4 +--- hw/ppc/ppc440_bamboo.c | 14 +- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git

[PATCH v4 23/47] hw/arm/exynos4: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/arm/exynos4_boards.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index b0e13eb4f0..003992189b 100644 ---

[PATCH v4 24/47] hw/arm/fsl: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/arm/fsl-imx25.c | 2 +- hw/arm/fsl-imx6.c | 2 +- hw/arm/fsl-imx6ul.c | 2 +- hw/arm/fsl-imx7.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/arm/fsl-imx25.c

[PATCH v4 07/47] hw/alpha/dp264: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/alpha/dp264.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 03495e1e60..52a1fa310b 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@

[PATCH v4 41/47] hw/s390x/s390-virtio-ccw: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Acked-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index c99682b07d..62804cc228 100644 ---

[PATCH v4 30/47] hw/arm: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/arm/mps2-tz.c | 8 ++-- hw/arm/msf2-soc.c| 6 +- hw/arm/musicpal.c| 3 +-- hw/arm/xilinx_zynq.c | 11 --- hw/arm/xlnx-versal.c | 7 +-- hw/arm/xlnx-zynqmp.c | 8 +--- 6 files changed, 10

[PATCH v4 25/47] hw/net/smc91c111: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Some callers instantiate the device unconditionally, others will do so only if there is a NICInfo to go with it. This appears to be fairly random, but preserve the existing behaviour of each caller for now. Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth ---

  1   2   3   4   >