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

2023-09-16 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 v8 00/19] plugins: Allow to read registers

2023-09-16 Thread Akihiko Odaki
Dropped RFC. The execlog plugin will have new options to demonstrate the new feature. I also have a plugin that uses this new feature to generate execution traces for Sniper processor simulator, which is available at: https://github.com/shioya-lab/sniper/tree/akihikodaki/bb Akihiko Odaki

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

2023-09-16 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 v8 05/19] target/ppc: Use GDBFeature for dynamic XML

2023-09-16 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 v8 09/19] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb

2023-09-16 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 v8 15/19] cpu: Call plugin hooks only when ready

2023-09-16 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.c

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

2023-09-16 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

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

2023-09-16 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 v8 16/19] plugins: Allow to read registers

2023-09-16 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 v8 11/19] gdbstub: Infer number of core registers from XML

2023-09-16 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 v8 14/19] gdbstub: Expose functions to read registers

2023-09-16 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 v8 02/19] gdbstub: Introduce gdb_find_static_feature()

2023-09-16 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 v8 12/19] hw/core/cpu: Remove gdb_get_dynamic_xml member

2023-09-16 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 v8 03/19] gdbstub: Introduce GDBFeatureBuilder

2023-09-16 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

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

2023-09-16 Thread Akihiko Odaki
On 2023/09/16 19:32, Huang Rui wrote: On Fri, Sep 15, 2023 at 11:20:46PM +0800, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init feature flags. We would like to enable the feature with virglrenderer, so add

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

2023-09-16 Thread Akihiko Odaki
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 Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: Patch "virtio-gpu: CONTEXT_INIT feature"

Re: [PATCH 10/11] net/eth: Clean up local variable shadowing

2023-09-01 Thread Akihiko Odaki
On 2023/09/01 7:56, Philippe Mathieu-Daudé wrote: Fix: net/eth.c:435:20: error: declaration shadows a local variable [-Werror,-Wshadow] size_t input_size = iov_size(pkt, pkt_frags); ^ net/eth.c:413:16: note: previous declaration is here size_t

[PATCH v3 11/12] gdbstub: Remove gdb_has_xml variable

2023-09-12 Thread Akihiko Odaki
GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki --- gdbstub/internals.h| 2 -- include/exec/gdbstub.h | 8 gdbstub/gdbstub.c | 15 --- 3 files changed, 25

[PATCH v3 06/12] target/arm: Move the reference to arm-core.xml

2023-09-12 Thread Akihiko Odaki
. Looking up arm-core.xml results in an error as it will not be embedded in the AArch64 build. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson --- target/arm/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 0bb0585441

[PATCH v3 07/12] hw/core/cpu: Return static value with gdb_arch_name()

2023-09-12 Thread Akihiko Odaki
() with const and make all of its implementations return static strings. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée --- include/hw/core/cpu.h | 2 +- target/ppc/internal.h | 2 +- gdbstub/gdbstub.c | 3 +-- target/arm/cpu.c | 6 +++--- target/arm/cpu64.c | 4

[PATCH v3 09/12] target/arm: Remove references to gdb_has_xml

2023-09-12 Thread Akihiko Odaki
GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki Acked-by: Alex Bennée --- target/arm/gdbstub.c | 32 ++-- 1 file changed, 2 insertions(+), 30 deletions

[PATCH v3 10/12] target/ppc: Remove references to gdb_has_xml

2023-09-12 Thread Akihiko Odaki
GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki --- target/ppc/gdbstub.c | 18 -- 1 file changed, 18 deletions(-) diff --git a/target/ppc/gdbstub.c b/target/ppc

[PATCH v3 04/12] contrib/plugins: Use GRWLock in execlog

2023-09-12 Thread Akihiko Odaki
he ptr array gets reallocated, the other threads may have a stale reference to the old buffer. This results in use-after-free. Use GRWLock to properly fix this issue. Fixes: 3d7caf145e ("contrib/plugins: add execlog to log instruction execution and memory access") Signed-off-by: Akihiko Od

