[PATCH v2 2/9] gdbstub: Move GdbCmdParseEntry into a new header file

2024-06-13 Thread Gustavo Romero
. This commit also makes gdb_put_packet public since is used in gdbstub command handling. Signed-off-by: Gustavo Romero --- gdbstub/gdbstub.c | 134 ++--- gdbstub/internals.h| 22 -- gdbstub/syscalls.c | 7 +- gdbstub/system.c | 7

Re: [PATCH v2 6/9] target/arm: Factor out code for setting MTE TCF0 field

2024-06-13 Thread Gustavo Romero
Hi Phil, On 6/13/24 2:35 PM, Philippe Mathieu-Daudé wrote: On 13/6/24 19:21, Gustavo Romero wrote: Factor out the code used for setting the MTE TCF0 field from the prctl code into a convenient function. Other subsystems, like gdbstub, need to set this field as well, so keep it as a separate

[PATCH v2 0/9] Add MTE stubs for aarch64 user mode

2024-06-13 Thread Gustavo Romero
and use gdb_hextomem instead - Rebased this series on Alex's gdb/next branch Cheers, Gustavo Gustavo Romero (9): gdbstub: Clean up process_string_cmd gdbstub: Move GdbCmdParseEntry into a new header file gdbstub: Add support for target-specific stubs target/arm: Fix exception case

[PATCH v2 3/9] gdbstub: Add support for target-specific stubs

2024-06-13 Thread Gustavo Romero
to extend the qSupported string, the query handler table, and the set handler table, allowing target-specific stub implementations. Signed-off-by: Gustavo Romero --- gdbstub/gdbstub.c | 59 ++ include/gdbstub/commands.h | 22 ++ 2 files

Re: [PATCH v2 5/9] target/arm: Make some MTE helpers widely available

2024-06-13 Thread Gustavo Romero
Hi Phil! On 6/13/24 2:32 PM, Philippe Mathieu-Daudé wrote: Hi Gustavo, On 13/6/24 19:20, Gustavo Romero wrote: Make the MTE helpers allocation_tag_mem_probe, load_tag1, and store_tag1 available to other subsystems by moving them from mte_helper.c to a new header file, mte_helper.h. Signed

[PATCH v2 5/9] target/arm: Make some MTE helpers widely available

2024-06-13 Thread Gustavo Romero
Make the MTE helpers allocation_tag_mem_probe, load_tag1, and store_tag1 available to other subsystems by moving them from mte_helper.c to a new header file, mte_helper.h. Signed-off-by: Gustavo Romero --- target/arm/tcg/mte_helper.c | 184 +-- target/arm/tcg

[PATCH v2 7/9] gdbstub: Make get cpu and hex conversion functions non-internal

2024-06-13 Thread Gustavo Romero
Make the gdb_first_attached_cpu and gdb_hextomem non-internal so they are not confined to use only in gdbstub.c. Signed-off-by: Gustavo Romero --- gdbstub/internals.h| 2 -- include/exec/gdbstub.h | 5 + include/gdbstub/commands.h | 6 ++ 3 files changed, 11 insertions(+), 2

[PATCH v2 6/9] target/arm: Factor out code for setting MTE TCF0 field

2024-06-13 Thread Gustavo Romero
-off-by: Gustavo Romero --- linux-user/aarch64/target_prctl.h | 22 ++--- target/arm/mte.h | 53 +++ 2 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 target/arm/mte.h diff --git a/linux-user/aarch64/target_prctl.h b/linux

[PATCH v2 1/9] gdbstub: Clean up process_string_cmd

2024-06-13 Thread Gustavo Romero
Change 'process_string_cmd' to return true on success and false on failure, instead of 0 and -1. Signed-off-by: Gustavo Romero --- gdbstub/gdbstub.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub

[PATCH v2 9/9] tests/tcg/aarch64: Add MTE gdbstub tests

2024-06-13 Thread Gustavo Romero
Add tests to exercise the MTE stubs. Signed-off-by: Gustavo Romero --- tests/tcg/aarch64/Makefile.target | 11 ++- tests/tcg/aarch64/gdbstub/test-mte.py | 86 ++ tests/tcg/aarch64/mte-8.c | 102 ++ 3 files changed, 197 insertions

[PATCH v2 4/9] target/arm: Fix exception case in allocation_tag_mem_probe

