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

2023-10-24 Thread Akihiko Odaki
On 2023/10/25 1:48, Alex Bennée wrote: Akihiko Odaki writes: 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

[PATCH v15 09/19] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb

2023-10-24 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 Reviewed-by: Alex Bennée --- include/exec

[PATCH v15 07/19] gdbstub: Use GDBFeature for gdb_register_coprocessor

2023-10-24 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

[PATCH v15 05/19] target/ppc: Use GDBFeature for dynamic XML

2023-10-24 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 Reviewed-by: Richard Henderson --- target/ppc/cpu-qom.h | 4 ++-- target/ppc/cpu.h

[PATCH v15 04/19] target/arm: Use GDBFeature for dynamic XML

2023-10-24 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

[PATCH v15 03/19] gdbstub: Introduce GDBFeatureBuilder

2023-10-24 Thread Akihiko Odaki
GDBFeatureBuilder unifies the logic to generate dynamic GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson --- include/exec/gdbstub.h | 50 gdbstub/gdbstub.c | 65 ++ 2 files changed, 115

[PATCH v15 10/19] gdbstub: Simplify XML lookup

2023-10-24 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 Reviewed-by: Alex Bennée --- include/exec/gdbstub.h | 6 +++ gdbstub/gdbstub.c | 118

[PATCH v15 08/19] gdbstub: Use GDBFeature for GDBRegisterState

2023-10-24 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

[PATCH v15 02/19] gdbstub: Introduce gdb_find_static_feature()

2023-10-24 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 | 8 gdbstub/gdbstub.c | 13

[PATCH v15 17/19] plugins: Use different helpers when reading registers

2023-10-24 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/qemu/plugin.h | 2 ++ plugins/plugin.h | 2 +- accel/tcg/plugin-gen.c | 39

[PATCH v15 01/19] gdbstub: Add num_regs member to GDBFeature

2023-10-24 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

[PATCH v15 13/19] gdbstub: Add members to identify registers to GDBFeature

2023-10-24 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 | 12 +--- target

[PATCH v15 19/19] contrib/plugins: Allow to log registers

2023-10-24 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 v15 18/19] plugins: Allow to read registers

2023-10-24 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

[PATCH v15 11/19] gdbstub: Infer number of core registers from XML

2023-10-24 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

[PATCH v15 00/19] plugins: Allow to read registers

2023-10-24 Thread Akihiko Odaki
nged. (Alex Bennée) Dropped 0x prefixes for register value logs for conciseness. V1 -> V2: Added SPDX-License-Identifier: GPL-2.0-or-later. (Philippe Mathieu-Daudé) Split long lines. (Philippe Mathieu-Daudé) Renamed gdb_features to gdb_static_features (Philippe Mathieu-Daudé) Drop

[PATCH v15 16/19] plugins: Introduce CPU flags

2023-10-24 Thread Akihiko Odaki
was needed because the presence of a QEMU_PLUGIN_EV_VCPU_TB_TRANS callback affected TCG translation. We now have a dedicated CPU flag for this, QEMU_PLUGIN_CPU_FLAG_CB_TRANS. Signed-off-by: Akihiko Odaki --- include/hw/core/cpu.h | 4 ++-- include/qemu/plugin.h | 2 ++ plugins/plugin.h |

[PATCH v15 12/19] hw/core/cpu: Remove gdb_get_dynamic_xml member

2023-10-24 Thread Akihiko Odaki
This function is no longer used. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée --- 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

[PATCH v15 15/19] cpu: Call plugin hooks only when ready

2023-10-24 Thread Akihiko Odaki
The initialization and exit hooks will not affect the state of vCPU outside TCG context, but they may depend on the state of vCPU. Therefore, it's better to call plugin hooks after the vCPU state is fully initialized and before it gets uninitialized. Signed-off-by: Akihiko Odaki Reviewed

[PATCH v15 14/19] gdbstub: Expose functions to read registers

2023-10-24 Thread Akihiko Odaki
gdb_find_feature() and gdb_find_feature_register() find registers. gdb_read_register() actually reads registers. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 29 + gdbstub/gdbstub.c | 31 ++- 2 files changed, 59

Re: [PATCH v14 00/18] plugins: Allow to read registers