[PATCH v3 05/12] gdbstub: Introduce GDBFeature structure

2023-09-12 Thread Akihiko Odaki
Before this change, the information from a XML file was stored in an array that is not descriptive. Introduce a dedicated structure type to make it easier to understand and to extend with more fields. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée

[PATCH v3 08/12] gdbstub: Use g_markup_printf_escaped()

2023-09-12 Thread Akihiko Odaki
g_markup_printf_escaped() is a safer alternative to simple printf() as it automatically escapes values. Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub

[PATCH v3 00/12] gdbstub and TCG plugin improvements

2023-09-12 Thread Akihiko Odaki
sed earlier and thus the Reviewed-by tag is dropped. V2 -> V3: Added patch "plugins: Check if vCPU is realized". V1 -> V2: Rebased. Added patch "gdbstub: Fix target_xml initialization". Added patch "gdbstub: Fix target.xml response". Added patch "

[PATCH v3 12/12] gdbstub: Replace gdb_regs with an array

2023-09-12 Thread Akihiko Odaki
An array is a more appropriate data structure than a list for gdb_regs since it is initialized only with append operation and read-only after initialization. Signed-off-by: Akihiko Odaki --- include/hw/core/cpu.h | 2 +- gdbstub/gdbstub.c | 34 -- 2 files

[PATCH v3 01/12] gdbstub: Fix target_xml initialization

2023-09-12 Thread Akihiko Odaki
target_xml is no longer a fixed-length array but a pointer to a variable-length memory. Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki --- gdbstub/softmmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub/softmmu.c

[PATCH v3 03/12] plugins: Check if vCPU is realized

2023-09-12 Thread Akihiko Odaki
: add core code") Signed-off-by: Akihiko Odaki --- plugins/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/core.c b/plugins/core.c index 3c4e26c7ed..fcd33a2bff 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -64,7 +64,7 @@ static void plugin_cpu_upda

[PATCH v3 02/12] gdbstub: Fix target.xml response

2023-09-12 Thread Akihiko Odaki
It was failing to return target.xml after the first request. Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index

Re: [PATCH v7 14/18] cpu: Call plugin hooks only when ready

2023-09-12 Thread Akihiko Odaki
On 2023/09/12 17:46, Philippe Mathieu-Daudé wrote: Hi Akihiko, On 12/9/23 09:12, Akihiko Odaki wrote: The initialization and exit hooks will not affect the state of vCPU, What about:  qemu_plugin_vcpu_init_hook()    -> plugin_cpu_update__locked()   -> plugin_cpu_update_

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Akihiko Odaki
On 2023/09/13 20:34, Albert Esteve wrote: On Wed, Sep 13, 2023 at 12:34 PM Akihiko Odaki <mailto:akihiko.od...@daynix.com>> wrote: On 2023/09/13 16:55, Albert Esteve wrote: > Hi Antonio, > > If I'm not mistaken, this patch is related with: >

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Akihiko Odaki
egards, Akihiko Odaki

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Akihiko Odaki
On 2023/09/13 21:58, Albert Esteve wrote: On Wed, Sep 13, 2023 at 2:22 PM Akihiko Odaki <mailto:akihiko.od...@daynix.com>> wrote: On 2023/09/13 20:34, Albert Esteve wrote: > > > On Wed, Sep 13, 2023 at 12:34 PM Akihiko Odaki mailto:akihik

[PATCH v2 00/11] gdbstub and TCG plugin improvements

2023-09-12 Thread Akihiko Odaki
sed earlier and thus the Reviewed-by tag is dropped. V1 -> V2: Rebased. Added patch "gdbstub: Fix target_xml initialization". Added patch "gdbstub: Fix target.xml response". Added patch "gdbstub: Replace gdb_regs with an array". Akihiko Odaki (11):

[PATCH v2 01/11] gdbstub: Fix target_xml initialization

2023-09-12 Thread Akihiko Odaki
target_xml is no longer a fixed-length array but a pointer to a variable-length memory. Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki --- gdbstub/softmmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub/softmmu.c