2024-06-13 Thread Gustavo Romero
If page in 'ptr_access' is inaccessible and probe is 'true' allocation_tag_mem_probe should not throw an exception, but currently it does, so fix it. Signed-off-by: Gustavo Romero --- target/arm/tcg/mte_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/arm/tcg/mte_helper.c

[PATCH v2 8/9] gdbstub: Add support for MTE in user mode

2024-06-13 Thread Gustavo Romero
fault type at runtime. Signed-off-by: Gustavo Romero --- configs/targets/aarch64-linux-user.mak | 2 +- gdb-xml/aarch64-mte.xml| 11 ++ target/arm/cpu.c | 1 + target/arm/gdbstub.c | 253 + target/arm/internals.h

[PATCH 2/4] gdbstub: Add support for MTE in user mode

2024-05-15 Thread Gustavo Romero
fault type at runtime. Signed-off-by: Gustavo Romero --- configs/targets/aarch64-linux-user.mak | 2 +- target/arm/cpu.c | 1 + target/arm/gdbstub.c | 321 + target/arm/internals.h | 2 + 4 files changed, 325

[PATCH 4/4] tests/tcg/aarch64: Add MTE gdbstub tests

2024-05-15 Thread Gustavo Romero
Add tests to exercise the MTE stubs. Signed-off-by: Gustavo Romero --- tests/tcg/aarch64/Makefile.target | 11 ++- tests/tcg/aarch64/gdbstub/test-mte.py | 86 ++ tests/tcg/aarch64/mte-8.c | 102 ++ 3 files changed, 197 insertions

[PATCH 3/4] tests: Gently exit from GDB when tests complete

2024-05-15 Thread Gustavo Romero
f abruptly calling exit() from the Python script. Signed-off-by: Gustavo Romero --- tests/guest-debug/test_gdbstub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/guest-debug/test_gdbstub.py b/tests/guest-debug/test_gdbstub.py index 7f71d34da1..46fbf98f0c 100644 -

[PATCH 1/4] gdbstub: Add support for target-specific stubs

2024-05-15 Thread Gustavo Romero
-specific stubs. Signed-off-by: Gustavo Romero --- gdbstub/gdbstub.c | 108 +++-- gdbstub/internals.h| 22 - gdbstub/syscalls.c | 1 + include/exec/gdbstub.h | 86 +++- 4 files changed, 147 insertions(+), 70

[PATCH 0/4] Add MTE stubs for aarch64 user mode

2024-05-15 Thread Gustavo Romero
be exercised, for example, this way: make GDB=~/.local/bin/gdb run-tcg-tests-aarch64-linux-user -j 32 Cheers, Gustavo Gustavo Romero (4): gdbstub: Add support for target-specific stubs gdbstub: Add support for MTE in user mode tests: Gently exit from GDB when tests complete tests/tcg/aarch64

Re: [PATCH v5 0/9] TCG plugins new inline operations

2024-05-02 Thread Gustavo Romero
Hi Pierrick, On 5/2/24 5:09 PM, Gustavo Romero wrote: On 5/2/24 4:45 PM, Pierrick Bouvier wrote: Hi Gustavo, On 5/2/24 12:16, Gustavo Romero wrote: Hi Pierrick, On 5/2/24 3:08 PM, Pierrick Bouvier wrote: This series implement two new operations for plugins: - Store inline allows to write

Re: [PATCH v5 0/9] TCG plugins new inline operations

2024-05-02 Thread Gustavo Romero
On 5/2/24 4:45 PM, Pierrick Bouvier wrote: Hi Gustavo, On 5/2/24 12:16, Gustavo Romero wrote: Hi Pierrick, On 5/2/24 3:08 PM, Pierrick Bouvier wrote: This series implement two new operations for plugins: - Store inline allows to write a specific value to a scoreboard. - Conditional callback

Re: [PATCH v5 0/9] TCG plugins new inline operations

2024-05-02 Thread Gustavo Romero
Hi Pierrick, On 5/2/24 3:08 PM, Pierrick Bouvier wrote: This series implement two new operations for plugins: - Store inline allows to write a specific value to a scoreboard. - Conditional callback executes a callback only when a given condition is true. The condition is evaluated inline.

Re: [PATCH 0/6] Add ivshmem-flat device

2024-04-22 Thread Gustavo Romero
Hi Markus, Thanks for interesting in the ivshmem-flat device. Bill Mills (cc:ed) is the best person to answer your question, so please find his answer below. On 2/28/24 3:29 AM, Markus Armbruster wrote: Gustavo Romero writes: [...] This patchset introduces a new device, ivshmem-flat

