Re: [PATCH V2] arm/kvm: add support for MTE

2024-09-18 Thread Gustavo Romero
Hi Ganapatrao, On 9/12/24 06:16, Ganapatrao Kulkarni wrote: Extend the 'mte' property for the virt machine to cover KVM as well. For KVM, we don't allocate tag memory, but instead enable the capability. If MTE has been enabled, we need to disable migration, as we do not yet have a way to migrat

Re: [PATCH V2] arm/kvm: add support for MTE

2024-09-18 Thread Gustavo Romero
Hi Cornelia and Ganapatrao, On 9/17/24 11:13, Cornelia Huck wrote: On Thu, Sep 12 2024, Ganapatrao Kulkarni wrote: Extend the 'mte' property for the virt machine to cover KVM as well. For KVM, we don't allocate tag memory, but instead enable the capability. If MTE has been enabled, we need

[PATCH v4 4/5] tests/tcg/aarch64: Improve linker script organization

2024-09-06 Thread Gustavo Romero
Improve kernel.ld linker script organization by using MEMORY command. Signed-off-by: Richard Henderson Signed-off-by: Gustavo Romero --- tests/tcg/aarch64/system/kernel.ld | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/tcg/aarch64/system

[PATCH v4 1/5] gdbstub: Use specific MMU index when probing MTE addresses

2024-09-06 Thread Gustavo Romero
byte), rather than the number of bits used in the address space pointed to by ptr. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- target/arm/gdbstub64.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/target/arm/gdbstub64.c b/target/arm

[PATCH v4 5/5] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-09-06 Thread Gustavo Romero
nst boot.S and is executed by QEMU in system mode. Signed-off-by: Gustavo Romero --- configure | 5 + tests/tcg/aarch64/Makefile.softmmu-target | 49 +- tests/tcg/aarch64/Makefile.target | 3 +- tests/tcg/aarch64/gdbstub/test-mte.py

[PATCH v4 2/5] gdbstub: Add support for MTE in system mode

2024-09-06 Thread Gustavo Romero
This commit makes handle_q_memtag, handle_q_isaddresstagged, and handle_Q_memtag stubs build for system mode, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system mode. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/620 Signed-off-by: Gust

[PATCH v4 3/5] tests/guest-debug: Support passing arguments to the GDB test script

2024-09-06 Thread Gustavo Romero
t if, for instance, the caller of the runner script passes an invalid argument or misses a required argument by the test script. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée --- tests/guest-debug/run-test.py | 6 ++ tests/guest-debug/test_gdbstub.py | 5 + 2 files cha

[PATCH v4 0/5] gdbstub: Add support for MTE in system mode