2023-10-24 Thread Akihiko Odaki
On 2023/10/25 2:08, Alex Bennée wrote: Akihiko Odaki writes: Based-on: <20231019101030.128431-1-akihiko.od...@daynix.com> ("[PATCH v5 0/6] gdbstub and TCG plugin improvements") I and other people in the University of Tokyo, where I research processor design, found TCG

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

2023-10-25 Thread Akihiko Odaki
This avoids optimizations incompatible when reading registers. Signed-off-by: Akihiko Odaki --- accel/tcg/plugin-helpers.h | 3 ++- include/qemu/plugin.h | 1 + accel/tcg/plugin-gen.c | 43 ++ plugins/api.c | 12 +-- 4 files

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

2023-10-25 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 Reviewed-by: Alex Bennée --- include/exec

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

2023-10-25 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 Reviewed-by: Alex Bennée --- include/exec/gdbstub.h | 6 +++ gdbstub/gdbstub.c | 118

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

2023-10-25 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

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

2023-10-25 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 v16 06/18] target/riscv: Use GDBFeature for dynamic XML

2023-10-25 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

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

2023-10-25 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

[PATCH v16 15/18] cpu: Call plugin hooks only when ready

2023-10-25 Thread Akihiko Odaki
The initialization and exit hooks will not affect the state of vCPU outside TCG context, but they may depend on the state of vCPU. Therefore, it's better to call plugin hooks after the vCPU state is fully initialized and before it gets uninitialized. Signed-off-by: Akihiko Odaki Reviewed

Re: [PATCH v6 11/21] virtio-net: Return an error when vhost cannot enable RSS

2023-10-30 Thread Akihiko Odaki
On 2023/10/30 21:51, Yuri Benditovich wrote: On Mon, Oct 30, 2023 at 2:21 PM Akihiko Odaki <mailto:akihiko.od...@daynix.com>> wrote: On 2023/10/30 21:14, Yuri Benditovich wrote: > > > On Mon, Oct 30, 2023 at 7:14 AM Akihiko Odaki mailto:akihik

[PATCH v16 05/18] target/ppc: Use GDBFeature for dynamic XML

2023-10-25 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 Reviewed-by: Richard Henderson --- target/ppc/cpu-qom.h | 4 ++-- target/ppc/cpu.h

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

2023-10-25 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

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

2023-10-25 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 | 8 gdbstub/gdbstub.c | 13

[PATCH v16 14/18] gdbstub: Expose functions to read registers

2023-10-25 Thread Akihiko Odaki
gdb_find_feature() and gdb_find_feature_register() find registers. gdb_read_register() actually reads registers. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 29 + gdbstub/gdbstub.c | 31 ++- 2 files changed, 59

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

2023-10-25 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

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

2023-10-25 Thread Akihiko Odaki
This function is no longer used. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée --- 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

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

2023-10-25 Thread Akihiko Odaki
On 2023/10/25 14:39, Akihiko Odaki wrote: On 2023/10/25 1:48, Alex Bennée wrote: Akihiko Odaki writes: 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

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

2023-10-25 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

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

2023-10-25 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 | 12 +--- target

[PATCH v16 00/18] plugins: Allow to read registers

