[PATCH 0/3] Misc: Make watchdog devices using qemu_system_reset_request() use watchdog_perfom_action()

2024-02-16 Thread Abhiram Tilak
A few watchdog devices use qemu_system_reset_request(). This is not ideal since behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`. As stated in BiteSizedTasks wiki page, instead of using qemu_system_reset_request() to reset when a watchdog timer expires, let watchdog_per

[PATCH 1/3] misc: m48t59: replace qemu_system_reset_request() call with watchdog_perform_action()

2024-02-16 Thread Abhiram Tilak
A few watchdog devices use qemu_system_reset_request(). This is not ideal since behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`. As stated in BiteSizedTasks wiki page, instead of using qemu_system_reset_request() to reset when a watchdog timer expires, let watchdog_per

[PATCH 3/3] misc: ppc/spapr: replace qemu_system_reset_request() calls with watchdog_perform_action()

2024-02-16 Thread Abhiram Tilak
A few watchdog devices use qemu_system_reset_request(). This is not ideal since behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`. As stated in BiteSizedTasks wiki page, instead of using qemu_system_reset_request() to reset when a watchdog timer expires, let watchdog_per

[PATCH 2/3] misc: pxa2xx_timer: replace qemu_system_reset_request() call with watchdog_perform_action()

2024-02-16 Thread Abhiram Tilak
A few watchdog devices use qemu_system_reset_request(). This is not ideal since behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`. As stated in BiteSizedTasks wiki page, instead of using qemu_system_reset_request() to reset when a watchdog timer expires, let watchdog_per

[PATCH v2 2/3] trans_rvv.c.inc: remove redundant mark_vs_dirty() calls

2024-02-16 Thread Daniel Henrique Barboza
trans_vmv_v_i , trans_vfmv_v_f and the trans_##NAME macro from GEN_VMV_WHOLE_TRANS() are calling mark_vs_dirty() in both branches of their 'ifs'. conditionals. Call it just once in the end like other functions are doing. Signed-off-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_r

[PATCH v2 3/3] target/riscv/translate.c: set vstart_eq_zero in mark_vs_dirty()

2024-02-16 Thread Daniel Henrique Barboza
The 'vstart_eq_zero' flag which is used to determine if some insns, like vector reductor operations, should SIGILL. At this moment the flag is being updated only during cpu_get_tb_cpu_state(), at the start of each translation block. This cadence isn't enough and we're facing situations where a vec

[PATCH v2 0/3] riscv: set vstart_eq_zero on mark_vs_dirty

2024-02-16 Thread Daniel Henrique Barboza
Hi, This second version is based on feedback gave on the Gitlab bug [1] by Vladimir Isaev. For this approach to work the 'vstart_eq_zero' flag must be updated regardless of 'mstatus_vs' being marked as DIRTY or not - there's no guarantee that we'll clean mstatus_vs after each change in 'vstart'.

[PATCH v2 1/3] trans_rvv.c.inc: write CSRs must call mark_vs_dirty() too

2024-02-16 Thread Daniel Henrique Barboza
In the Vector spec section 3.2 [1]: "When mstatus.VS is set to Initial or Clean, executing any instruction that changes vector state, including the vector CSRs, will change mstatus.VS to Dirty." ldst_us_trans(), ldst_stride_trans(), ldst_index_trans() and ldst_whole_trans() will change vector s

Re: [PATCH 0/3] riscv: set vstart_eq_zero on mark_vs_dirty

2024-02-16 Thread Daniel Henrique Barboza
Hi, Please disregard this version. I just posted a v2 after feedback from people in Gitlab. Thanks, Daniel On 2/16/24 08:28, Daniel Henrique Barboza wrote: Hi, This is my shot to fix https://gitlab.com/qemu-project/qemu/-/issues/1976. First patch ensures that every vector instruction that c

[PATCH v2 6/6] tests/qtest: Add ivshmem-flat test

2024-02-16 Thread Philippe Mathieu-Daudé
From: Gustavo Romero Add qtest for the ivshmem-flat device. Signed-off-by: Gustavo Romero Message-ID: <20231127052024.435743-4-gustavo.rom...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/ivshmem-flat-test.c | 320 tests/qtest/meson.build

[PATCH v2 5/6] tests/qtest: Reorganize common code in ivshmem-test

2024-02-16 Thread Philippe Mathieu-Daudé
From: Gustavo Romero This commit reorganizes the ivshmem-test qtest by moving common structs, functions, and code that can be utilized by other ivshmem qtests into two new files: ivshmem-utils.h and ivshmem-utils.c. Enum Reg, struct ServerThread, and mktempshm() have been relocated to these new

[PATCH v2 4/6] hw/misc/ivshmem: Rename ivshmem to ivshmem-pci

2024-02-16 Thread Philippe Mathieu-Daudé
From: Gustavo Romero Because now there is also an MMIO ivshmem device (ivshmem-flat.c), and ivshmem.c is a PCI specific implementation, rename it to ivshmem-pci.c. Signed-off-by: Gustavo Romero Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231127052024.435743-5-gustavo.rom...@linaro.org>