[PATCH v3 5/5] tests/tcg: Add multiarch test for Xfer:siginfo:read stub

2024-03-08 Thread Gustavo Romero
Add multiarch test for testing if Xfer:siginfo:read query is properly handled by gdbstub. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- tests/tcg/multiarch/Makefile.target | 10 ++- .../gdbstub/test-qxfer-siginfo-read.py| 26 +++ tests

[PATCH v3 1/5] gdbstub: Rename back gdb_handlesig

2024-03-08 Thread Gustavo Romero
Rename gdb_handlesig_reason back to gdb_handlesig. There is no need to add a wrapper for gdb_handlesig and rename it when a new parameter is added. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- gdbstub/user.c | 8 include/gdbstub

[PATCH v3 3/5] gdbstub: Save target's siginfo

2024-03-08 Thread Gustavo Romero
Save target's siginfo into gdbserver_state so it can be used later, for example, in any stub that requires the target's si_signo and si_code. This change affects only linux-user mode. Signed-off-by: Gustavo Romero Suggested-by: Richard Henderson --- bsd-user/main.c| 2 +- bsd-user

[PATCH v3 4/5] gdbstub: Add Xfer:siginfo:read stub

2024-03-08 Thread Gustavo Romero
, like the fault address/insn when the SIGSEGV is caught. Signed-off-by: Gustavo Romero --- gdbstub/gdbstub.c | 8 gdbstub/internals.h | 1 + gdbstub/user.c | 23 +++ 3 files changed, 32 insertions(+) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index

[PATCH v3 0/5] Add stub to handle Xfer:siginfo:read query

2024-03-08 Thread Gustavo Romero
/msg00423.html v2: https://lists.gnu.org/archive/html/qemu-devel/2024-03/msg01858.html Cheers, Gustavo Gustavo Romero (5): gdbstub: Rename back gdb_handlesig linux-user: Move tswap_siginfo out of target code gdbstub: Save target's siginfo gdbstub: Add Xfer:siginfo:read stub tests/tcg

[PATCH v3 2/5] linux-user: Move tswap_siginfo out of target code

2024-03-08 Thread Gustavo Romero
Move tswap_siginfo from target code to handle_pending_signal. This will allow some cleanups and having the siginfo ready to be used in gdbstub. Signed-off-by: Gustavo Romero Suggested-by: Richard Henderson Reviewed-by: Richard Henderson --- linux-user/aarch64/signal.c | 2 +- linux-user

Re: [PATCH v2 3/5] gdbstub: Save target's siginfo

2024-03-08 Thread Gustavo Romero
Hi Richard, On 3/7/24 6:09 PM, Richard Henderson wrote: On 3/7/24 08:26, Gustavo Romero wrote: Save target's siginfo into gdbserver_state so it can be used later, for example, in any stub that requires the target's si_signo and si_code. This change affects only linux-user mode. Signed-off

Re: [PATCH v2 4/5] gdbstub: Add Xfer:siginfo:read stub