2023-10-25 Thread Akihiko Odaki
ind_static_feature() to abort on failure. (Alex Bennée) Changed the execlog plugin to log the register value only when changed. (Alex Bennée) Dropped 0x prefixes for register value logs for conciseness. V1 -> V2: Added SPDX-License-Identifier: GPL-2.0-or-later. (Philippe Mathieu-Dau

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

2023-10-25 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

[PATCH v16 03/18] gdbstub: Introduce GDBFeatureBuilder

2023-10-25 Thread Akihiko Odaki
GDBFeatureBuilder unifies the logic to generate dynamic GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson --- include/exec/gdbstub.h | 50 gdbstub/gdbstub.c | 65 ++ 2 files changed, 115

[PATCH v4 0/5] gdbstub and TCG plugin improvements

2023-10-17 Thread Akihiko Odaki
not allow MXL_RV32 for TARGET_RISCV64". Added patch "target/riscv: Initialize gdb_core_xml_file only once". Dropped patch "target/riscv: Remove misa_mxl validation". Dropped patch "target/riscv: Move misa_mxl_max to class". Dropped patch "target/ris

[PATCH v4 2/5] target/riscv: Remove misa_mxl validation

2023-10-17 Thread Akihiko Odaki
It is initialized with a simple assignment and there is little room for error. In fact, the validation is even more complex. Signed-off-by: Akihiko Odaki --- target/riscv/tcg/tcg-cpu.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/target/riscv/tcg/tcg-cpu.c

[PATCH v4 3/5] target/riscv: Move misa_mxl_max to class

2023-10-17 Thread Akihiko Odaki
misa_mxl_max is 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 | 1 + target/riscv/cpu.h | 3 +- hw/riscv/boot.c| 2 +- target/riscv/cpu.c | 118

[PATCH v4 5/5] plugins: Remove an extra parameter

2023-10-17 Thread Akihiko Odaki
copy_call() has an unused parameter so remove it. Signed-off-by: Akihiko Odaki --- accel/tcg/plugin-gen.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 39b3c9351f..78b331b251 100644 --- a/accel/tcg/plugin-gen.c

[PATCH v4 4/5] target/riscv: Validate misa_mxl_max only once

2023-10-17 Thread Akihiko Odaki
misa_mxl_max is now a class member and initialized only once for each class. This also moves the initialization of gdb_core_xml_file which will be referenced before realization in the future. Signed-off-by: Akihiko Odaki --- target/riscv/cpu.c | 21 + target/riscv

[PATCH v4 1/5] gdbstub: Check if gdb_regs is NULL

2023-10-17 Thread Akihiko Odaki
cpu->gdb_regs may be NULL if no coprocessor is registered. Fixes: 73c392c26b ("gdbstub: Replace gdb_regs with an array") Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/gdbs

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

2023-10-17 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

[PATCH v13 00/18] plugins: Allow to read registers

2023-10-17 Thread Akihiko Odaki
née) Changed the execlog plugin to log the register value only when changed. (Alex Bennée) Dropped 0x prefixes for register value logs for conciseness. V1 -> V2: Added SPDX-License-Identifier: GPL-2.0-or-later. (Philippe Mathieu-Daudé) Split long lines. (Philippe Mathieu-Daudé) Renam

[PATCH v13 03/18] gdbstub: Introduce GDBFeatureBuilder

2023-10-17 Thread Akihiko Odaki
GDBFeatureBuilder unifies the logic to generate dynamic GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson --- include/exec/gdbstub.h | 20 ++ gdbstub/gdbstub.c | 59 ++ 2 files changed, 79 insertions(+) diff --git

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

2023-10-17 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

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

2023-10-17 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

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

2023-10-17 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

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

2023-10-17 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 v13 11/18] gdbstub: Infer number of core registers from XML

2023-10-17 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

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

2023-10-17 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 v13 06/18] target/riscv: Use GDBFeature for dynamic XML

2023-10-17 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

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

2023-10-17 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

[PATCH v13 05/18] target/ppc: Use GDBFeature for dynamic XML

2023-10-17 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 Reviewed-by: Richard Henderson --- target/ppc/cpu-qom.h | 4 ++-- target/ppc/cpu.h

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

2023-10-17 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 v13 17/18] plugins: Allow to read registers

2023-10-17 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

[PATCH v13 14/18] gdbstub: Expose functions to read registers

2023-10-17 Thread Akihiko Odaki
gdb_find_feature() and gdb_find_feature_register() find registers. gdb_read_register() actually reads registers. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 5 + gdbstub/gdbstub.c | 31 ++- 2 files changed, 35 insertions(+), 1 deletion

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

2023-10-17 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

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

2023-10-17 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 | 119

[PATCH v13 15/18] cpu: Call plugin hooks only when ready

2023-10-17 Thread Akihiko Odaki
The initialization and exit hooks will not affect the state of vCPU outside TCG context, but they may depend on the state of vCPU. Therefore, it's better to call plugin hooks after the vCPU state is fully initialized and before it gets uninitialized. Signed-off-by: Akihiko Odaki --- cpu

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

2023-10-17 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

Re: [QEMU PATCH v5 07/13] softmmu/memory: enable automatic deallocation of memory regions

2023-09-19 Thread Akihiko Odaki
On 2023/09/19 19:28, Xenia Ragiadakou wrote: On 15/9/23 18:11, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: From: Xenia Ragiadakou When the memory region has a different life-cycle from that of her parent, could be automatically released, once has been unparent and once all