[PATCH v2 0/6] Add ivshmem-flat device

2024-02-16 Thread Philippe Mathieu-Daudé
This is a respin of Gustavo's v1 [3]. Since v1: - Respin splitting controversial code in another patch - For minor changes see notes in patch #1 -- This patchset introduces a new device, ivshmem-flat, which is similar to the current ivshmem device but does not require a PCI bus. It implements th

[PATCH v2 2/6] hw/misc/ivshmem-flat: Allow device to wire itself on sysbus

2024-02-16 Thread Philippe Mathieu-Daudé
From: Gustavo Romero The following is an example on how to create the ivshmem-flat device on a Stellaris machine: $ qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -net none -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=

[PATCH v2 3/6] hw/arm: Allow some machines to use the ivshmem-flat device

2024-02-16 Thread Philippe Mathieu-Daudé
From: Gustavo Romero Signed-off-by: Gustavo Romero Message-ID: <20231127052024.435743-2-gustavo.rom...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/mps2.c | 3 +++ hw/arm/stellaris.c | 3 +++ hw/arm/virt.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/hw/arm/

[PATCH v2 1/6] hw/misc/ivshmem: Add ivshmem-flat device

2024-02-16 Thread Philippe Mathieu-Daudé
From: Gustavo Romero Add a new device, ivshmem-flat, which is similar to the ivshmem PCI but does not require a PCI bus. It's meant to be used on machines like those with Cortex-M MCUs, which usually lack a PCI/PCIe bus, e.g. lm3s6965evb and mps2-an385. The device currently only supports the sys

Re: [PATCH 1/3] misc: m48t59: replace qemu_system_reset_request() call with watchdog_perform_action()

2024-02-16 Thread Peter Maydell
On Fri, 16 Feb 2024 at 13:56, Abhiram Tilak wrote: > > A few watchdog devices use qemu_system_reset_request(). This is not ideal > since > behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`. > As stated in BiteSizedTasks wiki page, instead of using > qemu_system_reset_r

Re: [PATCH 2/3] misc: pxa2xx_timer: replace qemu_system_reset_request() call with watchdog_perform_action()

2024-02-16 Thread Peter Maydell
On Fri, 16 Feb 2024 at 13:56, Abhiram Tilak wrote: > > A few watchdog devices use qemu_system_reset_request(). This is not ideal > since > behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`. > As stated in BiteSizedTasks wiki page, instead of using > qemu_system_reset_r

Re: [PATCH 3/3] misc: ppc/spapr: replace qemu_system_reset_request() calls with watchdog_perform_action()