[PATCH v2 02/11] gdbstub: Fix target.xml response

2023-09-12 Thread Akihiko Odaki
It was failing to return target.xml after the first request. Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index

[PATCH v2 04/11] gdbstub: Introduce GDBFeature structure

2023-09-12 Thread Akihiko Odaki
Before this change, the information from a XML file was stored in an array that is not descriptive. Introduce a dedicated structure type to make it easier to understand and to extend with more fields. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée

[PATCH v2 03/11] contrib/plugins: Use GRWLock in execlog

2023-09-12 Thread Akihiko Odaki
he ptr array gets reallocated, the other threads may have a stale reference to the old buffer. This results in use-after-free. Use GRWLock to properly fix this issue. Fixes: 3d7caf145e ("contrib/plugins: add execlog to log instruction execution and memory access") Signed-off-by: Akihiko Od

[PATCH v2 05/11] target/arm: Move the reference to arm-core.xml

2023-09-12 Thread Akihiko Odaki
. Looking up arm-core.xml results in an error as it will not be embedded in the AArch64 build. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson --- target/arm/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 0bb0585441

[PATCH v2 11/11] gdbstub: Replace gdb_regs with an array

2023-09-12 Thread Akihiko Odaki
An array is a more appropriate data structure than a list for gdb_regs since it is initialized only with append operation and read-only after initialization. Signed-off-by: Akihiko Odaki --- include/hw/core/cpu.h | 2 +- gdbstub/gdbstub.c | 34 -- 2 files

[PATCH v2 07/11] gdbstub: Use g_markup_printf_escaped()

2023-09-12 Thread Akihiko Odaki
g_markup_printf_escaped() is a safer alternative to simple printf() as it automatically escapes values. Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub

[PATCH v2 09/11] target/ppc: Remove references to gdb_has_xml

2023-09-12 Thread Akihiko Odaki
GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki --- target/ppc/gdbstub.c | 18 -- 1 file changed, 18 deletions(-) diff --git a/target/ppc/gdbstub.c b/target/ppc

[PATCH v2 06/11] hw/core/cpu: Return static value with gdb_arch_name()

2023-09-12 Thread Akihiko Odaki
() with const and make all of its implementations return static strings. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-By: Michael Tokarev --- include/hw/core/cpu.h | 2 +- target/ppc/internal.h | 2 +- gdbstub/gdbstub.c | 3 +-- target

[PATCH v2 10/11] gdbstub: Remove gdb_has_xml variable

2023-09-12 Thread Akihiko Odaki
GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki --- gdbstub/internals.h| 2 -- include/exec/gdbstub.h | 8 gdbstub/gdbstub.c | 15 --- 3 files changed, 25

[PATCH v2 08/11] target/arm: Remove references to gdb_has_xml

2023-09-12 Thread Akihiko Odaki
GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki Acked-by: Alex Bennée --- target/arm/gdbstub.c | 32 ++-- 1 file changed, 2 insertions(+), 30 deletions

[PATCH v7 04/18] gdbstub: Introduce GDBFeatureBuilder

2023-09-12 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 v7 02/18] gdbstub: Introduce gdb_find_static_feature()

2023-09-12 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 v7 00/18] plugins: Allow to read registers

2023-09-12 Thread Akihiko Odaki
t long lines. (Philippe Mathieu-Daudé) Renamed gdb_features to gdb_static_features (Philippe Mathieu-Daudé) Dropped RFC. Akihiko Odaki (18): gdbstub: Add num_regs member to GDBFeature gdbstub: Introduce gdb_find_static_feature() hw/core/cpu: Replace gdb_core_xml_file with gdb_core_feature

[PATCH v7 18/18] contrib/plugins: Add cc plugin

2023-09-12 Thread Akihiko Odaki
This demonstrates how to write a plugin in C++. Signed-off-by: Akihiko Odaki --- docs/devel/tcg-plugins.rst | 8 configure | 15 --- contrib/plugins/Makefile | 5 + contrib/plugins/cc.cc | 17 + tests/tcg/Makefile.target | 3