Re: [QEMU PATCH v5 07/13] softmmu/memory: enable automatic deallocation of memory regions

2023-09-19 Thread Akihiko Odaki
On 2023/09/19 23:21, Xenia Ragiadakou wrote: On 19/9/23 13:44, Akihiko Odaki wrote: On 2023/09/19 19:28, Xenia Ragiadakou wrote: On 15/9/23 18:11, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: From: Xenia Ragiadakou When the memory region has a different life-cycle from

Re: [PATCH v11 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-09-19 Thread Akihiko Odaki
//github.com/talex5/wayland-proxy-virtwl Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Reviewed-by: Emmanouil Pitsidianakis --- v1: Incorported various suggestions by Akihiko Odaki and Bernard Berschow - Removed GET_VIRTIO_GPU_GL / GET_RUTABAGA macr

Re: [PATCH] docs/devel/reset.rst: Correct function names

2023-09-21 Thread Akihiko Odaki
On 2022/11/25 23:06, Akihiko Odaki wrote: resettable_class_set_parent_phases() was mistakenly called resettable_class_set_parent_reset_phases() in some places. Signed-off-by: Akihiko Odaki --- docs/devel/reset.rst | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff

[PATCH v3] input: Allow to choose console with qemu_input_is_absolute

2023-09-21 Thread Akihiko Odaki
Although an input is routed depending on the console, qemu_input_is_absolute() had no mechanism to specify the console. Accept QemuConsole as an argument for qemu_input_is_absolute, and let the display know the absolute/relative state for a particular console. Signed-off-by: Akihiko Odaki

[PATCH v2] amd_iommu: Fix APIC address check

2023-09-21 Thread Akihiko Odaki
An MSI from I/O APIC may not exactly equal to APIC_DEFAULT_ADDRESS. In fact, Windows 17763.3650 configures I/O APIC to set the dest_mode bit. Cover the range assigned to APIC. Fixes: 577c470f43 ("x86_iommu/amd: Prepare for interrupt remap support") Signed-off-by: Akihiko Odaki --

Re: [PATCH] cutils: Fix get_relocated_path on Windows

2023-09-21 Thread Akihiko Odaki
On 2022/10/31 9:59, Akihiko Odaki wrote: get_relocated_path() did not have error handling for PathCchSkipRoot() because a path given to get_relocated_path() was expected to be a valid path containing a drive letter or UNC server/share path elements on Windows, but sometimes it turned out

[PATCH v3 1/8] util: Introduce qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
get_user_cache_dir() when $XDG_DATA_DIRS is not available. In the case, we rather use: get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR "/run") Signed-off-by: Akihiko Odaki --- include/qemu/osdep.h | 12 util/oslib-posix.c | 11 +++ util/oslib-win32.c | 26

[PATCH v3 0/8] util: Introduce qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
get_user_cache_dir() when $XDG_DATA_DIRS is not available. In the case, we rather use: get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR "/run") V2 -> V3: Rebase to the current master. Dropped patch "qga: Remove platform GUID definitions" since it is irrelevant. V1 -> V2:

[PATCH v3 2/8] ivshmem-server: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default PID file path. Signed-off-by: Akihiko Odaki --- contrib/ivshmem-server/main.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c index

[PATCH v3 8/8] spice-app: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() provides QEMU-specific fallback of runtime directory. Signed-off-by: Akihiko Odaki --- ui/spice-app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/spice-app.c b/ui/spice-app.c index 405fb7f9f5..f6c2343213 100644 --- a/ui/spice-app.c +++ b/ui

[PATCH v3 6/8] module: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the path to module upgrades. Signed-off-by: Akihiko Odaki --- util/module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index 32e263163c..580658edf4 100644 --- a/util/module.c +++ b/util/module.c

Re: [PATCH] accel/kvm/kvm-all: Handle register access errors

2023-09-21 Thread Akihiko Odaki
On 2023/06/19 21:19, Peter Maydell wrote: On Sat, 10 Jun 2023 at 04:51, Akihiko Odaki wrote: On 2022/12/01 20:00, Akihiko Odaki wrote: On 2022/12/01 19:40, Peter Maydell wrote: On Thu, 1 Dec 2022 at 10:27, Akihiko Odaki wrote: A register access error typically means something seriously