2024-02-16 Thread Peter Maydell
On Fri, 16 Feb 2024 at 13:56, Abhiram Tilak wrote: > > A few watchdog devices use qemu_system_reset_request(). This is not ideal > since > behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`. > As stated in BiteSizedTasks wiki page, instead of using > qemu_system_reset_r

[PATCH 07/16] qapi: Improve error message for empty doc sections

2024-02-16 Thread Markus Armbruster
Improve the message for an empty tagged section from empty doc section 'Note' to text required after 'Note:' and the message for an empty argument or feature description from empty doc section 'foo' to text required after '@foo:' Improve the error position to refer to the be

[PATCH 00/16] qapi: Doc comment parsing & doc generation work

2024-02-16 Thread Markus Armbruster
This series tightens doc comment syntax, and makes the doc comment parser easier to maintain. * PATCH 01-03: Fix and extend tests * PATCH 04: Drop dead code * PATCH 05-07: Improve error messages * PATCH 08-13: Clean up code and tighten doc comment syntax * PATCH 14: Rewrite the doc comment parser

[PATCH 15/16] qapi: Reject multiple and empty feature descriptions

2024-02-16 Thread Markus Armbruster
The parser recognizes only the first "Features:" line. Any subsequent ones are treated as ordinary text, as visible in test case doc-duplicate-features. Recognize "Features:" lines anywhere. A second one is an error. A 'Features:' line without any features is useless, but not an error. Make it

[PATCH 04/16] sphinx/qapidoc: Drop code to generate doc for simple union branch

2024-02-16 Thread Markus Armbruster
Commit 4e99f4b12c0 (qapi: Drop simple unions) eliminated implicitly defined union branch types, except for the empty object type 'q_empty'. QAPISchemaGenRSTVisitor._nodes_for_members() still has code to generate documentation for implicitly defined union branch types. It does nothing for 'q_empty

[PATCH 05/16] qapi: Improve error position for bogus argument descriptions

2024-02-16 Thread Markus Armbruster
When documented arguments don't exist, the error message points to the beginning of the definition comment. Point to the first bogus argument description instead. Signed-off-by: Markus Armbruster --- scripts/qapi/parser.py | 4 +++- tests/qapi-schema/doc-bad-alternate-m

[PATCH 06/16] qapi: Improve error position for bogus invalid "Returns" section

2024-02-16 Thread Markus Armbruster
When something other than a command has a "Returns" section, the error message points to the beginning of the definition comment. Point to the "Returns" section instead. Signed-off-by: Markus Armbruster --- scripts/qapi/parser.py | 10 +++--- tests/qapi-schema/doc-invalid-

[PATCH 14/16] qapi: Rewrite doc comment parser

2024-02-16 Thread Markus Armbruster
QAPISchemaParser is a conventional recursive descent parser. Except QAPISchemaParser.get_doc() delegates most of the doc comment parsing work to a state machine in QAPIDoc. The state machine doesn't get tokens like a recursive descent parser, it is fed tokens. I find this state machine rather op

[PATCH 12/16] qapi: Call QAPIDoc.check() always

2024-02-16 Thread Markus Armbruster
We currently call QAPIDoc.check() only for definition documentation. Calling it for free-form documentation as well is simpler. No change, because it doesn't actually do anything there. Signed-off-by: Markus Armbruster --- scripts/qapi/schema.py | 7 ++- 1 file changed, 2 insertions(+), 5 d

[PATCH 01/16] tests/qapi-schema: Fix test 'QAPI rST doc'

2024-02-16 Thread Markus Armbruster
The test compares Sphinx plain-text output against a golden reference. To work on Windows hosts, it filters out carriage returns in both files. Unfortunately, the filter doesn't work: it creates an empty file. Comparing empty files always succeeds. Fix the filter, and update the golden reference

[PATCH 11/16] qapi: Recognize section tags and 'Features:' only after blank line

2024-02-16 Thread Markus Armbruster
Putting a blank line before section tags and 'Features:' is good, existing practice. Enforce it. Signed-off-by: Markus Armbruster --- docs/devel/qapi-code-gen.rst | 15 +-- scripts/qapi/parser.py | 11 --- tests/qapi-schema/doc-duplicate

[PATCH 13/16] qapi: Merge adjacent untagged sections

2024-02-16 Thread Markus Armbruster
The parser mostly doesn't create adjacent untagged sections, and merging the ones it does create is hardly worth the bother. I'm doing it to avoid behavioral change in the next commit. Signed-off-by: Markus Armbruster --- scripts/qapi/parser.py | 3 +++ tests/qapi-schema/doc-e

[PATCH 03/16] tests/qapi-schema: Cover 'Features:' not followed by descriptions

2024-02-16 Thread Markus Armbruster
A 'Features:' line without any features is useless, but not an error now. However, a later commit will make it one, because that makes rejecting duplicate 'Features:' easier. Signed-off-by: Markus Armbruster --- tests/qapi-schema/doc-empty-features.err | 0 tests/qapi-schema/doc-empty-feature

[PATCH 09/16] qapi: Reject section heading in the middle of a doc comment

2024-02-16 Thread Markus Armbruster
docs/devel/qapi-code-gen.txt claims "A heading line must be the first line of the documentation comment block" since commit 55ec69f8b16 (docs/devel/qapi-code-gen.txt: Update to new rST backend conventions). Not true, we have code to make it work anywhere in a free-form doc comment: commit dcdc07a9

[PATCH 02/16] tests/qapi-schema: Cover duplicate 'Features:' line

2024-02-16 Thread Markus Armbruster
We don't actually recognize the second 'Features:' line. Instead, we treat it as an untagged section. If it was followed by feature description, we'd reject that like "description of '@feat2:' follows a section". Less than clear. To be improved shortly. Signed-off-by: Markus Armbruster --- t

[PATCH 08/16] qapi: Rename QAPIDoc.Section.name to .tag

2024-02-16 Thread Markus Armbruster
Since the previous commit, QAPIDoc.Section.name is either None (untagged section) or the section's tag string ('Returns', '@name', ...). Rename it to .tag. Signed-off-by: Markus Armbruster --- docs/sphinx/qapidoc.py | 6 +++--- scripts/qapi/parser.py | 30 +++---

[PATCH 16/16] qapi: Divorce QAPIDoc from QAPIParseError

2024-02-16 Thread Markus Armbruster
QAPIDoc stores a reference to QAPIParser just to pass it to QAPIParseError. The resulting error position depends on the state of the parser. It happens to be the current comment line. Servicable, but action at a distance. The commit before previous moved most uses of QAPIParseError from QAPIDoc

[PATCH] hw/sysbus: Inline and remove sysbus_add_io()

2024-02-16 Thread Philippe Mathieu-Daudé
sysbus_add_io(...) is a simple wrapper to memory_region_add_subregion(get_system_io(), ...). It is used in 3 places; inline it directly. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/sysbus.h | 2 -- hw/core/sysbus.c| 6 -- hw/i386/kvmvapic.c | 2 +- hw/mips/mipssim.c | 2 +- h

Re: [PATCH 1/4] target/riscv: Add CSR tcontrol of debug trigger module

2024-02-16 Thread Daniel Henrique Barboza
On 2/16/24 10:42, Alvin Che-Chia Chang(張哲嘉) wrote: Hi Daniel, -Original Message- From: Daniel Henrique Barboza Sent: Friday, February 16, 2024 8:51 PM To: Alvin Che-Chia Chang(張哲嘉) ; qemu-ri...@nongnu.org; qemu-devel@nongnu.org Cc: alistair.fran...@wdc.com; bin.m...@windriver.com; l

Re: [PATCH 1/4] target/riscv: Add CSR tcontrol of debug trigger module

2024-02-16 Thread Daniel Henrique Barboza
On 2/16/24 03:13, Alvin Chang wrote: The RISC-V debug specification defines an optional CSR "tcontrol" within the trigger module. This commit adds its read/write operations and related bit-field definitions. Signed-off-by: Alvin Chang --- Reviewed-by: Daniel Henrique Barboza target/ri

Re: [PATCH v2] hw/hppa/Kconfig: Fix building with "configure --without-default-devices"

2024-02-16 Thread Paolo Bonzini
On Fri, Feb 16, 2024 at 10:16 AM Thomas Huth wrote: > > When running "configure" with "--without-default-devices", building > of qemu-system-hppa currently fails with: > > /usr/bin/ld: libqemu-hppa-softmmu.fa.p/hw_hppa_machine.c.o: in function > `machine_HP_common_init_tail': > hw/hppa/machine.

