[PATCH 1/2] hw/smbios: Fix OEM strings table option validation

2024-01-27 Thread Akihiko Odaki
qemu_smbios_type11_opts did not the list terminator and that resulted in out-of-bound memory access. qemu_smbios_type11_opts also needs to have an element for the type option. Fixes: 2d6dcbf93fb0 ("smbios: support setting OEM strings table") Signed-off-by: Akihiko Odaki --- hw/smbios/smbios.c |

[PATCH 2/2] hw/smbios: Fix port connector option validation

2024-01-27 Thread Akihiko Odaki
qemu_smbios_type8_opts did not the list terminator and that resulted in out-of-bound memory access. qemu_smbios_type8_opts also needs to have an element for the type option. Fixes: fd8caa253c56 ("hw/smbios: support for type 8 (port connector)") Signed-off-by: Akihiko Odaki ---

[PATCH 0/2] hw/smbios: Fix option validation

2024-01-27 Thread Akihiko Odaki
This fixes qemu_smbios_type8_opts and qemu_smbios_type11_opts to have list terminators and elements for the type option. Signed-off-by: Akihiko Odaki --- Akihiko Odaki (2): hw/smbios: Fix OEM strings table option validation hw/smbios: Fix port connector option validation

Re: [PATCH 00/22] target/sparc: floating-point cleanup

2024-01-27 Thread Richard Henderson
On 11/4/23 03:38, Richard Henderson wrote: Major changes: (1) Get rid of the env->qt[01] temporaries and use TCGv_i128 for float128. (2) Perform ieee exception check within the helpers, before any writeback to the floating point registers. (3) Split env->fsr into pieces to simplify update,

Re: [PATCH v2] target/arm: fix exception syndrome for AArch32 bkpt insn

2024-01-27 Thread Michael Tokarev
On 27.01.2024 23:27, Jan Klötzke wrote: Debug exceptions that target AArch32 Hyp mode are reported differently than on AAarch64. Internally, Qemu uses the AArch64 syndromes. Therefore such exceptions need to be either converted to a prefetch abort (breakpoints, vector catch) or a data abort

Re: [PATCH 00/33] tcg patch queue, pre-pull

2024-01-27 Thread Richard Henderson
On 1/28/24 14:41, Richard Henderson wrote: target: Uninline cpu_mmu_index() target: Uninline cpu_get_tb_cpu_state() Dropping these two for now. The cpu_get_tb_cpu_state patch fails s390x --disable-tcg. Both changes will be re-worked to introduce TCGCPUOps hooks immediately. r~

[PATCH 17/33] target: Make qemu_target_page_mask() available for *-user

2024-01-27 Thread Richard Henderson
From: Ilya Leoshkevich Currently qemu_target_page_mask() is usable only from the softmmu code. Make it possible to use it from the *-user code as well. Signed-off-by: Ilya Leoshkevich Message-ID: <20231208003754.3688038-2-...@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daudé Message-Id:

[PATCH 08/33] target: Uninline cpu_get_tb_cpu_state()

2024-01-27 Thread Richard Henderson
From: Anton Johansson Required to compile accel/tcg/translate-all.c once for softmmu targets. The function gets quite big for some targets so uninlining makes sense. Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-14-a...@rev.ng> Reviewed-by: Richard Henderson Signed-off-by:

[PATCH 32/33] accel/tcg: Introduce TCGCPUOps::cpu_exec_halt() handler

2024-01-27 Thread Richard Henderson
From: Philippe Mathieu-Daudé In order to make accel/tcg/ target agnostic, introduce the cpu_exec_halt() handler. Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240124101639.30056-9-phi...@linaro.org> Signed-off-by: Richard

Re: [PATCH v2] hw/arm: add PCIe to Freescale i.MX6