2024-03-08 Thread Gustavo Romero
Hi Richard! On 3/7/24 6:13 PM, Richard Henderson wrote: On 3/7/24 08:26, Gustavo Romero wrote: +void gdb_handle_query_xfer_siginfo(GArray *params, void *user_ctx) +{ +    unsigned long offset, len; +    uint8_t *siginfo_offset; + +    offset = get_param(params, 0)->val_ul; +    len = get_pa

Re: [PATCH v2 3/5] gdbstub: Save target's siginfo

2024-03-08 Thread Gustavo Romero
Hi Alex, On 3/7/24 7:33 PM, Alex Bennée wrote: Richard Henderson writes: On 3/7/24 08:26, Gustavo Romero wrote: Save target's siginfo into gdbserver_state so it can be used later, for example, in any stub that requires the target's si_signo and si_code. This change affects only linux-user

Re: [PATCH 2/2] tests/tcg: Add multiarch test for Xfer:siginfo:read stub

2024-03-08 Thread Gustavo Romero
On 3/7/24 4:31 PM, Richard Henderson wrote: On 3/7/24 07:50, Gustavo Romero wrote: Hi Richard, On 3/4/24 7:51 PM, Richard Henderson wrote: On 3/4/24 10:59, Gustavo Romero wrote: Perhaps just abort for SIGABRT instead? Although this can make a simpler test, the test can't control

[PATCH v2 2/5] linux-user: Move tswap_siginfo out of target code

2024-03-07 Thread Gustavo Romero
Move tswap_siginfo from target code to handle_pending_signal. This will allow some cleanups and having the siginfo ready to be used in gdbstub. Signed-off-by: Gustavo Romero Suggested-by: Richard Henderson --- linux-user/aarch64/signal.c | 2 +- linux-user/alpha/signal.c | 2

[PATCH v2 5/5] tests/tcg: Add multiarch test for Xfer:siginfo:read stub

2024-03-07 Thread Gustavo Romero
Add multiarch test for testing if Xfer:siginfo:read query is properly handled by gdbstub. Signed-off-by: Gustavo Romero --- tests/tcg/multiarch/Makefile.target | 10 ++- .../gdbstub/test-qxfer-siginfo-read.py| 26 +++ tests/tcg/multiarch/segfault.c

[PATCH v2 4/5] gdbstub: Add Xfer:siginfo:read stub

2024-03-07 Thread Gustavo Romero
, like the fault address/insn when the SIGSEGV is caught. Signed-off-by: Gustavo Romero --- gdbstub/gdbstub.c | 8 gdbstub/internals.h | 1 + gdbstub/user-target.c | 23 +++ 3 files changed, 32 insertions(+) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c

[PATCH v2 3/5] gdbstub: Save target's siginfo

2024-03-07 Thread Gustavo Romero
Save target's siginfo into gdbserver_state so it can be used later, for example, in any stub that requires the target's si_signo and si_code. This change affects only linux-user mode. Signed-off-by: Gustavo Romero Suggested-by: Richard Henderson --- gdbstub/internals.h| 3 +++ gdbstub

[PATCH v2 1/5] gdbstub: Rename back gdb_handlesig

2024-03-07 Thread Gustavo Romero
Rename gdb_handlesig_reason back to gdb_handlesig. There is no need to add a wrapper for gdb_handlesig and rename it when a new parameter is added. Signed-off-by: Gustavo Romero --- gdbstub/user.c | 8 include/gdbstub/user.h | 15 ++- linux-user/main.c | 2

Re: [PATCH 1/2] gdbstub: Add Xfer:siginfo:read stub

2024-03-07 Thread Gustavo Romero
On 3/4/24 2:18 PM, Richard Henderson wrote: On 3/3/24 09:26, Gustavo Romero wrote: +    /* Filter out si_type from si_code. See comment in siginfo_noswap(). */ > +    tmp_siginfo = ts->sync_signal.info; +    tmp_siginfo.si_code = sextract32(tmp_siginfo.si_code, 0, 16); This is inc

Re: [PATCH 2/2] tests/tcg: Add multiarch test for Xfer:siginfo:read stub

2024-03-07 Thread Gustavo Romero
Hi Richard, On 3/4/24 7:51 PM, Richard Henderson wrote: On 3/4/24 10:59, Gustavo Romero wrote: Perhaps just abort for SIGABRT instead? Although this can make a simpler test, the test can't control the si_addr value easily, which I think is interesting to be tested. Why do you prefer SIGABRT

Re: [PATCH 2/2] tests/tcg: Add multiarch test for Xfer:siginfo:read stub

2024-03-04 Thread Gustavo Romero
Hi Richard! On 3/4/24 2:21 PM, Richard Henderson wrote: On 3/3/24 09:26, Gustavo Romero wrote: Add multiarch test for testing if Xfer:siginfo:read query is properly handled by gdbstub. Signed-off-by: Gustavo Romero ---   tests/tcg/multiarch/Makefile.target   | 10

[PATCH 2/2] tests/tcg: Add multiarch test for Xfer:siginfo:read stub

2024-03-03 Thread Gustavo Romero
Add multiarch test for testing if Xfer:siginfo:read query is properly handled by gdbstub. Signed-off-by: Gustavo Romero --- tests/tcg/multiarch/Makefile.target | 10 ++- .../gdbstub/test-qxfer-siginfo-read.py| 26 +++ tests/tcg/multiarch/segfault.c

[PATCH 1/2] gdbstub: Add Xfer:siginfo:read stub

2024-03-03 Thread Gustavo Romero
the fault address/insn when the SIGSEGV is caught. The siginfo is also used by GDB to find out the si_code automatically and show additional info to the user in some cases. This is only a QEMU user mode and Linux-only feature. Signed-off-by: Gustavo Romero --- gdbstub/gdbstub.c | 9

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

2024-02-22 Thread Gustavo Romero
://gitlab.com/qemu-project/qemu/-/issues/1134 Message-ID: <20231127052024.435743-2-gustavo.rom...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Gustavo Romero --- docs/system/devices/ivshmem-flat.rst | 33 ++ hw/misc/Kconfig | 5 + hw/misc/ivshmem-

[PATCH 0/6] Add ivshmem-flat device

2024-02-22 Thread Gustavo Romero
ort something like: *** Got interrupt at vector 0! *** Writting constant 0xb5b5b5b5 to shmem... done! *** Notifying back peer ID 6 at vector 0... Cheers, Gustavo Gustavo Romero (6): hw/misc/ivshmem: Add ivshmem-flat device hw/misc/ivshmem-flat: Allow device to wire itself on sysbus hw/arm

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

2024-02-22 Thread 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. Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231127052024.435743-5-gustavo.rom...@linaro.org> Signed-off-by: Gustavo Romero --- h

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

2024-02-22 Thread Gustavo Romero
: <20231127052024.435743-3-gustavo.rom...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Gustavo Romero --- tests/qtest/ivshmem-test.c | 113 ++ tests/qtest/ivshmem-utils.c | 156 tests/qtest/ivshmem-utils.h | 56 +

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

2024-02-22 Thread Gustavo Romero
to the MMIO region at 'x-bus-address-iomem', whilst the shared memory region start is mapped at address specified by 'x-bus-address-shmem'. Message-ID: <20231127052024.435743-2-gustavo.rom...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Gustavo Romero --- docs/system/d

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

2024-02-22 Thread Gustavo Romero
ed-off-by: Philippe Mathieu-Daudé Signed-off-by: Gustavo Romero --- tests/qtest/ivshmem-flat-test.c | 338 tests/qtest/meson.build | 2 + 2 files changed, 340 insertions(+) create mode 100644 tests/qtest/ivshmem-flat-test.c diff --git a/tests/qtest/ivshme

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

2024-02-22 Thread Gustavo Romero
Allow Arm machine lm3s6965evb and the mps2 ones, like the mps2-an385, to use the ivshmem-flat device. Message-ID: <20231127052024.435743-2-gustavo.rom...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Gustavo Romero --- hw/arm/mps2.c | 3 +++ hw/arm/stellaris

Re: [PATCH] test/qtest: Add an API function to capture IRQ toggling

2024-02-21 Thread Gustavo Romero
Hi Phil, Apologies, I missed this and I just found it when preparing now the v3 for ivshmem-flat. On 12/13/23 6:15 AM, Philippe Mathieu-Daudé wrote: On 13/11/23 18:33, Gustavo Romero wrote: Currently the QTest API does not provide a function to allow capturing when an IRQ line is toggled

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

2024-02-20 Thread Gustavo Romero
On 2/16/24 11:44 AM, Philippe Mathieu-Daudé wrote: 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

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

2024-02-20 Thread Gustavo Romero
On 2/16/24 11:44 AM, Philippe Mathieu-Daudé wrote: From: Gustavo Romero Add qtest for the ivshmem-flat device. This needs a commit message. All tests are failing is this commit due to the last changes. So we need to tweak it (see my comments inline). Also, I think we need to mark

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

2024-02-20 Thread Gustavo Romero
On 2/16/24 11:44 AM, Philippe Mathieu-Daudé wrote: 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

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

2024-02-20 Thread Gustavo Romero
Hi Phil, On 2/16/24 11:44 AM, Philippe Mathieu-Daudé wrote: 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 Thanks for the respin/split! I don't know if I should review it and you would send a

Re: [PATCH v3 0/6] target/arm: assorted mte fixes

2024-02-07 Thread Gustavo Romero
pecting no different result -- so: Tested-by: Gustavo Romero If that t-b tag doesn't make sense, feel free to drop it :) Thanks for fixing it! Cheers, Gustavo

Re: [PATCH v3 1/6] linux-user/aarch64: Choose SYNC as the preferred MTE mode

2024-02-07 Thread Gustavo Romero
On 2/6/24 11:52 PM, Richard Henderson wrote: The API does not generate an error for setting ASYNC | SYNC; that merely constrains the selection vs the per-cpu default. For qemu linux-user, choose SYNC as the default. Cc: qemu-sta...@nongnu.org Reported-by: Gustavo Romero Signed-off

Re: [PATCH v2 1/6] linux-user/aarch64: Extend PR_SET_TAGGED_ADDR_CTRL for FEAT_MTE3

2024-02-06 Thread Gustavo Romero
& PR_MTE_TCF_SYNC) { +tcf = 1; +} +env->cp15.sctlr_el[1] = deposit64(env->cp15.sctlr_el[1], 38, 2, tcf); /* * Write PR_MTE_TAG to GCR_EL1[Exclude]. Reviewed-by: Gustavo Romero

Re: [PATCH v2 0/6] target/arm: assorted mte fixes

2024-02-06 Thread Gustavo Romero
rget/arm/tcg/translate-sve.c| 80 ++- 7 files changed, 78 insertions(+), 66 deletions(-) Tested-by: Gustavo Romero Thanks!

[PATCH v2] docs/system/arm/virt.rst: Add note on CPU features off by default

2024-01-22 Thread Gustavo Romero
such features, must also turn on the feature using a machine option. Signed-off-by: Gustavo Romero --- docs/system/arm/virt.rst | 13 + 1 file changed, 13 insertions(+) diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst index c245c52b7a..1888e31956 100644 --- a/docs

[PATCH 2/4] tests/qtest: Reorganize common code in ivshmem-test

2023-11-26 Thread Gustavo Romero
been adapted to use the new ivhsmem utils. Adjustments in that sense have also been made to meson.build; also 'rt' have been removed as a lib dependency for ivhsmem-test.c. Two lines unrelated to these changes have had their line indentation also fixed in meson.build. Signed-off-by: Gustavo Romero

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

2023-11-26 Thread 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 --- hw/misc/{ivshmem.c => ivshmem-pci.c} | 0 hw/misc/meson.build | 2 +- 2 files changed, 1 insert

[PATCH 3/4] tests/qtest: Add ivshmem-flat test

2023-11-26 Thread Gustavo Romero
Add qtest for the ivshmem-flat device. Based-on: <20231113230149.321304-1-gustavo.rom...@linaro.org> Signed-off-by: Gustavo Romero --- tests/qtest/ivshmem-flat-test.c | 319 tests/qtest/meson.build | 2 + 2 files changed, 321 insertions(+) creat

[PATCH 1/4] Add ivshmem-flat device

2023-11-26 Thread Gustavo Romero
spectively. The device shared memory size can be set using the 'shmem-size' option and it defaults to 4 MiB, which is the default size of shmem allocated by the ivshmem server. Signed-off-by: Gustavo Romero --- docs/system/devices/ivshmem-flat.rst | 89 + hw/arm/mps2.c|

[PATCH 0/4] Add ivshmem-flat device

2023-11-26 Thread Gustavo Romero
3: 0 0 Data ok. 4194304 byte(s) checked. # The arm VM should report something like: *** Got interrupt at vector 0! *** Writting constant 0xb5b5b5b5 to shmem... done! *** Notifying back peer ID 6 at vector 0... Cheers, Gustavo Gustavo Romero (4): Add ivshmem-flat device tests/qtest: Reorg

[PATCH v2] test/qtest: Add API functions to capture IRQ toggling

2023-11-13 Thread Gustavo Romero
). Signed-off-by: Gustavo Romero --- tests/qtest/libqtest.c | 24 tests/qtest/libqtest.h | 28 2 files changed, 52 insertions(+) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index f33a210861..6ada4cae6e 100644 --- a/tests/qtest

Re: [PATCH] test/qtest: Add an API function to capture IRQ toggling

2023-11-13 Thread Gustavo Romero
Hi Thomas and Phil, On 11/13/23 7:14 AM, Philippe Mathieu-Daudé wrote: On 13/11/23 07:59, Thomas Huth wrote: On 12/11/2023 02.38, Gustavo Romero wrote: Currently the QTest API does not provide a function to allow capturing when an IRQ line is toggled (raised then lowered). Functions like

Re: QTest framework does not capture toggled irq line

2023-11-11 Thread Gustavo Romero
On 11/10/23 3:16 AM, Thomas Huth wrote: On 10/11/2023 04.40, Gustavo Romero wrote: Hi folks, I'm writing a test for a device that has one IRQ output line that is toggled (raised then lowered) by the device to trigger a CPU interrupt. Afaics the QTest framework does not provide a way

[PATCH] test/qtest: Add an API function to capture IRQ toggling

2023-11-11 Thread Gustavo Romero
introduces a new function, qtest_get_irq_trigger_counter(), which returns the number of times a given intercepted IRQ line was triggered (raised), hence allowing to capture when an IRQ line was toggled. Signed-off-by: Gustavo Romero --- tests/qtest/libqtest.c | 12 tests/qtest

QTest framework does not capture toggled irq line

2023-11-09 Thread Gustavo Romero
Hi folks, I'm writing a test for a device that has one IRQ output line that is toggled (raised then lowered) by the device to trigger a CPU interrupt. Afaics the QTest framework does not provide a way to capture when an output line is raised because the API functions, e.g. qtest_get_irq(), read

Re: [PATCH] configure: Fail when specified cross compiler cannot be found

2020-12-17 Thread Gustavo Romero
Hi Alex, On 12/16/20 7:51 AM, Alex Bennée wrote: Gustavo Romero writes: Currently if the cross compiler passed to 'configure' (--cross-cc-) does not exist no error happens and only later when the TCG tests are run they fail because the cross compiler is not set correctly. Do

[PATCH v2 6/7] target/ppc: Add support for prefixed load/store FP instructions

2020-12-16 Thread Gustavo Romero
From: Michael Roth This commit adds support for the following load/store instructions for FP registers: plf, plfd pstfs, pstfd Signed-off-by: Michael Roth Signed-off-by: Gustavo Romero --- target/ppc/translate/fp-impl.c.inc | 48 ++ target/ppc/translate/fp

[PATCH v2 5/7] tests/tcg: Add tests for paired vector load/store instructions

2020-12-16 Thread Gustavo Romero
-by: Gustavo Romero --- tests/tcg/ppc64le/Makefile.target | 9 + .../test-paired-load-store-vsx.c | 567 ++ 2 files changed, 576 insertions(+) create mode 100644 tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c diff --git a/tests/tcg

[PATCH v2 4/7] target/ppc: Add support for paired vector load/store instructions

2020-12-16 Thread Gustavo Romero
- fix build when target != PPC64 ] Sgined-off-by: Gustavo Romero --- target/ppc/helper.h | 3 ++ target/ppc/internal.h | 7 +++ target/ppc/mem_helper.c | 61 ++ target/ppc/translate.c | 8 target/ppc

[PATCH v2 7/7] tests/tcg: Add tests for prefixed load/store FP instructions

2020-12-16 Thread Gustavo Romero
From: Michael Roth Signed-off-by: Michael Roth [ gromero: - tweaks in debug output ] Signed-off-by: Gustavo Romero --- tests/tcg/ppc64le/Makefile.target | 4 + .../test-prefixed-load-store-fp.c | 270 ++ 2 files changed, 274 insertions(+) create mode

[PATCH v2 2/7] target/ppc: Add support for prefixed load/store instructions

2020-12-16 Thread Gustavo Romero
!= TARGET_PPC64 - removed redundant PREFIX_R bit helper - changes in commit log ] Signed-off-by: Gustavo Romero --- target/ppc/internal.h | 6 + target/ppc/translate.c | 264 + 2 files changed, 270 insertions(+) diff --git a/target

[PATCH v2 3/7] tests/tcg: Add tests for prefixed load/store instructions

2020-12-16 Thread Gustavo Romero
branch insn. - tweaks in debug output - commit log ] Signed-off-by: Gustavo Romero --- tests/tcg/ppc64 | 1 + tests/tcg/ppc64le/Makefile.target | 16 + .../test-prefixed-load-store.c| 945 ++ 3 files

[PATCH v2 1/7] target/ppc: Add infrastructure for prefixed instructions

2020-12-16 Thread Gustavo Romero
and updates - additional comments in the commit log ] Signed-off-by: Gustavo Romero --- target/ppc/cpu.h| 30 +- target/ppc/internal.h | 14 +++ target/ppc/translate.c | 170 +++- target/ppc/translate_init.c.inc | 11 ++- 4

[PATCH v2 0/7] PPC64: Add support for the new prefixed instructions

2020-12-16 Thread Gustavo Romero
This series aims to add support for the new prefixed instructions introduced with POWER10 CPUs (ISA v3.1). v2: - Fixes accordingly to Alex Bennée's review: Removed fixes for BUILD_DIR and quiet-command since they are already upstream. Reverted all the tests to ppc64le-linux-user as they

[PATCH] configure: Fail when specified cross compiler cannot be found

2020-12-15 Thread Gustavo Romero
cannot be found, displaying an error similar to the following: $ ../configure --target-list=ppc64-softmmu --cross-cc-ppc64=nonexisting_gcc Specified cross-compiler 'nonexisting_gcc' not found! Signed-off-by: Gustavo Romero --- configure | 2 +- tests/tcg/configure.sh | 4 +++- 2 files

[Bug 1900241] Re: [regression][powerpc] some vcpus are found offline inside guest with different vsmt setting from qemu-cmdline and breaks subsequent vcpu hotplug operation (xive)

2020-10-29 Thread Gustavo Romero
** Changed in: qemu Assignee: (unassigned) => Gustavo Romero (gromero) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1900241 Title: [regression][powerpc] some vcpus are found offline ins

Re: [PATCH] spapr/xive: Use xive_source_esb_len()

2020-08-13 Thread Gustavo Romero
On 8/13/20 7:00 PM, Greg Kurz wrote: On Thu, 13 Aug 2020 17:38:59 -0300 Gustavo Romero wrote: Hi Greg, Hi Gustavo, On 8/13/20 2:28 PM, Greg Kurz wrote: static inline size_t xive_source_esb_len(XiveSource *xsrc) { return (1ull << xsrc->esb_shift) * xsrc->nr_irqs; }

Re: [PATCH] spapr/xive: Use xive_source_esb_len()

2020-08-13 Thread Gustavo Romero
Hi Greg, On 8/13/20 2:28 PM, Greg Kurz wrote: static inline size_t xive_source_esb_len(XiveSource *xsrc) { return (1ull << xsrc->esb_shift) * xsrc->nr_irqs; } Signed-off-by: Greg Kurz --- Follow-up on "ppc/xive: Rework setup of XiveSource::esb_mmio"

Re: [PATCH v2] target/ppc: Integrate icount to purr, vtb, and tbu40

2020-08-12 Thread Gustavo Romero
On 8/12/20 9:03 PM, David Gibson wrote: On Wed, Aug 12, 2020 at 02:33:33PM -0700, Richard Henderson wrote: On 8/11/20 8:32 AM, Gustavo Romero wrote: Currently if option '-icount auto' is passed to the QEMU TCG to enable counting instructions the VM crashes with the following error report when

[PATCH v2] target/ppc: Integrate icount to purr, vtb, and tbu40

2020-08-11 Thread Gustavo Romero
in docs/devel/tcg-icount.rst. Signed-off-by: Gustavo Romero --- target/ppc/translate_init.inc.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index 7e66822b5d..ccf9ce3441 100644 --- a/target

Re: [PATCH] target/ppc: Integrate icount to purr, vtb, and tbu40

2020-08-11 Thread Gustavo Romero
On 8/11/20 11:24 AM, Peter Maydell wrote: On Tue, 11 Aug 2020 at 14:33, Gustavo Romero wrote: On 8/11/20 6:31 AM, Peter Maydell wrote: You don't want to call gen_io_end; you just need to ensure that you end the TB immediately after this insn. See docs/devel/tcg-icount.rst. I understand

Re: [PATCH] target/ppc: Integrate icount to purr, vtb, and tbu40

2020-08-11 Thread Gustavo Romero
Hi Peter, On 8/11/20 6:31 AM, Peter Maydell wrote: On Tue, 11 Aug 2020 at 02:29, Gustavo Romero wrote: Currently if option '-icount auto' is passed to the QEMU TCG to enable counting instructions the VM crashes with the following error report when Linux runs on it: qemu-system-ppc64: Bad

[PATCH] target/ppc: Integrate icount to purr, vtb, and tbu40

2020-08-10 Thread Gustavo Romero
to the icount framework. This commit fixes that issue by making the read/write access of these SPRs aware of icount framework, adding the proper gen_io_start/end() calls before/after calling the helpers to load/store these SPRs in TCG. Signed-off-by: Gustavo Romero --- target/ppc/translate_init.inc.c

[PATCH] ppc/xive: Fix some typos in comments

2020-07-22 Thread Gustavo Romero
Fix some typos in comments about code modeling coalescing points in the XIVE routing engine (IVRE). Signed-off-by: Gustavo Romero --- hw/intc/xive.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 9a16243..9b55e03 100644 --- a/hw