Re: [PATCH v3 3/6] target/riscv: add remaining named features

2024-02-16 Thread Conor Dooley
> > No they can't. For a "regular extension" you populate the DT with the > > extension. For these extensions it has to put negated properties in the > > DT, otherwise it is incorrectly describing the hardware it is emulating. > > That is handling them differently in my book! If QEMU generates an >

Re: [RFC PATCH 14/14] migration: Fix return-path thread exit

2024-02-16 Thread Cédric Le Goater
Hello Fabiano On 2/14/24 21:35, Fabiano Rosas wrote: Cédric Le Goater writes: Hello Fabiano On 2/8/24 14:29, Fabiano Rosas wrote: Cédric Le Goater writes: In case of error, close_return_path_on_source() can perform a shutdown to exit the return-path thread. However, in migrate_fd_cleanu

Re: [PATCH v3 3/6] target/arm: Adjust and validate mtedesc sizem1

2024-02-16 Thread Michael Tokarev
07.02.2024 05:52, Richard Henderson : When we added SVE_MTEDESC_SHIFT, we effectively limited the maximum size of MTEDESC. Adjust SIZEM1 to consume the remaining bits (32 - 10 - 5 - 12 == 5). Assert that the data to be stored fits within the field (expecting 8 * 4 - 1 == 31, exact fit). Cc: qe

Re: [PATCH 13/14] migration: Use migrate_has_error() in close_return_path_on_source()

2024-02-16 Thread Cédric Le Goater
On 2/14/24 17:00, Fabiano Rosas wrote: Cédric Le Goater writes: On 2/8/24 14:57, Fabiano Rosas wrote: Cédric Le Goater writes: On 2/8/24 14:07, Fabiano Rosas wrote: Cédric Le Goater writes: close_return_path_on_source() retrieves the migration error from the the QEMUFile '->to_dst_file

[PATCH 2/6] hw/display/pl110: Pass frame buffer memory region as link property

2024-02-16 Thread Philippe Mathieu-Daudé
Add the PL110::'framebuffer-memory' property. Have the different ARM boards set it. We don't need to call sysbus_address_space() anymore. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/realview.c| 2 ++ hw/arm/versatilepb.c | 2 ++ hw/arm/vexpress.c| 5 + hw/display/pl110.c |

[PATCH 0/6] hw: Remove sysbus_address_space()

2024-02-16 Thread Philippe Mathieu-Daudé
Pass address space as link property for devices where it seems to matter, otherwise just use get_system_memory(). Philippe Mathieu-Daudé (6): hw/arm: Inline sysbus_create_simple(PL110 / PL111) hw/display/pl110: Pass frame buffer memory region as link property hw/arm/exynos4210: Inline sysbus

[PATCH 3/6] hw/arm/exynos4210: Inline sysbus_create_varargs(EXYNOS4210_FIMD)

2024-02-16 Thread Philippe Mathieu-Daudé
We want to set another qdev property (a link) for the FIMD device, we can not use sysbus_create_varargs() which only passes sysbus base address and IRQs as arguments. Inline it so we can set the link property in the next commit. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/exynos4210.c | 12

[PATCH 6/6] hw/sysbus: Remove now unused sysbus_address_space()

2024-02-16 Thread Philippe Mathieu-Daudé
sysbus_address_space() is not more used, remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/sysbus.h | 1 - hw/core/sysbus.c| 5 - 2 files changed, 6 deletions(-) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 3564b7b6a2..01d4a400c6 100644 --- a/include/hw/sys

[PATCH 4/6] hw/display/exynos4210_fimd: Pass frame buffer memory region as link

2024-02-16 Thread Philippe Mathieu-Daudé
Add the Exynos4210fimdState::'framebuffer-memory' property. Have the board set it. We don't need to call sysbus_address_space() anymore. Signed-off-by: Philippe Mathieu-Daudé --- hw/display/exynos4210_fimd.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a

[PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111)