[PATCH v7 05/18] target/arm: Use GDBFeature for dynamic XML

2023-09-12 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 | 20 +++--- target/arm

[PATCH v7 12/18] gdbstub: Add members to identify registers to GDBFeature

2023-09-12 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

[PATCH v7 15/18] plugins: Allow to read registers

2023-09-12 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 v7 03/18] hw/core/cpu: Replace gdb_core_xml_file with gdb_core_feature

2023-09-12 Thread Akihiko Odaki
will utilize additional information provided by GDBFeature to simplify XML file lookup. Signed-off-by: Akihiko Odaki --- include/hw/core/cpu.h | 5 +++-- target/s390x/cpu.h | 2 -- gdbstub/gdbstub.c | 6 +++--- target/arm/cpu.c| 4 ++-- target/arm/cpu64.c | 4 ++-- target/arm

[PATCH v7 09/18] gdbstub: Use GDBFeature for GDBRegisterState

2023-09-12 Thread Akihiko Odaki
Simplify GDBRegisterState by replacing num_regs and xml members with one member that points to GDBFeature. Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index a30ffdd6b8

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

2023-09-12 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 v7 06/18] target/ppc: Use GDBFeature for dynamic XML

2023-09-12 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 | 3 +-- target/ppc/cpu.h

[PATCH v7 17/18] plugins: Support C++

2023-09-12 Thread Akihiko Odaki
Make qemu-plugin.h consumable for C++ platform. Signed-off-by: Akihiko Odaki --- include/qemu/qemu-plugin.h | 4 1 file changed, 4 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 40aae8db68..55f514ca6c 100644 --- a/include/qemu/qemu-plugin.h +++ b

[PATCH v7 07/18] target/riscv: Use GDBFeature for dynamic XML

2023-09-12 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 | 4 +-- target/riscv/cpu.c | 4 +-- target/riscv

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

2023-09-12 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 v7 08/18] gdbstub: Use GDBFeature for gdb_register_coprocessor

2023-09-12 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 v7 11/18] hw/core/cpu: Remove gdb_get_dynamic_xml member

2023-09-12 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 v7 10/18] gdbstub: Simplify XML lookup

2023-09-12 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 --- gdbstub/gdbstub.c | 23 +-- 1 file changed, 9 insertions(+), 14

[PATCH v7 13/18] gdbstub: Expose functions to read registers

2023-09-12 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 | 50 +- 2 files changed, 54 insertions(+), 1

[PATCH v7 14/18] cpu: Call plugin hooks only when ready

2023-09-12 Thread Akihiko Odaki
The initialization and exit hooks will not affect the state of vCPU, 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.c| 11

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-09 Thread Akihiko Odaki
On 2023/09/09 18:09, Huang Rui wrote: On Thu, Aug 31, 2023 at 06:36:57PM +0800, Akihiko Odaki wrote: On 2023/08/31 18:32, Huang Rui wrote: From: Antonio Caggiano Enable resource UUID feature and implement command resource assign UUID. This is done by introducing a hash table to map resource

Re: [PATCH v2 15/22] net/eth: Clean up local variable shadowing

2023-09-09 Thread Akihiko Odaki
input_size = iov_size(pkt, pkt_frags); ^ Suggested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- net/eth.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/eth.c b/net/eth.c index 649e66bb1f..3f680cc033 100644 --- a/net/eth.c +++ b/net/eth.c @@ -432,8 +432,6

Re: [QEMU PATCH v4 11/13] virtio-gpu: Support Venus capset

2023-09-09 Thread Akihiko Odaki
On 2023/09/09 18:29, Huang Rui wrote: On Thu, Aug 31, 2023 at 06:43:17PM +0800, Akihiko Odaki wrote: On 2023/08/31 18:32, Huang Rui wrote: From: Antonio Caggiano Add support for the Venus capset, which enables Vulkan support through the Venus Vulkan driver for virtio-gpu. Signed-off

[PATCH] amd_iommu: Fix APIC address check

