[PATCH v10 06/18] target/riscv: Use GDBFeature for dynamic XML

2023-10-11 Thread Akihiko Odaki
In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki --- target/riscv/cpu.h | 5 +-- target/riscv/cpu.c | 4 +-- target/riscv/gdbstub

[PATCH v10 12/18] hw/core/cpu: Remove gdb_get_dynamic_xml member

2023-10-11 Thread Akihiko Odaki
This function is no longer used. Signed-off-by: Akihiko Odaki --- include/hw/core/cpu.h | 4 target/arm/cpu.h | 6 -- target/ppc/cpu.h | 1 - target/arm/cpu.c | 1 - target/arm/gdbstub.c | 18 -- target/ppc/cpu_init.c | 3 --- target/ppc/gdbstub.c |

[PATCH v10 16/18] plugins: Use different helpers when reading registers

2023-10-11 Thread Akihiko Odaki
This avoids optimizations incompatible when reading registers. Signed-off-by: Akihiko Odaki --- accel/tcg/plugin-helpers.h | 3 ++- include/exec/plugin-gen.h | 4 ++-- include/hw/core/cpu.h | 4 ++-- include/qemu/plugin.h | 3 +++ plugins/plugin.h | 5 +++-- accel/tcg/p

[PATCH v10 01/18] gdbstub: Add num_regs member to GDBFeature

2023-10-11 Thread Akihiko Odaki
Currently the number of registers exposed to GDB is written as magic numbers in code. Derive the number of registers GDB actually see from XML files to replace the magic numbers in code later. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée --- include

[PATCH v10 09/18] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb

2023-10-11 Thread Akihiko Odaki
Align the parameters of gdb_get_reg_cb and gdb_set_reg_cb with the gdb_read_register and gdb_write_register members of CPUClass to allow to unify the logic to access registers of the core and coprocessors in the future. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 4 +- target

[PATCH v10 10/18] gdbstub: Simplify XML lookup

2023-10-11 Thread Akihiko Odaki
Now we know all instances of GDBFeature that is used in CPU so we can traverse them to find XML. This removes the need for a CPU-specific lookup function for dynamic XMLs. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 2 + gdbstub/gdbstub.c | 85 +++-

[PATCH v10 08/18] gdbstub: Use GDBFeature for GDBRegisterState

2023-10-11 Thread Akihiko Odaki
Simplify GDBRegisterState by replacing num_regs and xml members with one member that points to GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée --- gdbstub/gdbstub.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/g

[PATCH v10 04/18] target/arm: Use GDBFeature for dynamic XML

2023-10-11 Thread Akihiko Odaki
In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Acked-by: Richard Henderson --- target/arm/cpu.h | 21 +++ target/arm/internal

[PATCH v10 17/18] plugins: Allow to read registers

2023-10-11 Thread Akihiko Odaki
It is based on GDB protocol to ensure interface stability. The timing of the vcpu init hook is also changed so that the hook will get called after GDB features are initialized. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1706 Signed-off-by: Akihiko Odaki --- include/qemu/qemu-plugin

[PATCH v10 02/18] gdbstub: Introduce gdb_find_static_feature()

2023-10-11 Thread Akihiko Odaki
This function is useful to determine the number of registers exposed to GDB from the XML name. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- include/exec/gdbstub.h | 2 ++ gdbstub/gdbstub.c | 13 +

[PATCH v10 07/18] gdbstub: Use GDBFeature for gdb_register_coprocessor

2023-10-11 Thread Akihiko Odaki
This is a tree-wide change to introduce GDBFeature parameter to gdb_register_coprocessor(). The new parameter just replaces num_regs and xml parameters for now. GDBFeature will be utilized to simplify XML lookup in a following change. Signed-off-by: Akihiko Odaki Acked-by: Alex Bennée --- inclu

[PATCH v10 13/18] gdbstub: Add members to identify registers to GDBFeature

2023-10-11 Thread Akihiko Odaki
These members will be used to help plugins to identify registers. The added members in instances of GDBFeature dynamically generated by CPUs will be filled in later changes. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 3 +++ gdbstub/gdbstub.c | 10 -- target/riscv/g

[PATCH v10 18/18] contrib/plugins: Allow to log registers

2023-10-11 Thread Akihiko Odaki
This demonstrates how a register can be read from a plugin. Signed-off-by: Akihiko Odaki --- docs/devel/tcg-plugins.rst | 10 +++- contrib/plugins/execlog.c | 120 +++-- 2 files changed, 97 insertions(+), 33 deletions(-) diff --git a/docs/devel/tcg-plugins.rst

[PATCH v10 11/18] gdbstub: Infer number of core registers from XML

2023-10-11 Thread Akihiko Odaki
GDBFeature has the num_regs member so use it where applicable to remove magic numbers. Signed-off-by: Akihiko Odaki --- include/hw/core/cpu.h | 3 ++- target/s390x/cpu.h | 2 -- gdbstub/gdbstub.c | 5 - target/arm/cpu.c| 1 - target/arm/cpu64.c | 1 - target/avr/cpu