2024-02-16 Thread Philippe Mathieu-Daudé
We want to set another qdev property (a link) for the pl110 and pl111 devices, we can not use sysbus_create_simple() which only passes sysbus base address and IRQs as arguments. Inline it so we can set the link property in the next commit. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/realvie

[PATCH 5/6] hw/i386/kvmvapic: Inline sysbus_address_space()

2024-02-16 Thread Philippe Mathieu-Daudé
sysbus_address_space(...) is a simple wrapper to get_system_memory(). Use it in place, since KVM VAPIC doesn't distinct address spaces. Rename the 'as' variable as 'mr' since it is a MemoryRegion type, not an AddressSpace one. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/kvmvapic.c | 12 ++

Re: [PATCH] .gitlab-ci/windows.yml: Don't install libusb or spice packages on 32-bit

2024-02-16 Thread Alex Bennée
Peter Maydell writes: > On Fri, 16 Feb 2024 at 11:29, Alex Bennée wrote: >> >> Peter Maydell writes: >> >> > When msys2 updated their libusb packages to libusb 1.0.27, they >> > dropped support for building them for mingw32, leaving only mingw64 >> > packages. This broke our CI job, as the 'pa

Re: [PATCH v4 00/18] TCG Plugin inline operation enhancement

2024-02-16 Thread Alex Bennée
Pierrick Bouvier writes: > This series adds a new thread-safe API to declare inline operation > inside plugins. As well, it removes the existing non thread-safe API, > and migrates all existing plugins to use it. > > Tested on Linux (user, system) for i386, x86_64 and aarch64. > > Pierrick Bouvi

[PATCH 00/23] maintainer updates for 9.0 pre-PR (tests, plugin register support)

2024-02-16 Thread Alex Bennée
The test patch is a simple house keeping one to clean up some inadvertent GPLv3 tagging to GPLv2-or-later. The main bulk of this series is register reading support for TCG plugins. The main change to the API is that the get/read_register functions are now implicitly vCPU context only so have dropp

[PATCH 02/23] target/arm: Use GDBFeature for dynamic XML

2024-02-16 Thread Alex Bennée
From: 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 Message-Id: <20240103173349.398526-27-al

[PATCH 01/23] tests/tcg: update licenses to GPLv2 as intended

2024-02-16 Thread Alex Bennée
My default header template is GPLv3 but for QEMU code we really should stick to GPLv2-or-later (allowing others to up-license it if they wish). While this is test code we should still be consistent on the source distribution. I wrote all of this code so its not a problem. However there remains one

[PATCH 13/23] plugins: add qemu_plugin_num_vcpus function

2024-02-16 Thread Alex Bennée
From: Pierrick Bouvier We now keep track of how many vcpus were started. This way, a plugin can easily query number of any vcpus at any point of execution, which unifies user and system mode workflows. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20240213094009.1

[PATCH 05/23] gdbstub: Use GDBFeature for gdb_register_coprocessor

2024-02-16 Thread Alex Bennée
From: 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: A

[PATCH 06/23] gdbstub: Use GDBFeature for GDBRegisterState

2024-02-16 Thread Alex Bennée
From: 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 Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240103173349.398526-31-alex.ben...@linaro.org> Message-Id: <2

[PATCH 10/23] hw/core/cpu: Remove gdb_get_dynamic_xml member

2024-02-16 Thread Alex Bennée
From: Akihiko Odaki This function is no longer used. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20240103173349.398526-35-alex.ben...@linaro.org> Message-Id: <20231213-gdb-v17-9-777047380...@daynix.com> Signed-off-by: Alex Bennée --- include/hw/core/cpu.h | 4 ta

[PATCH 04/23] target/riscv: Use GDBFeature for dynamic XML

2024-02-16 Thread Alex Bennée
From: 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 Message-Id: <20240103173349.398526-29-alex.ben...@linaro.org> Message

[PATCH 08/23] gdbstub: Simplify XML lookup

2024-02-16 Thread Alex Bennée
From: 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 Message-Id: <20240103173349.398526-33-alex.ben..

[PATCH 07/23] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb

2024-02-16 Thread Alex Bennée
From: 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

[PATCH 03/23] target/ppc: Use GDBFeature for dynamic XML

2024-02-16 Thread Alex Bennée
From: 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 Message-Id: <20240103173349.398526-28

[PATCH 11/23] gdbstub: Add members to identify registers to GDBFeature

2024-02-16 Thread Alex Bennée
From: 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 Message-Id: <20240103173349.398526-36-alex.ben...@linaro.org> Message-Id

[PATCH 12/23] plugins: remove previous n_vcpus functions from API

2024-02-16 Thread Alex Bennée
From: Pierrick Bouvier This information is already accessible using qemu_info_t during plugin install. We will introduce another function (qemu_plugin_num_vcpus) which represent how many cpus were enabled, by tracking new cpu indexes. It's a breaking change, so we bump API version. Signed-off-

[PATCH 09/23] gdbstub: Infer number of core registers from XML