[PATCH] Revert "tap: setting error appropriately when calling net_init_tap_one()"

2023-09-21 Thread Akihiko Odaki
f742c ("virtio: del net client if net_init_tap_one failed"), mentioned earlier, implements this behavior. Restore the correct semantics and fix the assertion failure for the -netdev command line option by reverting the problematic commit. Signed-off-by: Akihiko Odaki --- inc

[PATCH v3 7/8] util: Remove qemu_get_local_state_dir()

2023-09-21 Thread Akihiko Odaki
There are no users of the function anymore. Signed-off-by: Akihiko Odaki --- include/qemu/osdep.h | 8 util/oslib-posix.c | 6 -- util/oslib-win32.c | 10 -- 3 files changed, 24 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index bb857c910f

[PATCH v3 3/8] contrib/rdmacm-mux: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default Unix socket path. Signed-off-by: Akihiko Odaki --- contrib/rdmacm-mux/main.c | 22 ++ contrib/rdmacm-mux/meson.build | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/contrib/rdmacm-mux

[PATCH v3 4/8] qga: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default state directory. Signed-off-by: Akihiko Odaki --- qga/main.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qga/main.c b/qga/main.c index 8668b9f3d3..145ee02df3 100644 --- a/qga/main.c +++ b/qga/main.c

Re: [PATCH v2 01/10] qga: Remove platform GUID definitions

2023-09-21 Thread Akihiko Odaki
On 2022/11/17 18:45, Konstantin Kostiuk wrote: Reviewed-by: Konstantin Kostiuk <mailto:kkost...@redhat.com>> Will merge this patch in QGA series On Thu, Nov 10, 2022 at 12:06 PM Akihiko Odaki <mailto:akihiko.od...@daynix.com>> wrote: GUID

Re: [QEMU PATCH v5 07/13] softmmu/memory: enable automatic deallocation of memory regions

2023-09-20 Thread Akihiko Odaki
On 2023/09/20 17:57, Xenia Ragiadakou wrote: On 20/9/23 01:18, Akihiko Odaki wrote: On 2023/09/19 23:21, Xenia Ragiadakou wrote: On 19/9/23 13:44, Akihiko Odaki wrote: On 2023/09/19 19:28, Xenia Ragiadakou wrote: On 15/9/23 18:11, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote

Re: [QEMU PATCH v5 09/13] virtio-gpu: Handle resource blob commands

2023-09-19 Thread Akihiko Odaki
On 2023/09/20 14:50, Huang Rui wrote: On Sat, Sep 16, 2023 at 12:37:29AM +0800, Akihiko Odaki wrote: On 2023/09/16 1:04, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: From: Antonio Caggiano Support BLOB resources creation, mapping and unmapping by calling the new stable