2023-09-09 Thread Akihiko Odaki
pport") Signed-off-by: Akihiko Odaki --- hw/i386/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 4655cd801f..3ac0d0098d 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1268,7 +1268,7 @@

Re: [PATCH RESEND v5 20/26] gdbstub: Remove gdb_has_xml variable

2023-08-30 Thread Akihiko Odaki
On 2023/08/31 0:02, Alex Bennée wrote: Akihiko Odaki writes: GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki In principle I'm fine with this but should we not catch GDB's which

Re: [PATCH 45/67] ui/vc: remove kby_put_keysym() and update function calls

2023-08-30 Thread Akihiko Odaki
On 2023/08/30 18:38, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau The function calls to `kbd_put_keysym` have been updated to now call `kbd_put_keysym_console` with a NULL console parameter. Like most console functions, NULL argument is now for the active console. This will

Re: [PATCH RESEND v5 24/26] contrib/plugins: Allow to log registers

2023-08-30 Thread Akihiko Odaki
On 2023/08/31 0:08, Alex Bennée wrote: Akihiko Odaki writes: 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 | 140 - 2 files changed, 117

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-08-31 Thread Akihiko Odaki
On 2023/08/31 18:32, Huang Rui wrote: From: Antonio Caggiano Enable resource UUID feature and implement command resource assign UUID. This is done by introducing a hash table to map resource IDs to their UUIDs. The hash table does not seem to be stored during migration. Signed-off-by:

Re: [PATCH v2 01/12] build: Only define OS_OBJECT_USE_OBJC with gcc

2023-08-31 Thread Akihiko Odaki
On 2023/08/31 17:59, Alexander Graf wrote: On 31.08.23 10:53, Akihiko Odaki wrote: On 2023/08/31 17:12, Philippe Mathieu-Daudé wrote: On 30/8/23 18:14, Alexander Graf wrote: Recent versions of macOS use clang instead of gcc. The OS_OBJECT_USE_OBJC define is only necessary when building

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

2023-08-31 Thread Akihiko Odaki
On 2023/08/31 18:32, 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 of her references have gone away, via the object's free callback. However, currently,

Re: [QEMU PATCH v4 11/13] virtio-gpu: Support Venus capset

2023-08-31 Thread Akihiko Odaki
On 2023/08/31 18:32, Huang Rui wrote: From: Antonio Caggiano Add support for the Venus capset, which enables Vulkan support through the Venus Vulkan driver for virtio-gpu. Signed-off-by: Antonio Caggiano Signed-off-by: Huang Rui --- hw/display/virtio-gpu-virgl.c | 21

Re: [PATCH v2 01/12] build: Only define OS_OBJECT_USE_OBJC with gcc

2023-08-31 Thread Akihiko Odaki
Silicon Mac that is incompatible with GCC. Regards, Akihiko Odaki

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

2023-08-31 Thread Akihiko Odaki
On 2023/08/31 18:32, 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 available and via the blob config. E.g. -device virtio-vga-gl,blob=true Signed-off-by: Antonio Caggiano

Re: [PATCH 1/2] igb: Add a VF reset handler

2023-08-29 Thread Akihiko Odaki
On 2023/08/29 18:05, Cédric Le Goater wrote: From: Cédric Le Goater Export the igb_vf_reset() helper routine from the PF model to let the IGBVF model implement its own device reset. Cc: Akihiko Odaki Suggested-by: Sriram Yagnaraman Signed-off-by: Cédric Le Goater Reviewed-by: Akihiko

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-14 Thread Akihiko Odaki
On 2023/09/14 17:29, Albert Esteve wrote: On Thu, Sep 14, 2023 at 9:17 AM Akihiko Odaki <mailto:akihiko.od...@daynix.com>> wrote: On 2023/09/13 23:18, Albert Esteve wrote: > > > On Wed, Sep 13, 2023 at 3:43 PM Akihiko Odaki mailto:akihik

Re: [PATCH v3 03/12] plugins: Check if vCPU is realized