2024-02-16 Thread Alex Bennée
From: Akihiko Odaki GDBFeature has the num_regs member so use it where applicable to remove magic numbers. Signed-off-by: Akihiko Odaki Message-Id: <20240103173349.398526-34-alex.ben...@linaro.org> Message-Id: <20231213-gdb-v17-8-777047380...@daynix.com> Signed-off-by: Alex Bennée --- include

[PATCH 19/23] contrib/plugins: fix imatch

2024-02-16 Thread Alex Bennée
We can't directly save the ephemeral imatch from argv as that memory will get recycled. Message-Id: <20240103173349.398526-40-alex.ben...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- contrib/plugins/execlog.c | 2 +- 1 file

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

2024-02-16 Thread Alex Bennée
From: Akihiko Odaki This avoids optimizations incompatible when reading registers. Signed-off-by: Akihiko Odaki Reviewed-by: Pierrick Bouvier Message-Id: <20240103173349.398526-37-alex.ben...@linaro.org> Message-Id: <20231213-gdb-v17-12-777047380...@daynix.com> Signed-off-by: Alex Bennée Revi

[PATCH 17/23] gdbstub: expose api to find registers

2024-02-16 Thread Alex Bennée
Expose an internal API to QEMU to return all the registers for a vCPU. The list containing the details required to called gdb_read_register(). Based-on: <20231025093128.33116-15-akihiko.od...@daynix.com> Cc: Akihiko Odaki Message-Id: <20240103173349.398526-38-alex.ben...@linaro.org> Signed-off-by

[PATCH 14/23] plugins: fix order of init/idle/resume callback

2024-02-16 Thread Alex Bennée
From: Pierrick Bouvier We found that vcpu_init_hook was called *after* idle callback. vcpu_init is called from cpu_realize_fn, while idle/resume cb are called from qemu_wait_io_event (in vcpu thread). This change ensures we only call idle and resume cb only once a plugin was init for a given vcp

[PATCH 22/23] docs/devel: document some plugin assumptions

2024-02-16 Thread Alex Bennée
While we attempt to hide implementation details from the plugin we shouldn't be totally obtuse. Let the user know what they can and can't expect with the various instrumentation options. Message-Id: <20240103173349.398526-44-alex.ben...@linaro.org> Reviewed-by: Pierrick Bouvier Signed-off-by: Ale

[PATCH 20/23] contrib/plugins: extend execlog to track register changes

2024-02-16 Thread Alex Bennée
With the new plugin register API we can now track changes to register values. Currently the implementation is fairly dumb which will slow down if a large number of register values are being tracked. This could be improved by only instrumenting instructions which mention registers we are interested

[PATCH 15/23] cpu: call plugin init hook asynchronously

2024-02-16 Thread Alex Bennée
From: Pierrick Bouvier This ensures we run during a cpu_exec, which allows to call start/end exclusive from this init hook (needed for new scoreboard API introduced later). async work is run before any tb is translated/executed, so we can guarantee plugin init will be called before any other hoo

[PATCH 18/23] plugins: add an API to read registers

2024-02-16 Thread Alex Bennée
We can only request a list of registers once the vCPU has been initialised so the user needs to use either call the get function on vCPU initialisation or during the translation phase. We don't expose the reg number to the plugin instead hiding it behind an opaque handle. This allows for a bit of

[PATCH 23/23] docs/devel: plugins can trigger a tb flush

2024-02-16 Thread Alex Bennée
From: Pierrick Bouvier When scoreboards need to be reallocated. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20240213094009.150349-8-pierrick.bouv...@linaro.org> Signed-off-by: Alex Bennée --- docs/devel/multi-thread-tcg.rst | 1 + 1 file changed, 1 insertion(+

[PATCH 21/23] docs/devel: lift example and plugin API sections up

2024-02-16 Thread Alex Bennée
This makes them a bit more visible in the TCG emulation menu rather than hiding them away bellow the ToC limit. Message-Id: <20240103173349.398526-43-alex.ben...@linaro.org> Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- docs/devel/tcg-plugins.

Re: [PATCH v3 01/11] gdbstub: Support disablement in a multi-threaded process

2024-02-16 Thread Alex Bennée
Ilya Leoshkevich writes: > The upcoming follow-fork-mode child support will require disabling > gdbstub in the parent process, which may have multiple threads (which > are represented as CPUs). > > Loop over all CPUs in order to remove breakpoints and disable > single-step. Move the respective co

Re: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111)

2024-02-16 Thread BALATON Zoltan
On Fri, 16 Feb 2024, Philippe Mathieu-Daudé wrote: We want to set another qdev property (a link) for the pl110 and pl111 devices, we can not use sysbus_create_simple() which only passes sysbus base address and IRQs as arguments. Inline it so we can set the link property in the next commit. Signe

RE: [PATCH v3 2/3] Hexagon (target/hexagon) Pass SP explicitly to helpers that need it

2024-02-16 Thread Brian Cain
> -Original Message- > From: Taylor Simpson > Sent: Tuesday, February 13, 2024 10:27 PM > To: qemu-devel@nongnu.org > Cc: Brian Cain ; Matheus Bernardino (QUIC) > ; Sid Manning ; Marco > Liebel (QUIC) ; richard.hender...@linaro.org; > phi...@linaro.org; a...@rev.ng; a...@rev.ng; ltaylors