Re: [PATCH v13 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-09-20 Thread Akihiko Odaki
Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki Reviewed-by: Emmanouil Pitsidianakis Reviewed-by: Antonio Caggiano Reviewed-by: Akihiko Odaki --- hw/display/virtio-gpu-pci-rutabaga.c | 47 ++ hw/display/virtio-gpu-rutabaga.c | 1119 ++ hw/

Re: [QEMU PATCH v5 09/13] virtio-gpu: Handle resource blob commands

2023-09-18 Thread Akihiko Odaki
On 2023/09/18 17:36, Huang Rui wrote: On Sat, Sep 16, 2023 at 12:04:17AM +0800, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: From: Antonio Caggiano Support BLOB resources creation, mapping and unmapping by calling the new stable virglrenderer 0.10 interface. Only enabled when

[PATCH v3 5/8] scsi: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default paths. Signed-off-by: Akihiko Odaki --- scsi/qemu-pr-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index c6c6347e9b..507f23357f 100644 --- a/scsi/qemu-pr

[PATCH v2] Revert "tap: setting error appropriately when calling net_init_tap_one()"

2023-09-21 Thread Akihiko Odaki
t bf769f742c ("virtio: del net client if net_init_tap_one failed"), mentioned earlier, implements this behavior. Restore the correct semantics and fix the assertion failure for the -netdev command line option by reverting the problematic commit. Signed-off-by: Akihiko Odaki --- V1 -&g

Re: [PATCH v2 07/10] virtiofsd: Use qemu_get_runtime_dir()

2023-09-21 Thread Akihiko Odaki
On 2023/09/21 21:58, Stefan Hajnoczi wrote: On Thu, Nov 10, 2022 at 07:06:26PM +0900, Akihiko Odaki wrote: qemu_get_runtime_dir() is used to construct the path to a lock file. Signed-off-by: Akihiko Odaki --- tools/virtiofsd/fuse_virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3

Re: [PATCH v13 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-09-21 Thread Akihiko Odaki
On 2023/09/22 9:03, Gurchetan Singh wrote: On Wed, Sep 20, 2023 at 5:05 AM Mark Cave-Ayland mailto:mark.cave-ayl...@ilande.co.uk>> wrote: On 20/09/2023 12:42, Akihiko Odaki wrote: > On 2023/08/29 9:36, Gurchetan Singh wrote: >> This adds initial suppor

Re: [PATCH v11 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-09-21 Thread Akihiko Odaki
On 2023/09/22 8:44, Gurchetan Singh wrote: On Tue, Sep 19, 2023 at 3:07 PM Akihiko Odaki <mailto:akihiko.od...@gmail.com>> wrote: On 2023/09/20 3:36, Bernhard Beschow wrote: > > > Am 15. September 2023 02:38:02 UTC schrieb Gurchetan Singh

Re: [PATCH v13 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-09-22 Thread Akihiko Odaki
On 2023/09/22 16:42, Alyssa Ross wrote: Akihiko Odaki writes: Practically there is very low chance to hit the bug. I think only fuzzers and malicious actors will trigger it, and probably no one will dare using virtio-gpu-rutabaga or virtio-gpu-gl in a security-sensitive context. Well

Re: [QEMU PATCH v5 06/13] virtio-gpu: Support context init feature with virglrenderer

2023-09-18 Thread Akihiko Odaki
On 2023/09/18 14:43, Huang Rui wrote: On Sun, Sep 17, 2023 at 01:49:19PM +0800, Akihiko Odaki wrote: On 2023/09/17 14:45, Huang Rui wrote: On Sat, Sep 16, 2023 at 06:42:04PM +0800, Akihiko Odaki wrote: On 2023/09/16 19:32, Huang Rui wrote: On Fri, Sep 15, 2023 at 11:20:46PM +0800, Akihiko

Re: [QEMU PATCH v5 06/13] virtio-gpu: Support context init feature with virglrenderer

2023-09-18 Thread Akihiko Odaki
On 2023/09/18 15:20, Huang Rui wrote: On Mon, Sep 18, 2023 at 02:07:25PM +0800, Akihiko Odaki wrote: On 2023/09/18 14:43, Huang Rui wrote: On Sun, Sep 17, 2023 at 01:49:19PM +0800, Akihiko Odaki wrote: On 2023/09/17 14:45, Huang Rui wrote: On Sat, Sep 16, 2023 at 06:42:04PM +0800, Akihiko

Re: [PATCH] amd_iommu: Fix APIC address check

2023-09-21 Thread Akihiko Odaki
On 2023/09/10 1:23, Akihiko Odaki wrote: An MSI from I/O APIC may not exactly equal to APIC_DEFAULT_ADDRESS. In fact, Windows 17763.3650 configures I/O APIC to set the dest_mode bit. Check only the 12 bits that are known to be fixed for I/O APIC-generated MSIs. Fixes: 577c470f43 ("x86_iomm

Re: [PATCH v2] linux-user: Undo incomplete mmap

2023-09-21 Thread Akihiko Odaki
On 2023/09/03 14:39, Akihiko Odaki wrote: When the host page size is greater than the target page size and MAP_FIXED or MAP_FIXED_NOREPLACE is requested, mmap will be done for three parts: start, middle, and end. If a later part of mmap fail, mmap done in the earlier parts must be reverted

Re: [PATCH] vl: Free machine list

2023-09-21 Thread Akihiko Odaki
On 2023/07/22 15:26, Akihiko Odaki wrote: Free machine list and make LeakSanitizer happy. Signed-off-by: Akihiko Odaki --- softmmu/vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index b0b96f67fa..802f728298 100644 --- a/softmmu/vl.c

<    2   3   4   5   6   7   8   9   10   11   >