2023-09-14 Thread Akihiko Odaki
On 2023/09/13 15:17, Philippe Mathieu-Daudé wrote: On 13/9/23 00:40, Akihiko Odaki wrote: The created member of CPUState tells if the vCPU thread is started, and will be always false for the user space emulation that manages threads independently. Per the docstring:  /**   * CPUState

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

2023-09-06 Thread Akihiko Odaki
On 2023/09/06 16:56, Huang Rui wrote: On Wed, Sep 06, 2023 at 11:39:09AM +0800, Akihiko Odaki wrote: On 2023/09/06 12:09, Huang Rui wrote: On Tue, Sep 05, 2023 at 05:20:43PM +0800, Akihiko Odaki wrote: On 2023/09/05 18:08, Huang Rui wrote: On Thu, Aug 31, 2023 at 06:24:32PM +0800, Akihiko

Re: [PATCH v2 1/7] tap: Fix virtio-net header buffer size

2023-10-11 Thread Akihiko Odaki
On 2023/10/11 15:43, Akihiko Odaki wrote: On 2023/10/10 16:56, Michael Tokarev wrote: 10.10.2023 05:59, Akihiko Odaki wrote: The largest possible virtio-net header is struct virtio_net_hdr_v1_hash. Fixes: fbbdbddec0 ("tap: allow extended virtio header with hash info") Signed-off-b

[PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()

2023-10-11 Thread Akihiko Odaki
It was necessary since an Linux older than 2.6.35 may implement the virtio-net header but may not allow to change its length. Remove it since such an old Linux is no longer supported. Signed-off-by: Akihiko Odaki --- net/tap_int.h | 1 - net/tap-bsd.c | 5 - net/tap-linux.c | 20

[PATCH v3 09/11] virtio-net: Return an error when vhost cannot enable RSS

2023-10-11 Thread Akihiko Odaki
is requested but not available. Assert RSS availability when the guest actually requests the feature. Signed-off-by: Akihiko Odaki --- ebpf/ebpf_rss.h | 2 +- ebpf/ebpf_rss-stub.c | 4 +- ebpf/ebpf_rss.c | 68 +- hw/net/virtio-net.c | 114

[PATCH v3 02/11] tap: Remove qemu_using_vnet_hdr()

2023-10-11 Thread Akihiko Odaki
(). Signed-off-by: Akihiko Odaki --- include/net/net.h | 6 -- hw/net/e1000e.c | 1 - hw/net/igb.c| 1 - hw/net/net_tx_pkt.c | 4 ++-- hw/net/virtio-net.c | 3 --- hw/net/vmxnet3.c| 2 -- net/dump.c | 4 +--- net/net.c | 18 -- net

[PATCH v3 00/11] virtio-net RSS/hash report fixes

2023-10-11 Thread Akihiko Odaki
quot;. Added patch "net: Remove receive_raw()". Added patch "tap: Shrink zeroed virtio-net header". Dropped patch "tap: Fix virtio-net header buffer size". V1 -> V2: Added patch "ebpf: Fix RSS error handling". Akihiko Odaki (11): tap: Remove tap

[PATCH v3 11/11] ebpf: Fix RSS error handling

2023-10-11 Thread Akihiko Odaki
calculate_rss_hash() was using hash value 0 to tell if it calculated a hash, but the hash value may be 0 on a rare occasion. Have a distinct bool value for correctness. Fixes: f3fa412de2 ("ebpf: Added eBPF RSS program.") Signed-off-by: Akihiko Odaki --- tools/ebpf/rss.

[PATCH v3 10/11] virtio-net: Do not clear VIRTIO_NET_F_RSS

2023-10-11 Thread Akihiko Odaki
is not loaded. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 20feb20bb1..31a32bdff9 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -775,9 +775,6 @@ static uint64_t

[PATCH v3 04/11] net: Remove receive_raw()

2023-10-11 Thread Akihiko Odaki
t;tap: allow extended virtio header with hash info") Signed-off-by: Akihiko Odaki --- include/net/filter.h| 3 --- include/net/net.h | 1 - include/net/queue.h | 7 - include/sysemu/replay.h | 2 +- net/dump.c | 4 +-- net/filter-buffer.c | 4 +--

[PATCH v3 07/11] virtio-net: Disable RSS on reset

2023-10-11 Thread Akihiko Odaki
RSS is disabled by default. Fixes: 590790297c ("virtio-net: implement RSS configuration command") Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 70 +++-- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/hw/net/virtio-net.

[PATCH v3 08/11] virtio-net: Unify the logic to update NIC state for RSS

2023-10-11 Thread Akihiko Odaki
The code to attach or detach the eBPF program to RSS were duplicated so unify them into one function to save some code. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 90 ++--- 1 file changed, 36 insertions(+), 54 deletions(-) diff --git a/hw/net

[PATCH v3 03/11] net: Move virtio-net header length assertion

2023-10-11 Thread Akihiko Odaki
The virtio-net header length assertion should happen for any clients. Signed-off-by: Akihiko Odaki --- net/net.c | 5 + net/tap.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/net.c b/net/net.c index 1bb4f33a63..6d2fa8d40f 100644 --- a/net/net.c +++ b/net/net.c

Re: [PATCH v9 23/23] plugins: Support C++

2023-10-11 Thread Akihiko Odaki
On 2023/10/11 17:51, Daniel P. Berrangé wrote: On Wed, Oct 11, 2023 at 04:03:09PM +0900, Akihiko Odaki wrote: Make qemu-plugin.h consumable for C++ platform. Signed-off-by: Akihiko Odaki --- docs/devel/tcg-plugins.rst | 4 meson.build| 2 +- include/qemu/qemu

[PATCH v3 05/11] tap: Shrink zeroed virtio-net header

2023-10-11 Thread Akihiko Odaki
tap prepends a zeroed virtio-net header when writing a packet to a tap with virtio-net header enabled but not in use. This only happens when s->host_vnet_hdr_len == sizeof(struct virtio_net_hdr). Signed-off-by: Akihiko Odaki --- net/tap.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH v3 06/11] virtio-net: Copy header only when necessary

2023-10-11 Thread Akihiko Odaki
o-net: reference implementation of hash report") Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index cab79f19cb..b1cc74881a 100644 --- a/hw/net/virtio-n

Re: [PATCH v9 23/23] plugins: Support C++

2023-10-11 Thread Akihiko Odaki
On 2023/10/12 1:21, Thomas Huth wrote: On 11/10/2023 17.48, Akihiko Odaki wrote: On 2023/10/11 17:51, Daniel P. Berrangé wrote: On Wed, Oct 11, 2023 at 04:03:09PM +0900, Akihiko Odaki wrote: Make qemu-plugin.h consumable for C++ platform. Signed-off-by: Akihiko Odaki ---   docs/devel/tcg

Re: [RFC PATCH v3 57/78] hw/net: add fallthrough pseudo-keyword

2023-10-13 Thread Akihiko Odaki
On 2023/10/13 17:46, Emmanouil Pitsidianakis wrote: In preparation of raising -Wimplicit-fallthrough to 5, replace all fall-through comments with the fallthrough attribute pseudo-keyword. Signed-off-by: Emmanouil Pitsidianakis --- hw/net/cadence_gem.c | 4 ++-- hw/net/can/can_sja1000.c

[PATCH v5 10/21] virtio-net: Unify the logic to update NIC state for RSS

2023-10-16 Thread Akihiko Odaki
The code to attach or detach the eBPF program to RSS were duplicated so unify them into one function to save some code. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 90 ++--- 1 file changed, 36 insertions(+), 54 deletions(-) diff --git a/hw/net

[PATCH v5 18/21] ebpf: Simplify error handling

2023-10-16 Thread Akihiko Odaki
The error handling procedures required when rss_bpf__open() and rss_bpf__load(rss_bpf_ctx) are different so it's better to implement them separately. Signed-off-by: Akihiko Odaki --- ebpf/ebpf_rss.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ebpf/ebpf_rss.c b

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