RE: [PATCH v3 2/3] Hexagon (target/hexagon) Pass SP explicitly to helpers that need it

2024-02-16 Thread Brian Cain
> -Original Message- > From: Taylor Simpson > Sent: Tuesday, February 13, 2024 10:27 PM > To: qemu-devel@nongnu.org > Cc: Brian Cain ; Matheus Bernardino (QUIC) > ; Sid Manning ; Marco > Liebel (QUIC) ; richard.hender...@linaro.org; > phi...@linaro.org; a...@rev.ng; a...@rev.ng; ltaylors

RE: [PATCH v3 1/3] Hexagon (target/hexagon) Pass P0 explicitly to helpers that need it

2024-02-16 Thread Brian Cain
> -Original Message- > From: Taylor Simpson > Sent: Tuesday, February 13, 2024 10:27 PM > To: qemu-devel@nongnu.org > Cc: Brian Cain ; Matheus Bernardino (QUIC) > ; Sid Manning ; Marco > Liebel (QUIC) ; richard.hender...@linaro.org; > phi...@linaro.org; a...@rev.ng; a...@rev.ng; ltaylors

Re: [PATCH v2 2/3] hw/cxl/cxl-mailbox-utils: Add device patrol scrub control feature

2024-02-16 Thread fan
On Fri, Feb 16, 2024 at 10:16:12AM +, Shiju Jose wrote: > Hi Fan, > > >-Original Message- > >From: fan > >Sent: 15 February 2024 18:47 > >To: Shiju Jose > >Cc: qemu-devel@nongnu.org; linux-...@vger.kernel.org; Jonathan Cameron > >; tanxiaofei ; > >Zengtao (B) ; Linuxarm ; > >fan...@s

Re: [RFC PATCH 14/14] migration: Fix return-path thread exit

2024-02-16 Thread Fabiano Rosas
Cédric Le Goater writes: > Hello Fabiano > > On 2/14/24 21:35, Fabiano Rosas wrote: >> Cédric Le Goater writes: >> >>> Hello Fabiano >>> >>> On 2/8/24 14:29, Fabiano Rosas wrote: Cédric Le Goater writes: > In case of error, close_return_path_on_source() can perform a shutdown >>>

Re: [PATCH v3 02/11] {linux,bsd}-user: Update ts_tid after fork()

2024-02-16 Thread Alex Bennée
Ilya Leoshkevich writes: > Currently ts_tid contains the parent tid after fork(), which is not > correct. So far it has not affected anything, but the upcoming > follow-fork-mode child support relies on the correct value, so fix it. > > Signed-off-by: Ilya Leoshkevich > --- > bsd-user/main.c

Re: [PATCH v3 03/11] gdbstub: Introduce gdbserver_fork_start()

2024-02-16 Thread Alex Bennée
Ilya Leoshkevich writes: > The upcoming follow-fork-mode child support requires knowing when > fork() is about to happen in order to initialize its state. Add a hook > for that. > > Signed-off-by: Ilya Leoshkevich Reviewed-by: Alex Bennée -- Alex Bennée Virtualisation Tech Lead @ Linaro

Re: [PATCH v3 04/11] {linux,bsd}-user: Pass pid to fork_end()

2024-02-16 Thread Alex Bennée
Ilya Leoshkevich writes: > The upcoming follow-fork-mode child support requires knowing the child > pid. Pass it down. > > Signed-off-by: Ilya Leoshkevich > --- > bsd-user/freebsd/os-proc.h | 6 +++--- > bsd-user/main.c | 4 +++- > bsd-user/qemu.h | 2 +- > linux-user/m

[RFC] Convert VMWARE vmdk (snapshot) to raw disk

2024-02-16 Thread Jinpu Wang
Hi, We want to convert some VMWARE VM to KVM, and to reduce the VM down time, we want to do it in two steps copy approach: 1. a snapshot is taken - source VM continues to run on VMware => diff creates 2. snapshot is available for download as vmdk - we need a software to copy snapshot to target V

Re: [PATCH 3/3] misc: ppc/spapr: replace qemu_system_reset_request() calls with watchdog_perform_action()

2024-02-16 Thread atp exp
I will exclude this patch from the series for now. According to the discussions, the current code honours the guest's preference. Will wait for the enhancements needed in watchdog QAPI. Abhiram On Fri, 16 Feb 2024 at 20:24, Peter Maydell wrote: > On Fri, 16 Feb 2024 at 13:56, Abhiram Tilak wro

[PATCH] configure: do not require gcc runtime library for firmwares

2024-02-16 Thread Marek Marczykowski-Górecki
probe_target_compiler() when checking for multilib support checks if -nostdlib works together with -lgcc. It isn't necessary for building various components in pc-bios/optionrom, as evidenced by looking at actually used link flags there. Alpine Linux for x86_64 does not ship with 32bit libgcc, but