2024-09-06 Thread Gustavo Romero
ve linker script organization (Richard's review) Cheers, Gustavo Gustavo Romero (5): gdbstub: Use specific MMU index when probing MTE addresses gdbstub: Add support for MTE in system mode tests/guest-debug: Support passing arguments to the GDB test script tests/tcg/aarch64: Improve l

Re: [PATCH v3 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-08-30 Thread Gustavo Romero
Hi Richard, On 8/29/24 7:16 PM, Richard Henderson wrote: On 8/30/24 06:13, Gustavo Romero wrote:    1 .text 1e60  40001000  40001000  00011000  2**12    4 .data 00012000  4020  4020  0002  2**12 4040 g   .data

Re: [PATCH v3 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-08-29 Thread Gustavo Romero
Hi Richard, On 8/28/24 9:43 PM, Richard Henderson wrote: On 8/28/24 04:01, Gustavo Romero wrote:   SECTIONS   { -    /* virt machine, RAM starts at 1gb */ +    /* Skip first 1 GiB on virt machine: RAM starts at 1 GiB. */   . = (1 << 30); Better is to use MEMORY {   RAM (rwx) :

Re: [PATCH RFC V3 00/29] Support of Virtual CPU Hotplug for ARMv8 Arch

2024-08-28 Thread Gustavo Romero
Hi Salil, On 6/13/24 8:36 PM, Salil Mehta via wrote: PROLOGUE To assist in review and set the right expectations from this RFC, please first read the sections *APPENDED AT THE END* of this cover letter: 1. Important *DISCLAIMER* [Section (X)] 2. Work presented at KVMForum Conference (

Re: [PATCH RFC V3 24/29] target/arm: Add support of *unrealize* ARMCPU during vCPU Hot-unplug

2024-08-28 Thread Gustavo Romero
Hi Salil, On 8/19/24 9:35 AM, Salil Mehta via wrote: Hi Alex, From: Alex Bennée Sent: Friday, August 16, 2024 4:37 PM To: Salil Mehta Salil Mehta writes: > vCPU Hot-unplug will result in QOM CPU object unrealization which will > do away with all the vCPU thread creations,

Re: [PATCH v3 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-08-27 Thread Gustavo Romero
Hi Phil, On 8/27/24 9:42 AM, Gustavo Romero wrote: Hi Phil! On 8/26/24 3:10 AM, Philippe Mathieu-Daudé wrote: Hi Gustavo, On 25/8/24 16:52, Gustavo Romero wrote: Extend MTE gdbstub tests to also run in system mode (share tests between user mode and system mode). The tests will only run if a

Re: [PATCH v3 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-08-27 Thread Gustavo Romero
Hi Phil! On 8/26/24 3:10 AM, Philippe Mathieu-Daudé wrote: Hi Gustavo, On 25/8/24 16:52, Gustavo Romero wrote: Extend MTE gdbstub tests to also run in system mode (share tests between user mode and system mode). The tests will only run if a version of GDB that supports MTE on baremetal is

[PATCH v3 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-08-25 Thread Gustavo Romero
nst boot.S and is executed by QEMU in system mode. Signed-off-by: Gustavo Romero --- configure | 5 + tests/tcg/aarch64/Makefile.softmmu-target | 49 +- tests/tcg/aarch64/Makefile.target | 3 +- tests/tcg/aarch64/gdbstub/test-mte.py

[PATCH v3 1/4] gdbstub: Use specific MMU index when probing MTE addresses

2024-08-25 Thread Gustavo Romero
byte), rather than the number of bits used in the address space pointed to by ptr. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- target/arm/gdbstub64.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/target/arm/gdbstub64.c b/target/arm

[PATCH v3 3/4] tests/guest-debug: Support passing arguments to the GDB test script

2024-08-25 Thread Gustavo Romero
t if, for instance, the caller of the runner script passes an invalid argument or misses a required argument by the test script. Signed-off-by: Gustavo Romero --- tests/guest-debug/run-test.py | 6 ++ tests/guest-debug/test_gdbstub.py | 5 + 2 files changed, 11 insertions(+) diff --

[PATCH v3 0/4] gdbstub: Add support for MTE in system mode

2024-08-25 Thread Gustavo Romero
ead of printed to stdout - Added detection of GDB supporting MTE in baremetal v3: - No need of ARM_MMU_IDX_COREIDX_MASK with cpu_mmu_index() (Richard's review) - Define a symbol for mte_page instead of a whole section (Richard's review) Cheers, Gustavo Gustavo Romero (4): gdbstub: Use

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

2024-08-25 Thread Gustavo Romero
This commit makes handle_q_memtag, handle_q_isaddresstagged, and handle_Q_memtag stubs build for system mode, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system mode. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- target/arm/gdbst

Re: [PATCH 5/8] hw/pci-host/designware: Keep host reference in DesignwarePCIEViewport

2024-08-18 Thread Gustavo Romero
Add a back-pointer to the host in viewport" Anyways, Reviewed-by: Gustavo Romero Cheers, Gustavo On 10/12/23 9:18 AM, Philippe Mathieu-Daudé wrote: The PCI root function is irrelevant for the ViewPort; only a reference to the host bridge is required. Since we can directly access the PCI

Re: [PATCH 7/8] hw/pci-host/designware: Move MSI registers from root func to host bridge

2024-08-18 Thread Gustavo Romero
Hi Phil On 10/12/23 9:18 AM, Philippe Mathieu-Daudé wrote: The MSI registers belong the the host bridge. Move the DesignwarePCIEMSI field to the host bridge state. I would say MSI registers are more tied to the PCI/PCIe network side than to the host side. The MSI registers control if an interr

Re: [PATCH 6/8] hw/pci-host/designware: Move viewports from root func to host bridge

2024-08-18 Thread Gustavo Romero
e to mimic any verilog code etc). Reviewed-by: Gustavo Romero Cheers, Gustavo --- include/hw/pci-host/designware.h | 13 - hw/pci-host/designware.c | 47 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/include/hw/pci-host/de

Re: [PATCH 4/8] hw/pci-host/designware: Hoist host controller in root function #0

2024-08-18 Thread Gustavo Romero
rface. */ Otherwise: Reviewed-by: Gustavo Romero Cheers, Gustavo }; struct DesignwarePCIEHost { diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index bacb2bdb2d..fb46493a05 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -57,13 +

Re: [PATCH 8/8] hw/pci-host/designware: Create ViewPorts during host bridge realization

2024-08-18 Thread Gustavo Romero
specific code. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gustavo Romero Cheers, Gustavo --- hw/pci-host/designware.c | 207 +++ 1 file changed, 102 insertions(+), 105 deletions(-) diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c

Re: [PATCH 3/8] hw/pci-host/designware: Add 'host_mem' variable for clarity

2024-08-18 Thread Gustavo Romero
pci.memory; direction = "Outbound"; -source = get_system_memory(); +source = host_mem; /* * Configure MemoryRegion implementing CPU -> PCI memory Reviewed-by: Gustavo Romero This patch can get merged independently of this series. Cheers, Gustavo

Re: [PATCH 1/8] hw/pci-host/designware: Declare CPU QOM types using DEFINE_TYPES() macro

2024-08-18 Thread Gustavo Romero
class_init, -}; - -static void designware_pcie_register(void) -{ -type_register_static(&designware_pcie_root_info); -type_register_static(&designware_pcie_host_info); -} -type_init(designware_pcie_register) +DEFINE_TYPES(designware_pcie_types) Reviewed-by: Gustavo Romero This

Re: [PATCH 2/8] hw/pci-host/designware: Initialize root function in host bridge realize

2024-08-18 Thread Gustavo Romero
Hi Phil, On 10/12/23 9:18 AM, Philippe Mathieu-Daudé wrote: There are no root function properties exposed by the host bridge, so using a 2-step QOM creation isn't really useful. Simplify by creating the root function when the host bridge is realized. Signed-off-by: Philippe Mathieu-Daudé ---

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

2024-08-07 Thread Gustavo Romero
This commit makes handle_q_memtag, handle_q_isaddresstagged, and handle_Q_memtag stubs build for system mode, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system mode. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- target/arm/gdbst

[PATCH v2 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-08-07 Thread Gustavo Romero
nst boot.S and is executed by QEMU in system mode. Signed-off-by: Gustavo Romero --- configure | 5 + tests/tcg/aarch64/Makefile.softmmu-target | 49 - tests/tcg/aarch64/Makefile.target | 3 +- tests/tcg/aarch64/gdbstub/test-mte.py

[PATCH v2 3/4] tests/guest-debug: Support passing arguments to the GDB test script

2024-08-07 Thread Gustavo Romero
t if, for instance, the caller of the runner script passes an invalid argument or misses a required argument by the test script. Signed-off-by: Gustavo Romero --- tests/guest-debug/run-test.py | 6 ++ tests/guest-debug/test_gdbstub.py | 5 + 2 files changed, 11 insertions(+) diff --

[PATCH v2 1/4] gdbstub: Use specific MMU index when probing MTE addresses

2024-08-07 Thread Gustavo Romero
byte), rather than the number of bits used in the address space pointed to by ptr. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- target/arm/gdbstub64.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/target/arm/gdbstub64.c b/target/arm

[PATCH v2 0/4] gdbstub: Add support for MTE in system mode

2024-08-07 Thread Gustavo Romero
ead of printed to stdout - Added detection of GDB supporting MTE in baremetal Cheers, Gustavo Gustavo Romero (4): gdbstub: Use specific MMU index when probing MTE addresses gdbstub: Add support for MTE in system mode tests/guest-debug: Support passing arguments to the GDB test script tests/t

Re: [PATCH 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-08-07 Thread Gustavo Romero
Hi Richard, On 7/25/24 8:17 PM, Richard Henderson wrote: On 7/23/24 02:07, Gustavo Romero wrote:   def run_test(): -    gdb.execute("break 95", False, True) +    if mode == "system": +    # Break address: where to break before performing the tests +    # Addre

Re: [PATCH 3/4] tests/guest-debug: Support passing arguments to the GDB test script

2024-08-07 Thread Gustavo Romero
Hi Alex, On 7/25/24 5:38 PM, Alex Bennée wrote: Gustavo Romero writes: This commit adds a new option to run-test.py, --test-args, which can be used to pass arguments to the GDB test script specified by the --test option. The arguments passed are in the key=value form, and multiple pairs can

Re: [PATCH 1/4] gdbstub: Use specific MMU index when probing MTE addresses

2024-08-07 Thread Gustavo Romero
Hi Richard, On 7/24/24 7:14 AM, Richard Henderson wrote: On 7/23/24 02:07, Gustavo Romero wrote: +    /* Find out the current translation regime for probe. */ +    mmu_index = arm_mmu_idx(env) & ARM_MMU_IDX_COREIDX_MASK; The official interface is cpu_mmu_index(). Otherwise, Reviewe

[PATCH 0/3] configure: Bump GDB detection version for GDB_HAS_MTE

2024-08-04 Thread Gustavo Romero
configure also regarding GDB_HAS_MTE, which was being set even if the GDB available in the build env. does not support the Aarch64 arch. Cheers, Gustavo [0] https://gitlab.com/qemu-project/qemu/-/issues/2477 Gustavo Romero (3): configure: Fix arch detection for GDB_HAS_MTE configure: Avoid use of

[PATCH 2/3] configure: Avoid use of param. expansion when using gdb_version

2024-08-04 Thread Gustavo Romero
$gdb_version is now used in more than one conditional case and its usage in such cases may increase in the future. Therefore, avoid using shell parameter expansion when using it by setting gdb_version to its final form. Signed-off-by: Gustavo Romero --- configure | 8 +--- 1 file changed, 5

[PATCH 3/3] configure: Fix GDB version detection for GDB_HAS_MTE

2024-08-04 Thread Gustavo Romero
: Gustavo Romero Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2477 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 97de85d710..d08b71f14b 100755 --- a/configure +++ b/configure @@ -1675,7 +1675,7 @@ for target in $target_list; do

[PATCH 1/3] configure: Fix arch detection for GDB_HAS_MTE

2024-08-04 Thread Gustavo Romero
GDB_HAS_MTE must only be set if GDB supports the aarch64 arch, so the test if "aarch64" string is present must be against GDB-related '$gdb_arches' variable and not against '$arch' variable. Signed-off-by: Gustavo Romero --- configure | 2 +- 1 file changed, 1 ins

Re: [PATCH 1/4] gdbstub: Use specific MMU index when probing MTE addresses

2024-07-25 Thread Gustavo Romero
Hi Richard, On 7/24/24 7:14 AM, Richard Henderson wrote: On 7/23/24 02:07, Gustavo Romero wrote: +    /* Find out the current translation regime for probe. */ +    mmu_index = arm_mmu_idx(env) & ARM_MMU_IDX_COREIDX_MASK; The official interface is cpu_mmu_index(). Otherwise, Reviewe

[PATCH 3/4] tests/guest-debug: Support passing arguments to the GDB test script

2024-07-22 Thread Gustavo Romero
--test-args v0="string" v1=10 The 'v0' and 'v1' variables will then be available in the GDB test script, like this: print(v0) print(v1) Signed-off-by: Gustavo Romero --- tests/guest-debug/run-test.py | 4 1 file changed, 4 insertions(+) diff --git a/tests/guest-d

[PATCH 0/4] gdbstub: Add support for MTE in system mode

2024-07-22 Thread Gustavo Romero
Gustavo [0] https://sourceware.org/pipermail/gdb-patches/2024-July/210584.html [1] https://github.com/gromero/binutils-gdb/tree/mte_baremetal Gustavo Romero (4): gdbstub: Use specific MMU index when probing MTE addresses gdbstub: Add support for MTE in system mode tests/guest-debug: Support pass

[PATCH 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-07-22 Thread Gustavo Romero
lation and used for tagged addresses. Signed-off-by: Gustavo Romero --- tests/tcg/aarch64/Makefile.softmmu-target | 36 +-- tests/tcg/aarch64/Makefile.target | 3 +- tests/tcg/aarch64/gdbstub/test-mte.py | 44 +++ tests/tcg/aarch64/system/boot.S

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

2024-07-22 Thread Gustavo Romero
This commit makes handle_q_memtag, handle_q_isaddresstagged, and handle_Q_memtag stubs build for system mode, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system mode. Signed-off-by: Gustavo Romero --- target/arm/gdbstub64.c | 4 +--- 1 file

[PATCH 1/4] gdbstub: Use specific MMU index when probing MTE addresses

2024-07-22 Thread Gustavo Romero
byte), rather than the number of bits used in the address space pointed to by ptr. Signed-off-by: Gustavo Romero --- target/arm/gdbstub64.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c index 2e2bc2700b

Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-16 Thread Gustavo Romero
Hi Peter, On 7/16/24 11:09 AM, Peter Maydell wrote: On Tue, 16 Jul 2024 at 14:48, Alex Bennée wrote: Gustavo Romero writes: Hi Alex, On 7/16/24 8:42 AM, Alex Bennée wrote: Coverity reported a memory leak (CID 1549757) in this code and its admittedly rather clumsy handling of extending

Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-16 Thread Gustavo Romero
Odaki Cc: Gustavo Bueno Romero Cc: Peter Maydell Signed-off-by: Alex Bennée Reviewed-by: Gustavo Romero Cheers, Gustavo

[PATCH] disas: Fix build against Capstone v6

2024-07-15 Thread Gustavo Romero
can lift that definition and switch to the new naming once our supported distros have Capstone v6 in place. Signed-off-by: Gustavo Romero Suggested-by: Peter Maydell --- include/disas/capstone.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/disas/capstone.h b/include/disas

Re: [PATCH v6 06/11] target/arm: Factor out code for setting MTE TCF0 field

2024-06-28 Thread Gustavo Romero
Hi Richard, On 6/28/24 2:00 PM, Richard Henderson wrote: On 6/28/24 08:49, Gustavo Romero wrote: I thought you meant osdep.h should not be included _at all_ in my case, either in mte_user_helper.h or in mte_user_helper.c. Maybe the wording in the docs should be "Do not include "qe

Re: [PATCH v6 06/11] target/arm: Factor out code for setting MTE TCF0 field

2024-06-28 Thread Gustavo Romero
Hi Phil, On 6/28/24 4:08 AM, Philippe Mathieu-Daudé wrote: On 28/6/24 07:08, 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

Re: [PATCH v6 06/11] target/arm: Factor out code for setting MTE TCF0 field

2024-06-28 Thread Gustavo Romero
Hi Alex, On 6/28/24 9:14 AM, Alex Bennée wrote: Gustavo Romero writes: 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 function to avoid

[PATCH v6 07/11] gdbstub: Make hex conversion function non-internal

2024-06-27 Thread Gustavo Romero
Make gdb_hextomem non-internal so it's not confined to use only in gdbstub.c. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- gdbstub/internals.h| 1 - include/gdbstub/commands.h | 6 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gd

[PATCH v6 11/11] tests/tcg/aarch64: Add MTE gdbstub tests

2024-06-27 Thread Gustavo Romero
Add tests to exercise the MTE stubs. The tests will only run if a version of GDB that supports MTE is available in the test environment. Signed-off-by: Gustavo Romero --- configure | 4 ++ tests/tcg/aarch64/Makefile.target | 14 +++- tests/tcg/aarch64/gdbstub

[PATCH v6 08/11] gdbstub: Pass CPU context to command handler

2024-06-27 Thread Gustavo Romero
Allow passing the current CPU context to command handlers via user_ctx when the handler requires it. Signed-off-by: Alex Bennée Signed-off-by: Gustavo Romero --- gdbstub/gdbstub.c | 7 ++- include/gdbstub/commands.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff

[PATCH v6 04/11] target/arm: Fix exception case in allocation_tag_mem_probe

2024-06-27 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 Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- target/arm/tcg/mte_helper.c | 3

[PATCH v6 09/11] gdbstub: Use true to set cmd_startswith

2024-06-27 Thread Gustavo Romero
cmd_startswith is a boolean so use 'true' to set it instead of 1. Signed-off-by: Gustavo Romero --- gdbstub/gdbstub.c | 80 +++ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index

[PATCH v6 06/11] target/arm: Factor out code for setting MTE TCF0 field

2024-06-27 Thread Gustavo Romero
-off-by: Gustavo Romero --- linux-user/aarch64/meson.build | 2 ++ linux-user/aarch64/mte_user_helper.c | 34 linux-user/aarch64/mte_user_helper.h | 25 linux-user/aarch64/target_prctl.h| 22 ++ 4 files changed, 63

[PATCH v6 03/11] gdbstub: Add support for target-specific stubs

2024-06-27 Thread Gustavo Romero
faces to extend the qSupported string, the query handler table, and the set handler table, allowing target-specific stub implementations. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée --- gdbstub/gdbstub.c | 102 ++--- include/gdbstub/commands.h

[PATCH v6 05/11] target/arm: Make some MTE helpers widely available

2024-06-27 Thread Gustavo Romero
Make the MTE helpers allocation_tag_mem_probe, load_tag1, and store_tag1 available to other subsystems. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/tcg/mte_helper.c | 45 - target/arm/tcg/mte_helper.h

[PATCH v6 10/11] gdbstub: Add support for MTE in user mode

2024-06-27 Thread Gustavo Romero
d to control the MTE 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 | 46 + ta

[PATCH v6 02/11] gdbstub: Move GdbCmdParseEntry into a new header file

2024-06-27 Thread Gustavo Romero
commit also makes gdb_put_packet public since is used in gdbstub command handling. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée --- gdbstub/gdbstub.c | 134 ++--- gdbstub/internals.h| 22 -- gdbstub/syscalls.c | 7 +- gdbstub

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

2024-06-27 Thread Gustavo Romero
Hi Phil, On 6/27/24 3:05 AM, Philippe Mathieu-Daudé wrote: On 27/6/24 06:13, 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 v6 01/11] gdbstub: Clean up process_string_cmd

2024-06-27 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 Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- gdbstub/gdbstub.c | 40 1 file changed, 20 inserti

[PATCH v6 00/11] Add MTE stubs for aarch64 user mode

2024-06-27 Thread Gustavo Romero
arch64 targets (Alex's suggestion) v6: - Remove dead code (Phil's review) - Pass CPU context via user_ctx (Phil and Alex's review) - Cleanup: in gdbstub.c use 'true' to set startswith instead of 1 Cheers, Gustavo Gustavo Romero (11): gdbstub: Clean up process_string_cm

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

2024-06-27 Thread Gustavo Romero
Hi Phil, Alex, On 6/27/24 9:26 AM, Philippe Mathieu-Daudé wrote: On 27/6/24 13:05, Alex Bennée wrote: Philippe Mathieu-Daudé writes: On 27/6/24 06:13, Gustavo Romero wrote: Make the gdb_first_attached_cpu and gdb_hextomem non-internal so they are not confined to use only in gdbstub.c

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

2024-06-27 Thread Gustavo Romero
Hi Phil, On 6/27/24 3:02 AM, Philippe Mathieu-Daudé wrote: On 27/6/24 06:13, Gustavo Romero wrote: Move GdbCmdParseEntry and its associated types into a separate header file to allow the use of GdbCmdParseEntry and other gdbstub command functions outside of gdbstub.c. Since GdbCmdParseEntry

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

2024-06-26 Thread Gustavo Romero
Hi Phil, Richard On 6/24/24 4:47 AM, Philippe Mathieu-Daudé wrote: Hi Gustavo, On 24/6/24 07:30, Gustavo Romero wrote: Make the MTE helpers allocation_tag_mem_probe, load_tag1, and store_tag1 available to other subsystems. Again, you can make them available externally by removing the static

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

2024-06-26 Thread Gustavo Romero
commit also makes gdb_put_packet public since is used in gdbstub command handling. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée --- gdbstub/gdbstub.c | 134 ++--- gdbstub/internals.h| 22 -- gdbstub/syscalls.c | 7 +- gdbstub

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

2024-06-26 Thread Gustavo Romero
faces to extend the qSupported string, the query handler table, and the set handler table, allowing target-specific stub implementations. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée --- gdbstub/gdbstub.c | 102 ++--- include/gdbstub/commands.h

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

2024-06-26 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 Reviewed-by: Richard Henderson --- gdbstub/internals.h| 2 -- include/exec/gdbstub.h | 5 + include/gdbstub/commands.h | 6 ++ 3

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

2024-06-26 Thread Gustavo Romero
Make the MTE helpers allocation_tag_mem_probe, load_tag1, and store_tag1 available to other subsystems. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- target/arm/tcg/mte_helper.c | 45 - target/arm/tcg/mte_helper.h | 66

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

2024-06-26 Thread Gustavo Romero
-off-by: Gustavo Romero --- linux-user/aarch64/meson.build | 2 ++ linux-user/aarch64/mte_user_helper.c | 34 linux-user/aarch64/mte_user_helper.h | 25 linux-user/aarch64/target_prctl.h| 22 ++ 4 files changed, 63

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

2024-06-26 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 Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- target/arm/tcg/mte_helper.c | 3

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

2024-06-26 Thread Gustavo Romero
er/aarch64/ and include it from gdbstub64.c (Richard's review) v5: - Made load_tag1, store_tag1, and arm_set_mte_tcf0 non-inlined for code modularity (Phil's review) - MTE tests: GDB_HAS_MTE is now only set for aarch64 targets (Alex's suggestion) Cheers, Gustavo Gustav

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

2024-06-26 Thread Gustavo Romero
Add tests to exercise the MTE stubs. The tests will only run if a version of GDB that supports MTE is available in the test environment. Signed-off-by: Gustavo Romero --- configure | 4 ++ tests/tcg/aarch64/Makefile.target | 14 +++- tests/tcg/aarch64/gdbstub

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

2024-06-26 Thread Gustavo Romero
d to control the MTE 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 | 46 ++ ta

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

2024-06-26 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 Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- gdbstub/gdbstub.c | 40 1 file changed, 20 inserti

Re: [PATCH v2 2/2] target/arm: Enable FEAT_Debugv8p8 for -cpu max

2024-06-24 Thread Gustavo Romero
Hi Peter, On 6/24/24 10:27 AM, Peter Maydell wrote: On Fri, 21 Jun 2024 at 15:39, Gustavo Romero wrote: Enable FEAT_Debugv8p8 for max CPU. This feature is out of scope for QEMU since it concerns the external debug interface for JTAG, but is mandatory in Armv8.8 implementations, hence it is

Re: [PATCH v2 1/2] target/arm: Move initialization of debug ID registers

2024-06-24 Thread Gustavo Romero
Hi Peter! On 6/24/24 10:26 AM, Peter Maydell wrote: On Fri, 21 Jun 2024 at 15:39, Gustavo Romero wrote: Move the initialization of the debug ID registers to aa32_max_features, which is used to set the 32-bit ID registers. This ensures that the debug ID registers are consistently set for the

[PATCH v3 3/3] target/arm: Enable FEAT_Debugv8p8 for -cpu max

2024-06-24 Thread Gustavo Romero
Enable FEAT_Debugv8p8 for max CPU. This feature is out of scope for QEMU since it concerns the external debug interface for JTAG, but is mandatory in Armv8.8 implementations, hence it is reported as supported in the ID registers. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson

[PATCH v3 0/3] target/arm: Enable FEAT_Debugv8p8 for -cpu max

2024-06-24 Thread Gustavo Romero
Enable FEAT_Debugv8p8 on Arm max CPU. v2: - Revert to the original comment above call to aa32_max_features() v3: - Added feature entry to docs/system/arm/emulation.rst - Explicitly set t=0 before using it to set DBGDEVID reg. - Put indent fix in a separate patch Cheers, Gustavo Gustavo

[PATCH v3 1/3] target/arm: Fix indentation

2024-06-24 Thread Gustavo Romero
Fix comment indentation adding a missing space. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- target/arm/tcg/cpu64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index 0899251eef..71e1bfcd4e 100644 --- a

[PATCH v3 2/3] target/arm: Move initialization of debug ID registers

2024-06-24 Thread Gustavo Romero
Move the initialization of the debug ID registers to aa32_max_features, which is used to set the 32-bit ID registers. This ensures that the debug ID registers are consistently set for the max CPU in a single place. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- target/arm

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

2024-06-23 Thread Gustavo Romero
Hi Alex, On 6/17/24 6:50 AM, Alex Bennée wrote: Gustavo Romero writes: Hi Alex, On 6/14/24 12:49 PM, Alex Bennée wrote: Gustavo Romero writes: This patchset adds the stubs necessary to support GDB memory tagging commands on QEMU aarch64 user mode. These new stubs handle the

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

2024-06-23 Thread Gustavo Romero
Hi Richard, On 6/21/24 1:35 AM, Richard Henderson wrote: On 6/16/24 23:28, 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

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

2024-06-23 Thread Gustavo Romero
Hi Richard, On 6/21/24 1:31 AM, Richard Henderson wrote: On 6/16/24 23:28, Gustavo Romero wrote: @@ -287,7 +256,7 @@ uint64_t HELPER(addsubg)(CPUARMState *env, uint64_t ptr,   return address_with_allocation_tag(ptr + offset, rtag);   } -static int load_tag1(uint64_t ptr, uint8_t *mem

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

2024-06-23 Thread Gustavo Romero
Hi Alex, On 6/21/24 5:11 AM, Alex Bennée wrote: Gustavo Romero writes: Currently, it's not possible to have stubs specific to a given target, even though there are GDB features which are target-specific, like, for instance, memory tagging. This commit intro

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

2024-06-23 Thread Gustavo Romero
commit also makes gdb_put_packet public since is used in gdbstub command handling. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée --- gdbstub/gdbstub.c | 134 ++--- gdbstub/internals.h| 22 -- gdbstub/syscalls.c | 7 +- gdbstub

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

2024-06-23 Thread Gustavo Romero
-off-by: Gustavo Romero --- linux-user/aarch64/mte_user_helper.h | 38 linux-user/aarch64/target_prctl.h| 22 ++-- 2 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 linux-user/aarch64/mte_user_helper.h diff --git a/linux-user/aarch64

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

2024-06-23 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 Reviewed-by: Richard Henderson --- gdbstub/internals.h| 2 -- include/exec/gdbstub.h | 5 + include/gdbstub/commands.h | 6 ++ 3

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

2024-06-23 Thread Gustavo Romero
faces to extend the qSupported string, the query handler table, and the set handler table, allowing target-specific stub implementations. Signed-off-by: Gustavo Romero Reviewed-by: Alex Bennée --- gdbstub/gdbstub.c | 102 ++--- include/gdbstub/commands.h

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

2024-06-23 Thread Gustavo Romero
d to control the MTE 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 | 46 ++ ta

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

2024-06-23 Thread Gustavo Romero
Make the MTE helpers allocation_tag_mem_probe, load_tag1, and store_tag1 available to other subsystems. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- target/arm/tcg/mte_helper.c | 54 +++ target/arm/tcg/mte_helper.h | 74

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

2024-06-23 Thread Gustavo Romero
Add tests to exercise the MTE stubs. The tests will only run if a version of GDB that supports MTE is available in the test environment. Signed-off-by: Gustavo Romero --- configure | 11 +++ tests/tcg/aarch64/Makefile.target | 14 +++- tests/tcg/aarch64/gdbstub

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

2024-06-23 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 Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- gdbstub/gdbstub.c | 40 1 file changed, 20 inserti

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

2024-06-23 Thread Gustavo Romero
review) - Added g_assert()s in new gdb_extend_* API functions to ensure all CPUs have the same features/query/set tables (Alex's review) - Move load_tag1 and store_tag1 to mte_helpers.h marking them as "static inline" (Richard's review) - Move mte_user_helper

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

2024-06-23 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 Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- target/arm/tcg/mte_helper.c | 3

Re: [PATCH 1/2] target/arm: Move initialization of debug ID registers

2024-06-21 Thread Gustavo Romero
Hi Richard, On 6/20/24 3:21 PM, Richard Henderson wrote: On 6/20/24 11:13, Gustavo Romero wrote: @@ -1268,7 +1268,10 @@ void aarch64_max_tcg_initfn(Object *obj)   t = FIELD_DP64(t, ID_AA64SMFR0, FA64, 1); /* FEAT_SME_FA64 */   cpu->isar.id_aa64smfr0 = t; -    /* Replicate the s

[PATCH v2 1/2] target/arm: Move initialization of debug ID registers

2024-06-21 Thread Gustavo Romero
Move the initialization of the debug ID registers to aa32_max_features, which is used to set the 32-bit ID registers. This ensures that the debug ID registers are consistently set for the max CPU in a single place. Signed-off-by: Gustavo Romero --- target/arm/cpu.h | 2 ++ target/arm/tcg

[PATCH v2 2/2] target/arm: Enable FEAT_Debugv8p8 for -cpu max

2024-06-21 Thread Gustavo Romero
Enable FEAT_Debugv8p8 for max CPU. This feature is out of scope for QEMU since it concerns the external debug interface for JTAG, but is mandatory in Armv8.8 implementations, hence it is reported as supported in the ID registers. Signed-off-by: Gustavo Romero --- target/arm/tcg/cpu32.c | 6

  1   2   3   >