2024-01-27 Thread Guenter Roeck
On Sat, Jan 27, 2024 at 11:11:58AM -0800, Guenter Roeck wrote: > Hi, > > On Mon, Jan 08, 2024 at 02:03:25PM +, Nikita Ostrenkov wrote: > > Signed-off-by: Nikita Ostrenkov > > --- > > This patch, with the "sabrelite" emulation and the Linux upstream kernel > (v6.8-rc1, using

[PATCH 09/33] include/exec: Move PAGE_* macros to common header

2024-01-27 Thread Richard Henderson
From: Anton Johansson These don't vary across targets and are used in soon-to-be common code (cputlb.c). Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-15-a...@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/exec/cpu-all.h| 24

[PATCH 22/33] accel/tcg: Rename tcg_ss[] -> tcg_specific_ss[] in meson

2024-01-27 Thread Richard Henderson
From: Philippe Mathieu-Daudé tcg_ss[] source set contains target-specific units. Rename it as 'tcg_specific_ss[]' for clarity. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20240124101639.30056-2-phi...@linaro.org>

[PATCH 30/33] target/i386: Extract x86_need_replay_interrupt() from accel/tcg/

2024-01-27 Thread Richard Henderson
From: Philippe Mathieu-Daudé Move this x86-specific code out of the generic accel/tcg/. Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Reviewed-by: Pavel Dovgalyuk Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240124101639.30056-8-phi...@linaro.org> Signed-off-by:

[PATCH 31/33] accel/tcg: Inline need_replay_interrupt

2024-01-27 Thread Richard Henderson
The function is now trivial, and with inlining we can re-use the calling function's tcg_ops variable. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c

[PATCH 02/33] include/exec: Move vaddr defines to separate file

2024-01-27 Thread Richard Henderson
From: Anton Johansson Needed to work around circular includes. vaddr is currently defined in cpu-common.h and needed by hw/core/cpu.h, but cpu-common.h also need cpu.h to know the size of the CPUState. [Maybe we can instead move parts of cpu-common.h w. hw/core/cpu.h to sort out the circular

[PATCH 01/33] cpu-exec: simplify jump cache management

2024-01-27 Thread Richard Henderson
From: Paolo Bonzini 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 is no need for any acquire/release magic. Indeed ->tb has to

[PATCH 23/33] accel/tcg: Rename tcg_cpus_destroy() -> tcg_cpu_destroy()

2024-01-27 Thread Richard Henderson
From: Philippe Mathieu-Daudé tcg_cpus_destroy() operates on a single vCPU, rename it as 'tcg_cpu_destroy'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20240124101639.30056-3-phi...@linaro.org> Signed-off-by: Richard Henderson

[PATCH 20/33] accel/tcg: Remove #ifdef TARGET_I386 from perf.c

2024-01-27 Thread Richard Henderson
From: Ilya Leoshkevich Preparation for moving perf.c to tcg/. This affects only profiling guest code, which has code in a non-0 based segment, e.g., 16-bit code, which is not particularly important. Suggested-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Reviewed-by: Alex Bennée

[PATCH 28/33] accel/tcg: Use CPUState.cc instead of CPU_GET_CLASS in cpu-exec.c

2024-01-27 Thread Richard Henderson
CPU_GET_CLASS does runtime type checking; use the cached copy of the class instead. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 109 ++- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/accel/tcg/cpu-exec.c

[PATCH 33/33] target/i386: Extract x86_cpu_exec_halt() from accel/tcg/

2024-01-27 Thread Richard Henderson
From: Philippe Mathieu-Daudé Move this x86-specific code out of the generic accel/tcg/. Reported-by: Anton Johansson Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240124101639.30056-10-phi...@linaro.org> Signed-off-by:

[PATCH 03/33] hw/core: Include vaddr.h from cpu.h

2024-01-27 Thread Richard Henderson
From: Anton Johansson cpu-common.h is only needed for vaddr Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-8-a...@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 12/33] include/hw/core: Remove i386 conditional on fake_user_interrupt

2024-01-27 Thread Richard Henderson
From: Anton Johansson Always include fake_user_interrupt in user-only build, despite only being used for i386. This will enable cpu-exec.c to be compiled only once. Signed-off-by: Anton Johansson Message-ID: <20240119144024.14289-18-a...@rev.ng> [rth: Split out of a larger patch; remove

[PATCH 11/33] include/hw/core: Move do_interrupt in TCGCPUOps

2024-01-27 Thread Richard Henderson
From: Anton Johansson The ifdef out of which it is moved is not quite right: do_interrupt is only needed for system mode. Move it to the top of a different ifdef block, which preserves its position within the structure for that case. Signed-off-by: Anton Johansson Message-Id:

[PATCH 07/33] target: Uninline cpu_mmu_index()

2024-01-27 Thread Richard Henderson
From: Anton Johansson Uninlines the target-defined cpu_mmu_index() function by moving its definition to target/*/cpu.c. This allows for compiling memory access functions in accel/tcg/cputlb.c without having to know target specifics. Signed-off-by: Anton Johansson Message-Id:

[PATCH 06/33] include/exec: typedef abi_ptr to vaddr

2024-01-27 Thread Richard Henderson
From: Anton Johansson Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-11-a...@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/exec/cpu_ldst.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu_ldst.h

[PATCH 24/33] accel/tcg: Rename tcg_cpus_exec() -> tcg_cpu_exec()

2024-01-27 Thread Richard Henderson
From: Philippe Mathieu-Daudé tcg_cpus_exec() operates on a single vCPU, rename it as 'tcg_cpu_exec'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20240124101639.30056-4-phi...@linaro.org> Signed-off-by: Richard Henderson ---

[PATCH 16/33] accel/tcg/cpu-exec: Use RCU_READ_LOCK_GUARD

2024-01-27 Thread Richard Henderson
From: Philippe Mathieu-Daudé Replace the manual rcu_read_(un)lock calls in cpu_exec(). Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240124074201.8239-2-phi...@linaro.org> [rth: Use RCU_READ_LOCK_GUARD not WITH_RCU_READ_LOCK_GUARD] Signed-off-by: Richard Henderson ---

[PATCH 29/33] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler

2024-01-27 Thread Richard Henderson
From: Philippe Mathieu-Daudé In order to make accel/tcg/ target agnostic, introduce the need_replay_interrupt() handler. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Reviewed-by: Pavel Dovgalyuk Message-Id:

[PATCH 18/33] accel/tcg: Make use of qemu_target_page_mask() in perf.c

2024-01-27 Thread Richard Henderson
From: Ilya Leoshkevich Stop using TARGET_PAGE_MASK in order to make perf.c more target-agnostic. Signed-off-by: Ilya Leoshkevich Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231212003837.64090-2-...@linux.ibm.com> Reviewed-by: Richard Henderson Message-Id:

[PATCH 25/33] accel/tcg: Un-inline icount_exit_request() for clarity

2024-01-27 Thread Richard Henderson
From: Philippe Mathieu-Daudé Convert packed logic to dumb icount_exit_request() helper. No functional change intended. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20240124101639.30056-5-phi...@linaro.org> Signed-off-by:

[PATCH 26/33] include/qemu: Add TCGCPUOps typedef to typedefs.h

2024-01-27 Thread Richard Henderson
QEMU coding style recommends using structure typedefs. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 5 + include/qemu/typedefs.h| 1 + bsd-user/signal.c | 4 ++-- linux-user/signal.c| 4 ++-- target/alpha/cpu.c | 2 +- target/arm/cpu.c

[PATCH 14/33] tests/tcg: Factor out gdbstub test functions

2024-01-27 Thread Richard Henderson
From: Ilya Leoshkevich Both the report() function as well as the initial gdbstub test sequence are copy-pasted into ~10 files with slight modifications. This indicates that they are indeed generic, so factor them out. While at it, add a few newlines to make the formatting closer to PEP-8.

[PATCH 10/33] include/exec: Move cpu_*()/cpu_env() to common header

2024-01-27 Thread Richard Henderson
From: Anton Johansson Functions are target independent. Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-17-a...@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/exec/cpu-all.h| 25 - include/exec/cpu-common.h |

[PATCH 00/33] tcg patch queue, pre-pull

2024-01-27 Thread Richard Henderson
Collect some patch sets, cherry-pick from others, with a few changes of my own. Patches that lack review: 26-include-qemu-Add-TCGCPUOps-typedef-to-typedefs.h.patch 27-target-loongarch-Constify-loongarch_tcg_ops.patch 28-accel-tcg-Use-CPUState.cc-instead-of-CPU_GET_CLASS-i.patch

[PATCH 04/33] target: Use vaddr in gen_intermediate_code

2024-01-27 Thread Richard Henderson
From: Anton Johansson Makes gen_intermediate_code() signature target agnostic so the function can be called from accel/tcg/translate-all.c without target specifics. Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-9-a...@rev.ng> Reviewed-by: Richard Henderson Signed-off-by:

[PATCH 15/33] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-27 Thread Richard Henderson
From: Ilya Leoshkevich Make sure that qemu gdbstub, like gdbserver, allows reading from and writing to PROT_NONE pages. Signed-off-by: Ilya Leoshkevich Message-Id: <20240109230808.583012-4-...@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/multiarch/prot-none.c | 40

[PATCH 13/33] linux-user: Allow gdbstub to ignore page protection

2024-01-27 Thread Richard Henderson
From: Ilya Leoshkevich gdbserver ignores page protection by virtue of using /proc/$pid/mem. Teach qemu gdbstub to do this too. This will not work if /proc is not mounted; accept this limitation. One alternative is to temporarily grant the missing PROT_* bit, but this is inherently racy. Another

[PATCH 21/33] accel/tcg: Move perf and debuginfo support to tcg/

2024-01-27 Thread Richard Henderson
From: Ilya Leoshkevich tcg/ should not depend on accel/tcg/, but perf and debuginfo support provided by the latter are being used by tcg/tcg.c. Since that's the only user, move both to tcg/. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ilya

[PATCH 27/33] target/loongarch: Constify loongarch_tcg_ops

2024-01-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/loongarch/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index d9ddab5b9a..d663d46b00 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -758,7 +758,7 @@ void

[PATCH 19/33] tcg: Make tb_cflags() usable from target-agnostic code

2024-01-27 Thread Richard Henderson
From: Ilya Leoshkevich Currently tb_cflags() is defined in exec-all.h, which is not usable from target-agnostic code. Move it to translation-block.h, which is. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-ID:

[PATCH 05/33] include/exec: Use vaddr in DisasContextBase for virtual addresses

2024-01-27 Thread Richard Henderson
From: Anton Johansson Updates target/ QEMU_LOG macros to use VADDR_PRIx for printing updated DisasContextBase fields. Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-10-a...@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson ---

Re: [PATCH 0/9] accel/tcg: Extract some x86-specific code

2024-01-27 Thread Richard Henderson
On 1/24/24 20:16, Philippe Mathieu-Daudé wrote: accel/tcg/ ought to be target agnostic. This series remove some x86 code, addressing part of "Work still remains" from Anjo's series: https://lore.kernel.org/qemu-devel/20240119144024.14289-1-a...@rev.ng/

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

2024-01-27 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: [PATCH 1/6] accel/tcg/cpu-exec: Use RCU_READ macro

2024-01-27 Thread Richard Henderson
On 1/24/24 17:41, Philippe Mathieu-Daudé wrote: Replace the manual rcu_read_(un)lock calls by the WITH_RCU_READ_LOCK_GUARD macro (See commit ef46ae67ba "docs/style: call out the use of GUARD macros"). Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 24

Re: [PATCH] target/arm: Fix VNCR fault detection logic

2024-01-27 Thread Richard Henderson
On 1/17/24 02:56, Peter Maydell wrote: In arm_deliver_fault() we check for whether the fault is caused by a data abort due to an access to a FEAT_NV2 sysreg in the memory pointed to by the VNCR. Unfortunately part of the condition checks the wrong argument to the function, meaning that it would

Re: [PATCH v2 0/3] linux-user: Allow gdbstub to ignore page protection

2024-01-27 Thread Richard Henderson
On 1/10/24 09:05, Ilya Leoshkevich wrote: v1 -> v2: Use /proc/self/mem as a fallback. Handle TB invalidation (Richard). Test cross-page accesses. RFC: https://lists.gnu.org/archive/html/qemu-devel/2023-12/msg02044.html RFC -> v1: Use /proc/self/mem and accept that this

Re: [RFC PATCH 17/34] hw/core: [CPUTLB] Move target specifics to end of TCGCPUOps

2024-01-27 Thread Richard Henderson
On 1/24/24 10:43, Richard Henderson wrote: On 1/20/24 00:40, Anton Johansson wrote: TCGCPUOps contains an extra function pointer when included with NEED_CPU_H, these are moved from the middle to the end of the struct. As such offsets to target independent function pointers don't vary in target

Re: [RFC PATCH 16/34] exec: [CPUTLB] Move cpu_*()/cpu_env() to common header

2024-01-27 Thread Richard Henderson
On 1/28/24 08:14, Richard Henderson wrote: On 1/20/24 00:40, Anton Johansson wrote: --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -347,4 +347,29 @@ G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);    */   #define PAGE_PASSTHROUGH 0x0800 +/*

[PATCH v3] doc/sphinx/hxtool.py: add optional label argument to SRST directive

2024-01-27 Thread David Woodhouse
From: David Woodhouse We can't just embed labels directly into files like qemu-options.hx which are included from multiple top-level rST files, because Sphinx sees the labels as duplicate: https://github.com/sphinx-doc/sphinx/issues/9707 So add an optional argument to the SRST directive which

Re: [RFC PATCH 16/34] exec: [CPUTLB] Move cpu_*()/cpu_env() to common header

2024-01-27 Thread Richard Henderson
On 1/20/24 00:40, Anton Johansson wrote: --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -347,4 +347,29 @@ G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); */ #define PAGE_PASSTHROUGH 0x0800 +/* accel/tcg/cpu-exec.c */ +int cpu_exec(CPUState *cpu);

Re: [PATCH v2] target/arm: fix exception syndrome for AArch32 bkpt insn

2024-01-27 Thread Richard Henderson
On 1/28/24 06:27, Jan Klötzke wrote: Debug exceptions that target AArch32 Hyp mode are reported differently than on AAarch64. Internally, Qemu uses the AArch64 syndromes. Therefore such exceptions need to be either converted to a prefetch abort (breakpoints, vector catch) or a data abort

[PATCH v1] virtio-gpu: Correct virgl_renderer_resource_get_info() error check

2024-01-27 Thread Dmitry Osipenko
virgl_renderer_resource_get_info() returns errno and not -1 on error. Correct the return-value check. Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/virtio-gpu-virgl.c

[PATCH v2] target/arm: fix exception syndrome for AArch32 bkpt insn

2024-01-27 Thread Jan Klötzke
Debug exceptions that target AArch32 Hyp mode are reported differently than on AAarch64. Internally, Qemu uses the AArch64 syndromes. Therefore such exceptions need to be either converted to a prefetch abort (breakpoints, vector catch) or a data abort (watchpoints). Signed-off-by: Jan Klötzke

Re: [PATCH] target/arm: fix exception syndrome for AArch32 bkpt insn

2024-01-27 Thread Jan Klötzke
On Tue, 2024-01-23 at 17:58 +, Peter Maydell wrote: > On Fri, 19 Jan 2024 at 22:40, Jan Klötzke > wrote: > > > --- > > target/arm/helper.c | 20 > > 1 file changed, 20 insertions(+) > > > > diff --git a/target/arm/helper.c b/target/arm/helper.c > > index

Re: [PATCH v2] hw/arm: add PCIe to Freescale i.MX6

2024-01-27 Thread Guenter Roeck
Hi, On Mon, Jan 08, 2024 at 02:03:25PM +, Nikita Ostrenkov wrote: > Signed-off-by: Nikita Ostrenkov > --- This patch, with the "sabrelite" emulation and the Linux upstream kernel (v6.8-rc1, using imx_v6_v7_defconfig), results in: qemu-system-arm: ../system/memory.c:2750:

[PATCH v3 8/8] Add tests for the STM32L4x5_RCC

2024-01-27 Thread Arnaud Minier
Again, troubles with my mail formatting. Sorry for the multiple mails of this patch you may have received. Tests: - the ability to change the sysclk of the device - the ability to enable/disable/configure the PLLs - if the clock multiplexers work - the register flags and the generation of irqs

[PATCH v3] Add tests for the STM32L4x5_RCC

2024-01-27 Thread Arnaud Minier
Tests: - the ability to change the sysclk of the device - the ability to enable/disable/configure the PLLs - if the clock multiplexers work - the register flags and the generation of irqs Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- tests/qtest/meson.build | 3 +-

[PATCH v3 7/8] STM32L4x5: Use the RCC Sysclk

2024-01-27 Thread Arnaud Minier
Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/arm/b-l475e-iot01a.c| 10 +- hw/arm/stm32l4x5_soc.c | 33 - include/hw/arm/stm32l4x5_soc.h | 3 --- 3 files changed, 5 insertions(+), 41 deletions(-) diff --git

[PATCH v3 6/8] Add write protections to CR register

2024-01-27 Thread Arnaud Minier
--- hw/misc/stm32l4x5_rcc.c | 164 1 file changed, 114 insertions(+), 50 deletions(-) diff --git a/hw/misc/stm32l4x5_rcc.c b/hw/misc/stm32l4x5_rcc.c index 1f55662bbd..325b179d10 100644 --- a/hw/misc/stm32l4x5_rcc.c +++ b/hw/misc/stm32l4x5_rcc.c @@ -329,9

[PATCH v3 7/8] STM32L4x5: Use the RCC Sysclk

2024-01-27 Thread Arnaud Minier
Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/arm/b-l475e-iot01a.c| 10 +- hw/arm/stm32l4x5_soc.c | 33 - include/hw/arm/stm32l4x5_soc.h | 3 --- 3 files changed, 5 insertions(+), 41 deletions(-) diff --git

[PATCH v3 8/8] Add tests for the STM32L4x5_RCC

2024-01-27 Thread Arnaud Minier
Tests: - the ability to change the sysclk of the device - the ability to enable/disable/configure the PLLs - if the clock multiplexers work - the register flags and the generation of irqs Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- tests/qtest/meson.build | 3 +-

[PATCH v3 5/8] RCC: Handle Register Updates

2024-01-27 Thread Arnaud Minier
Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/misc/stm32l4x5_rcc.c | 508 +++- 1 file changed, 496 insertions(+), 12 deletions(-) diff --git a/hw/misc/stm32l4x5_rcc.c b/hw/misc/stm32l4x5_rcc.c index c2df70ab37..1f55662bbd 100644 ---

[PATCH v3 2/8] Add an internal clock multiplexer object

2024-01-27 Thread Arnaud Minier
Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol Acked-by: Alistair Francis --- hw/misc/stm32l4x5_rcc.c | 154 ++ hw/misc/trace-events | 5 + include/hw/misc/stm32l4x5_rcc.h | 119 +

[PATCH v3 3/8] Add an internal PLL Clock object

2024-01-27 Thread Arnaud Minier
Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/misc/stm32l4x5_rcc.c | 171 ++ hw/misc/trace-events | 5 + include/hw/misc/stm32l4x5_rcc.h | 40 + include/hw/misc/stm32l4x5_rcc_internals.h | 22 +++ 4

[PATCH v3 4/8] Add initialization information for PLLs and clock multiplexers

2024-01-27 Thread Arnaud Minier
Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/misc/stm32l4x5_rcc.c | 69 ++- include/hw/misc/stm32l4x5_rcc_internals.h | 707 ++ 2 files changed, 774 insertions(+), 2 deletions(-) diff --git a/hw/misc/stm32l4x5_rcc.c

[PATCH v3 0/8] Add device STM32L4x5 RCC

2024-01-27 Thread Arnaud Minier
This patch adds a new device STM32L4x5 RCC (Reset and Clock Control) device and is part of a series implementing the STM32L4x5 with a few peripherals. Due to the high number of lines, I tried to split the patch into several independent commits. Each commit compiles on its own but I had to add

[PATCH v3 1/8] Implement STM32L4x5_RCC skeleton

2024-01-27 Thread Arnaud Minier
Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- MAINTAINERS | 5 +- docs/system/arm/b-l475e-iot01a.rst| 2 +- hw/arm/Kconfig| 1 + hw/arm/stm32l4x5_soc.c| 12 +- hw/misc/Kconfig

Re: [PATCH 1/2] tests/qtest/xlnx-versal-trng-test.c: Drop use of variable length array

2024-01-27 Thread Zhao Liu
On Thu, Jan 25, 2024 at 05:32:10PM +, Peter Maydell wrote: > Date: Thu, 25 Jan 2024 17:32:10 + > From: Peter Maydell > Subject: [PATCH 1/2] tests/qtest/xlnx-versal-trng-test.c: Drop use of > variable length array > X-Mailer: git-send-email 2.34.1 > > This test program is the last use of

Re: [PATCH 2/2] meson: Enable -Wvla

2024-01-27 Thread Zhao Liu
On Thu, Jan 25, 2024 at 05:32:11PM +, Peter Maydell wrote: > Date: Thu, 25 Jan 2024 17:32:11 + > From: Peter Maydell > Subject: [PATCH 2/2] meson: Enable -Wvla > X-Mailer: git-send-email 2.34.1 > > QEMU has historically used variable length arrays only very rarely. > Variable length

Re: [PATCH 1/2] docs: introduce dedicated page about code provenance / sign-off

2024-01-27 Thread Zhao Liu
Hi Daniel, On Thu, Nov 23, 2023 at 11:40:25AM +, Daniel P. Berrangé wrote: > Date: Thu, 23 Nov 2023 11:40:25 + > From: "Daniel P. Berrangé" > Subject: [PATCH 1/2] docs: introduce dedicated page about code provenance / > sign-off > > Currently we have a short paragraph saying that

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

2024-01-27 Thread Zhao Liu
On Fri, Jan 26, 2024 at 11:03:51PM +0100, Philippe Mathieu-Daudé wrote: > Date: Fri, 26 Jan 2024 23:03:51 +0100 > From: Philippe Mathieu-Daudé > Subject: [PATCH v2 09/23] target/i386/hvf: Use CPUState typedef > X-Mailer: git-send-email 2.41.0 > > QEMU coding style recommend using structure

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

2024-01-27 Thread Peter Maydell
On Fri, 26 Jan 2024 at 20:49, Markus Armbruster wrote: > > 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 > >

Re: [PULL 00/36] target-arm queue

2024-01-27 Thread Peter Maydell
On Fri, 26 Jan 2024 at 14:33, Peter Maydell wrote: > > The following changes since commit 5bab95dc74d43bbb28c6a96d24c810a664432057: > > Merge tag 'pull-request-2024-01-24' of https://gitlab.com/thuth/qemu into > staging (2024-01-25 12:33:42 +) > > are available in the Git repository at: >

Re: [PATCH] doc/sphinx/hxtool.py: add optional label argument to SRST directive

2024-01-27 Thread Peter Maydell
On Sat, 27 Jan 2024 at 10:16, David Woodhouse wrote: > > On Tue, 2023-12-12 at 15:04 +, Peter Maydell wrote: > > > > > --- a/docs/system/i386/xen.rst > > > +++ b/docs/system/i386/xen.rst > > > @@ -132,7 +132,7 @@ The example above provides the guest kernel command > > > line after a

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

2024-01-27 Thread Zhao Liu
Hi Philippe, On Fri, Jan 26, 2024 at 11:03:52PM +0100, Philippe Mathieu-Daudé wrote: > Date: Fri, 26 Jan 2024 23:03:52 +0100 > From: Philippe Mathieu-Daudé > Subject: [PATCH v2 10/23] target/i386: Prefer fast cpu_env() over slower > CPU QOM cast macro > X-Mailer: git-send-email 2.41.0 > >

Re: [RFC PATCH 13/34] target: Uninline cpu_get_tb_cpu_state()

2024-01-27 Thread Richard Henderson
On 1/20/24 00:40, Anton Johansson wrote: Required to compile accel/tcg/translate-all.c once for softmmu targets. The function gets quite big for some targets so uninlining makes sense. Signed-off-by: Anton Johansson --- Queued, thanks. r~

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

2024-01-27 Thread Zhao Liu
On Fri, Jan 26, 2024 at 11:03:43PM +0100, Philippe Mathieu-Daudé wrote: > Date: Fri, 26 Jan 2024 23:03:43 +0100 > From: Philippe Mathieu-Daudé > Subject: [PATCH v2 01/23] hw/acpi/cpu: Use CPUState typedef > X-Mailer: git-send-email 2.41.0 > > QEMU coding style recommend using structure typedefs:

Re: [PATCH] doc/sphinx/hxtool.py: add optional label argument to SRST directive

2024-01-27 Thread David Woodhouse
On Tue, 2023-12-12 at 15:04 +, Peter Maydell wrote: > > > --- a/docs/system/i386/xen.rst > > +++ b/docs/system/i386/xen.rst > > @@ -132,7 +132,7 @@ The example above provides the guest kernel command > > line after a separator > >   (" ``--`` ") on the Xen command line, and does not provide

Re: [RFC PATCH 12/34] target: Uninline cpu_mmu_index()

2024-01-27 Thread Richard Henderson
On 1/20/24 00:40, Anton Johansson wrote: Uninlines the target-defined cpu_mmu_index() function by moving its definition to target/*/cpu.c. This allows for compiling memory access functions in accel/tcg/cputlb.c without having to know target specifics. Signed-off-by: Anton Johansson ---

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

2024-01-27 Thread David Woodhouse
On Fri, 2024-01-26 at 23:03 +0100, 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é > --- For the KVM/Xen parts Acked-by: David Woodhouse smime.p7s

Re: [RFC PATCH 10/34] exec: [VADDR] typedef abi_ptr to vaddr

2024-01-27 Thread Richard Henderson
On 1/20/24 00:40, Anton Johansson wrote: Signed-off-by: Anton Johansson --- 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 6061e33ac9..eb8f3f0595 100644 --- a/include/exec/cpu_ldst.h +++

Re: [RFC PATCH 09/34] exec: [VADDR] Use vaddr in DisasContextBase for virtual addresses

2024-01-27 Thread Richard Henderson
On 1/20/24 00:39, Anton Johansson wrote: Updates target/ QEMU_LOG macros to use VADDR_PRIx for printing updated DisasContextBase fields. Signed-off-by: Anton Johansson --- include/exec/translator.h | 6 +++--- target/mips/tcg/translate.h | 3 ++- target/hexagon/translate.c | 3 ++-

Re: [RFC PATCH 08/34] target: [VADDR] Use vaddr in gen_intermediate_code

2024-01-27 Thread Richard Henderson
On 1/20/24 00:39, Anton Johansson wrote: Makes gen_intermediate_code() signature target agnostic so the function can be called from accel/tcg/translate-all.c without target specifics. Signed-off-by: Anton Johansson --- include/exec/translator.h | 2 +- target/alpha/translate.c | 2

Re: [RFC PATCH 07/34] hw/core: [VADDR] Include vaddr.h from cpu.h

2024-01-27 Thread Richard Henderson
On 1/20/24 00:39, Anton Johansson wrote: cpu-common.h is only needed for vaddr Signed-off-by: Anton Johansson --- include/hw/core/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Queued, thanks. r~

Re: [RFC PATCH 06/34] exec: [VADDR] Move vaddr defines to separate file

2024-01-27 Thread Richard Henderson
On 1/27/24 18:36, Richard Henderson wrote: On 1/20/24 00:39, Anton Johansson wrote: --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -14,18 +14,6 @@   #define EXCP_YIELD  0x10004 /* cpu wants to yield timeslice to another */   #define EXCP_ATOMIC 0x10005 /*

Re: [RFC PATCH 06/34] exec: [VADDR] Move vaddr defines to separate file

2024-01-27 Thread Richard Henderson
On 1/20/24 00:39, Anton Johansson wrote: --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -14,18 +14,6 @@ #define EXCP_YIELD 0x10004 /* cpu wants to yield timeslice to another */ #define EXCP_ATOMIC 0x10005 /* stop-the-world and emulate atomic */ -/** - *

Re: [RFC PATCH 05/34] target/tricore: [VADDR] Use target_ulong for EA

2024-01-27 Thread Richard Henderson
On 1/20/24 00:39, Anton Johansson wrote: Prepares target for typedef'ing abi_ptr to vaddr. Fixes sign extension bug that would result from abi_ptr being unsigned in the future. Necessary to make memory access function signatures target agnostic. Signed-off-by: Anton Johansson ---