Re: [PATCH v3 1/3] hw/cxl/cxl-mailbox-utils: Add support for feature commands (8.2.9.6)

2024-02-16 Thread fan
On Thu, Feb 15, 2024 at 07:01:44PM +0800, shiju.j...@huawei.com wrote: > From: Shiju Jose > > CXL spec 3.1 section 8.2.9.6 describes optional device specific features. > CXL devices supports features with changeable attributes. > Get Supported Features retrieves the list of supported device speci

Re: [PATCH v3 2/3] hw/cxl/cxl-mailbox-utils: Add device patrol scrub control feature

2024-02-16 Thread fan
On Thu, Feb 15, 2024 at 07:01:45PM +0800, shiju.j...@huawei.com wrote: > From: Shiju Jose > > CXL spec 3.1 section 8.2.9.9.11.1 describes the device patrol scrub control > feature. The device patrol scrub proactively locates and makes corrections > to errors in regular cycle. The patrol scrub con

Re: [PATCH 1/3] misc: m48t59: replace qemu_system_reset_request() call with watchdog_perform_action()

2024-02-16 Thread atp exp
I agree, comment here is redundant, i will fix it in the next patch. Abhiram On Fri, 16 Feb 2024 at 20:19, Peter Maydell wrote: > On Fri, 16 Feb 2024 at 13:56, Abhiram Tilak wrote: > > > > A few watchdog devices use qemu_system_reset_request(). This is not > ideal since > > behaviour of watchd

Re: [PATCH v3 3/3] hw/cxl/cxl-mailbox-utils: Add device DDR5 ECS control feature

2024-02-16 Thread fan
On Thu, Feb 15, 2024 at 07:01:46PM +0800, shiju.j...@huawei.com wrote: > 56.china.huawei.com (7.191.161.198) > Status: O > Content-Length: 7949 > Lines: 181 > > From: Shiju Jose > > CXL spec 3.1 section 8.2.9.9.11.2 describes the DDR5 Error Check Scrub (ECS) > control feature. > > The Error

Re: [PATCH v2 3/3] target/riscv/translate.c: set vstart_eq_zero in mark_vs_dirty()

2024-02-16 Thread Richard Henderson
On 2/16/24 03:57, Daniel Henrique Barboza wrote: The 'vstart_eq_zero' flag which is used to determine if some insns, like vector reductor operations, should SIGILL. At this moment the flag is being updated only during cpu_get_tb_cpu_state(), at the start of each translation block. This cadence i

Re: [PATCH v2 1/3] trans_rvv.c.inc: write CSRs must call mark_vs_dirty() too

2024-02-16 Thread Richard Henderson
On 2/16/24 03:57, Daniel Henrique Barboza wrote: In the Vector spec section 3.2 [1]: "When mstatus.VS is set to Initial or Clean, executing any instruction that changes vector state, including the vector CSRs, will change mstatus.VS to Dirty." ldst_us_trans(), ldst_stride_trans(), ldst_inde

Re: [PATCH v3 3/6] target/arm: Adjust and validate mtedesc sizem1

2024-02-16 Thread Richard Henderson
On 2/16/24 05:12, Michael Tokarev wrote: 07.02.2024 05:52, Richard Henderson : When we added SVE_MTEDESC_SHIFT, we effectively limited the maximum size of MTEDESC.  Adjust SIZEM1 to consume the remaining bits (32 - 10 - 5 - 12 == 5).  Assert that the data to be stored fits within the field (expe

[PATCH v2 1/2] misc: m48t59: replace qemu_system_reset_request() call with watchdog_perform_action()

2024-02-16 Thread Abhiram Tilak
A few watchdog devices use qemu_system_reset_request(). This is not ideal since behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`. As stated in BiteSizedTasks wiki page, instead of using qemu_system_reset_request() to reset when a watchdog timer expires, let watchdog_per

[PATCH v2 0/2] Misc: Make watchdog devices using qemu_system_reset_request() use watchdog_perfom_action()

2024-02-16 Thread Abhiram Tilak
A few watchdog devices use qemu_system_reset_request(). This is not ideal since behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`. As stated in BiteSizedTasks wiki page, instead of using qemu_system_reset_request() to reset when a watchdog timer expires, let watchdog_per

[PATCH v2 2/2] misc: pxa2xx_timer: replace qemu_system_reset_request() call with watchdog_perform_action()

2024-02-16 Thread Abhiram Tilak
A few watchdog devices use qemu_system_reset_request(). This is not ideal since behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`. As stated in BiteSizedTasks wiki page, instead of using qemu_system_reset_request() to reset when a watchdog timer expires, let watchdog_per

Re: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111)

2024-02-16 Thread Philippe Mathieu-Daudé
On 16/2/24 18:14, BALATON Zoltan wrote: On Fri, 16 Feb 2024, Philippe Mathieu-Daudé wrote: We want to set another qdev property (a link) for the pl110 and pl111 devices, we can not use sysbus_create_simple() which only passes sysbus base address and IRQs as arguments. Inline it so we can set the

<    1   2   3   >