Re: [PATCH 2/6] target/riscv: Use env_archcpu() in [check_]nanbox()

2023-10-11 Thread LIU Zhiwei
On 2023/10/11 13:31, Philippe Mathieu-Daudé wrote: On 11/10/23 05:25, LIU Zhiwei wrote: On 2023/10/11 1:04, Richard Henderson wrote: On 10/9/23 05:42, LIU Zhiwei wrote: On 2023/10/9 19:02, Philippe Mathieu-Daudé wrote: When CPUArchState* is available (here CPURISCVState*), we can use the

Re: [PATCH v24 01/21] qapi: machine.json: change docs regarding CpuInstanceProperties

2023-10-11 Thread Markus Armbruster
Nina Schoetterl-Glausch writes: > Clarify roles of different architectures. > Also change things a bit in anticipation of additional members being > added. > > Suggested-by: Markus Armbruster > Signed-off-by: Nina Schoetterl-Glausch > --- > > > Reference to s390x docs added in patch 14 > > > q

Re: [PATCH v9 01/23] target/riscv: Move MISA limits to class

2023-10-11 Thread Akihiko Odaki
On 2023/10/12 0:23, Alex Bennée wrote: Akihiko Odaki writes: MISA limits are common for all instances of a RISC-V CPU class so they are better put into class. Signed-off-by: Akihiko Odaki --- target/riscv/cpu-qom.h | 2 + target/riscv/cpu.h | 2 - hw/riscv/boot.c |

Re: [PATCH] libvhost-user: Fix compiler warning with -Wshadow=local

2023-10-11 Thread Markus Armbruster
Thomas Huth writes: > Rename shadowing variables to make this code compilable > with -Wshadow=local. > > Signed-off-by: Thomas Huth Queued. Thanks!

Re: [PATCH] libvduse: Fix compiler warning with -Wshadow=local

2023-10-11 Thread Markus Armbruster
Thomas Huth writes: > No need to declare a new variable with the same name here, > we can simple re-use the one from the top of the function. > With this change, the file now compiles fine with -Wshadow=local. > > Signed-off-by: Thomas Huth Queued. Thanks!

Re: [PATCH v2] hw/virtio/virtio-gpu: Fix compiler warning when compiling with -Wshadow

2023-10-11 Thread Markus Armbruster
Thomas Huth writes: > Avoid using trivial variable names in macros, otherwise we get > the following compiler warning when compiling with -Wshadow=local: > > In file included from ../../qemu/hw/display/virtio-gpu-virgl.c:19: > ../../home/thuth/devel/qemu/hw/display/virtio-gpu-virgl.c: > In funct

[PULL 2/2] hw/ufs: Fix incorrect register fields

2023-10-11 Thread Jeuk Kim
From: Jeuk Kim This patch fixes invalid ufs register fields. This fixes an issue reported by Bin Meng that caused ufs to fail over riscv. Fixes: bc4e68d362ec ("hw/ufs: Initial commit for emulated Universal-Flash-Storage") Signed-off-by: Jeuk Kim Reported-by: Bin Meng Reviewed-by: Bin Meng Te

[PULL 0/2] hw/ufs: fixes

2023-10-11 Thread Jeuk Kim
From: Jeuk Kim The following changes since commit a51e5124a655b3dad80b36b18547cb1eca2c5eb2: Merge tag 'pull-omnibus-111023-1' of https://gitlab.com/stsquad/qemu into staging (2023-10-11 09:43:10 -0400) are available in the Git repository at: https://gitlab.com/jeuk20.kim/qemu.git tags/pul

[PULL 1/2] hw/ufs: Fix code coverity issues

2023-10-11 Thread Jeuk Kim
From: Jeuk Kim Fixed four ufs-related coverity issues. The coverity issues and fixes are as follows 1. CID 1519042: Security issue with the rand() function Changed to use a fixed value (0xab) instead of rand() as the value for testing 2. CID 1519043: Dereference after null check Removed useles

Re: [PATCH] vfio/pci: Remove vfio_detach_device from vfio_realize error path

2023-10-11 Thread Eric Auger
Hi Zhenzhong, On 10/12/23 04:34, Duan, Zhenzhong wrote: > >> -Original Message- >> From: Eric Auger >> Sent: Thursday, October 12, 2023 4:10 AM >> To: eric.auger@gmail.com; eric.au...@redhat.com; qemu- >> de...@nongnu.org; alex.william...@redhat.com; c...@redhat.com; Duan, >> Zhenzhon

Re: [PATCH] vfio/pci: Remove vfio_detach_device from vfio_realize error path

2023-10-11 Thread Cédric Le Goater
On 10/11/23 22:09, Eric Auger wrote: In vfio_realize, on the error path, we currently call vfio_detach_device() after a successful vfio_attach_device. While this looks natural, vfio_instance_finalize also induces a vfio_detach_device(), and it seems to be the right place instead as other resource

<    1   2   3   4   5   6