[PATCH] Hexagon: fix HVX store new

2024-05-20 Thread Matheus Tavares Bernardino
'd', 'e', 'x', and 'y'. No longer following that makes us select the wrong register index and the HVX store new instruction does not update the memory like expected. Signed-off-by: Matheus Tavares Bernardino --- tests/tcg/hexagon/hvx_misc.c | 23 +++ target/hexagon/gen_t

[PATCH v6] Hexagon: add PC alignment check and exception

2024-05-03 Thread Matheus Tavares Bernardino
The Hexagon Programmer's Reference Manual says that the exception 0x1e should be raised upon an unaligned program counter. Let's implement that and also add some tests. Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Richard Henderson Reviewed-by: Taylor Simpson --- Changes in v6

Re: [PATCH v5] Hexagon: add PC alignment check and exception

2024-05-03 Thread Matheus Tavares Bernardino
On Thu, 2 May 2024 13:00:34 -0700 Richard Henderson wrote: > > On 5/2/24 12:20, Matheus Tavares Bernardino wrote: > > > > + > > +void test_multi_cof(void) > > +{ > > +asm volatile( > > +"p0 = cmp.eq(r0, r0)\n" > > +&qu

[PATCH v5] Hexagon: add PC alignment check and exception

2024-05-02 Thread Matheus Tavares Bernardino
The Hexagon Programmer's Reference Manual says that the exception 0x1e should be raised upon an unaligned program counter. Let's implement that and also add some tests. Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Richard Henderson Reviewed-by: Taylor Simpson --- Changes in v5

[PATCH v4] Hexagon: add PC alignment check and exception

2024-05-02 Thread Matheus Tavares Bernardino
The Hexagon Programmer's Reference Manual says that the exception 0x1e should be raised upon an unaligned program counter. Let's implement that and also add some tests. Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Richard Henderson --- v3: https://lore.kernel.org/qemu-devel

Re: [PATCH v3] Hexagon: add PC alignment check and exception

2024-05-02 Thread Matheus Tavares Bernardino
On Tue, 30 Apr 2024 08:52:36 -0700 Richard Henderson wrote: > > On 4/30/24 07:25, Matheus Tavares Bernardino wrote: > > +void test_multi_cof(void) > > +{ > > +asm volatile( > > +"p0 = cmp.eq(r0, r0)\n" > > +"{\n" &

[PATCH v3] Hexagon: add PC alignment check and exception

2024-04-30 Thread Matheus Tavares Bernardino
The Hexagon Programmer's Reference Manual says that the exception 0x1e should be raised upon an unaligned program counter. Let's implement that and also add some tests. Signed-off-by: Matheus Tavares Bernardino --- v2: https://lore.kernel.org/qemu-devel

[PATCH v2] Hexagon: add PC alignment check and exception

2024-04-29 Thread Matheus Tavares Bernardino
The Hexagon Programmer's Reference Manual says that the exception 0x1e should be raised upon an unaligned program counter. Let's implement that and also add tests for both the most common case as well as packets with multiple change-of-flow instructions. Signed-off-by: Matheus Tavares Bernardino

RE: [PATCH] Hexagon: add PC alignment check and exception

2024-04-29 Thread Matheus Tavares Bernardino
s > complete. Will do, thanks. > > -Original Message- > > From: ltaylorsimp...@gmail.com > > > > > > > > > -Original Message- > > > From: Matheus Tavares Bernardino > > > > > > > > > --- a/target/

[PATCH] Hexagon: add PC alignment check and exception

2024-04-26 Thread Matheus Tavares Bernardino
The Hexagon Programmer's Reference Manual says that the exception 0x1e should be raised upon an unaligned program counter. Let's implement that and also add tests for both the most common case as well as packets with multiple change-of-flow instructions. Signed-off-by: Matheus Tavares Bernardino

Re: [PATCH] Makefile: fix use of -j without an argument

2024-04-12 Thread Matheus Tavares Bernardino
On Fri, 12 Apr 2024 10:02:54 +0200 Paolo Bonzini wrote: > > On Thu, Apr 11, 2024 at 5:46 PM Matheus Tavares Bernardino > wrote: > > +$(if $(filter -j, $(MAKEFLAGS)) \ > > +,, \ > > +$(or \ > > +

Re: [PATCH] Makefile: fix use of -j without an argument

2024-04-11 Thread Matheus Tavares Bernardino
Hi, Philippe On Thu, 11 Apr 2024 17:29:58 +0200 =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= wrote: > > Hi Matheus, > > On 11/4/24 17:09, Matheus Tavares Bernardino wrote: > > Our Makefile massages the given make arguments to invoke ninja > > accordingly. One key

[PATCH] Makefile: fix use of -j without an argument

2024-04-11 Thread Matheus Tavares Bernardino
t's fix that and indent the touched code for better readability. Signed-off-by: Matheus Tavares Bernardino --- Makefile | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 183756018f..d299c14dab 100644 --- a/Makefile +++ b/Makefile @@ -142,8 +142,1

Re: [PATCH 4/9] Hexagon (target/hexagon) Mark has_pred_dest in trans functions

2024-02-27 Thread Matheus Tavares Bernardino
On Mon, 26 Feb 2024 13:17:17 -0700 Taylor Simpson wrote: > > diff --git a/target/hexagon/gen_trans_funcs.py > b/target/hexagon/gen_trans_funcs.py > index 07292e0170..f1972fd2dd 100755 > --- a/target/hexagon/gen_trans_funcs.py > +++ b/target/hexagon/gen_trans_funcs.py > @@ -86,6 +86,7 @@ def

Re: [PATCH 3/9] Hexagon (target/hexagon) Mark dest_idx in trans functions

2024-02-27 Thread Matheus Tavares Bernardino
On Mon, 26 Feb 2024 13:17:16 -0700 Taylor Simpson wrote: > > diff --git a/target/hexagon/gen_trans_funcs.py > b/target/hexagon/gen_trans_funcs.py > index 79475b2946..07292e0170 100755 > --- a/target/hexagon/gen_trans_funcs.py > +++ b/target/hexagon/gen_trans_funcs.py > @@ -85,6 +85,7 @@ def

Re: [PATCH 2/9] Hexagon (target/hexagon) Mark new_read_idx in trans functions

2024-02-27 Thread Matheus Tavares Bernardino
On Mon, 26 Feb 2024 13:17:15 -0700 Taylor Simpson wrote: > > diff --git a/target/hexagon/gen_trans_funcs.py > b/target/hexagon/gen_trans_funcs.py > index 53e844a44b..79475b2946 100755 > --- a/target/hexagon/gen_trans_funcs.py > +++ b/target/hexagon/gen_trans_funcs.py > @@ -84,14 +84,15 @@ def

Re: [PATCH] tests/docker: Hexagon toolchain update

2024-01-15 Thread Matheus Tavares Bernardino
On Sun, 14 Jan 2024 15:23:54 -0800 Brian Cain wrote: > > This update includes support for privileged instructions. > > Signed-off-by: Brian Cain > --- Reviewed-by: Matheus Tavares Bernardino Tested-by: Matheus Tavares Bernardino > diff --git a/tests/docker/dockerfi

Re: [PATCH] Reduce scope of def_regnum, remove dead assignment

2024-01-15 Thread Matheus Tavares Bernardino
On Sun, 14 Jan 2024 15:44:53 -0800 Brian Cain wrote: > > This is intended to address a coverity finding: CID 1527408. > > Signed-off-by: Brian Cain > --- Reviewed-by: Matheus Tavares Bernardino

Re: [RFC PATCH] Hexagon (target/hexagon) Make generators object oriented

2023-11-10 Thread Matheus Tavares Bernardino
Taylor Simpson wrote: > > RFC - This patch handles gen_tcg_funcs.py. I'd like to get comments > on the general approach before working on the other Python scripts. > > The generators are generally a bunch of Python if-then-else > statements based on the regtype and regid. Encapsulate

prefix gets lost on config regen for cross Windows build

2023-10-31 Thread Matheus Tavares Bernardino
[resending as it looks like there was some delivery issue with the first msg] Hi, It seems that we lose the install prefix option when regenerating config for a Windows cross-build. Looks like this behavior appeared with c36dd41ba2 (configure: move target-specific defaults to an external machine

--prefix gets lost on config regen for cross Windows build

2023-10-27 Thread Matheus Tavares Bernardino
Hi, It seems that we lose the install prefix option when regenerating config for a Windows cross-build. Looks like this behavior appeared with c36dd41ba2 (configure: move target-specific defaults to an external machine file, 2023-10-16), but I couldn't find the specific root cause yet. To

[PATCH v2] semihosting: fix memleak at semihosting_arg_fallback

2023-10-20 Thread Matheus Tavares Bernardino
We duplicate "cmd" as strtok may modify its argument, but we forgot to free it later. Furthermore, add_semihosting_arg doesn't take responsibility for this memory either (it strdup's the argument). Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Philippe Mathieu-Daudé --- s

[PATCH] semihosting: fix memleak at semihosting_arg_fallback

2023-10-19 Thread Matheus Tavares Bernardino
We duplicate "cmd" as strtok may modify its argument, but we forgot to free it later. Furthermore, add_semihosting_arg doesn't take responsibility for this memory either (it strdup's the argument). Signed-off-by: Matheus Tavares Bernardino --- semihosting/config.c | 6 -- 1 file

[PATCH] hw/display: fix memleak from virtio_add_resource

2023-10-06 Thread Matheus Tavares Bernardino
at virtio_add_resource() itself are not strictly necessary for the memleak fix, but they make it more obvious that, on an error return, the passed object is not added to the hash. Signed-off-by: Matheus Tavares Bernardino --- hw/display/virtio-dmabuf.c | 12 ++-- 1 file changed, 10

Re: [PULL v2 40/44] gdbstub: add test for untimely stop-reply packets

2023-08-07 Thread Matheus Tavares Bernardino
Hi, Richard Richard Henderson wrote: > > On 5/18/23 13:04, Taylor Simpson wrote: > > From: Matheus Tavares Bernardino > > > > In the previous commit, we modified gdbstub.c to only send stop-reply > > packets as a response to GDB commands that accept

Re: [PATCH] gdbstub: use 0 ("any process") on packets with no PID

2023-08-02 Thread Matheus Tavares Bernardino
Ilya Leoshkevich wrote: > > On Tue, 2023-08-01 at 12:37 -0300, Matheus Tavares Bernardino wrote: > > Previously, qemu-user would always report PID 1 to GDB. This was > > changed > > at dc14a7a6e9 (gdbstub: Report the actual qemu-user pid, 2023-06-30), > > but read_t

Re: [PATCH] gdbstub: Fix client Ctrl-C handling

2023-08-01 Thread Matheus Tavares Bernardino
Hi, Nick. > Nicholas Piggin wrote: > > On Tue Jul 11, 2023 at 9:03 PM AEST, Matheus Tavares Bernardino wrote: > > > Nicholas Piggin wrote: > > > > > > diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c > > > index 6911b73c07..ce8b42eb15 100644 >

[PATCH] gdbstub: use 0 ("any process") on packets with no PID

2023-08-01 Thread Matheus Tavares Bernardino
PID, or PID 0. This issue was found with hexagon-lldb, which sends a "Hq" packet with only the thread-id, but no process-id, leading to the invalid usage of "PID 1" by qemu-hexagon and a subsequent "E22" reply. Signed-off-by: Matheus Tavares Bernardino --- gdb

Re: [PATCH v3] Hexagon: move GETPC() calls to top level helpers

2023-07-12 Thread Matheus Tavares Bernardino
Matheus Tavares Bernardino wrote: > > Subject: [PATCH v3] Hexagon: move GETPC() calls to top level helpers Apologies, I had some problems with my send-email and server configuration, thus ended up sending this v3 multiple times. Please ignore the others and consider only this one (i.e.

[PATCH v3] Hexagon: move GETPC() calls to top level helpers

2023-07-11 Thread Matheus Tavares Bernardino
, unifying the mem_load*() functions. - HELPER(probe_hvx_stores), when called from another helper, ends up using its own GETPC() expansion instead of the top level caller. Signed-off-by: Matheus Tavares Bernardino --- v2: https://lore.kernel.org/qemu-devel/93a2ca786530cbc8a94f7c7a6451f4f1f47c8a9b

[PATCH v3] Hexagon: move GETPC() calls to top level helpers

2023-07-11 Thread Matheus Tavares Bernardino
, unifying the mem_load*() functions. Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Taylor Simpson --- v2: https://lore.kernel.org/qemu-devel/93a2ca786530cbc8a94f7c7a6451f4f1f47c8a9b.1688581908.git.quic_mathb...@quicinc.com/ Changes in v3: refactored fLOAD macro with 'do {...} while(0

[PATCH v3] Hexagon: move GETPC() calls to top level helpers

2023-07-11 Thread Matheus Tavares Bernardino
, unifying the mem_load*() functions. - HELPER(probe_hvx_stores), when called from another helper, ends up using its own GETPC() expansion instead of the top level caller. Signed-off-by: Matheus Tavares Bernardino --- v2: https://lore.kernel.org/qemu-devel/93a2ca786530cbc8a94f7c7a6451f4f1f47c8a9b

Re: [PATCH] gdbstub: Fix client Ctrl-C handling

2023-07-11 Thread Matheus Tavares Bernardino
> Nicholas Piggin wrote: > > diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c > index 6911b73c07..ce8b42eb15 100644 > --- a/gdbstub/gdbstub.c > +++ b/gdbstub/gdbstub.c > @@ -2051,8 +2051,17 @@ void gdb_read_byte(uint8_t ch) > return; > } > if (runstate_is_running()) { > -

[PATCH v3] Hexagon: move GETPC() calls to top level helpers

2023-07-11 Thread Matheus Tavares Bernardino
, unifying the mem_load*() functions. - HELPER(probe_hvx_stores), when called from another helper, ends up using its own GETPC() expansion instead of the top level caller. Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Taylor Simpson --- v2: https://lore.kernel.org/qemu-devel

Re: [PATCH v2] Hexagon: move GETPC() calls to top level helpers

2023-07-06 Thread Matheus Tavares Bernardino
> ltaylorsimp...@gmail.com wrote: > > > -Original Message- > > From: Matheus Tavares Bernardino > > Sent: Wednesday, July 5, 2023 12:35 PM > > To: qemu-devel@nongnu.org > > Cc: quic_mathb...@quicinc.com; bc...@quicinc.com; > > ltaylors

[PATCH v2] Hexagon: move GETPC() calls to top level helpers

2023-07-05 Thread Matheus Tavares Bernardino
, unifying the mem_load*() functions. Signed-off-by: Matheus Tavares Bernardino --- v1: d40fabcf9d6e92e4cd8d6a144e9b2a9acf4580dc.1688420966.git.quic_mathb...@quicinc.com Changes in v2: - Fixed wrong cpu_ld* unification from previous version. - Passed retaddr down to check_noshuf() and further

Re: [PATCH] Hexagon: move GETPC() calls to top level helpers

2023-07-05 Thread Matheus Tavares Bernardino
> Taylor wrote: > > > Matheus Tavares Bernardino wrote: > > > > diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h index > > 5451b061ee..efb8013912 100644 > > --- a/target/hexagon/macros.h > > +++ b/target/hexagon/macr

Re: [PATCH] Hexagon: move GETPC() calls to top level helpers

2023-07-04 Thread Matheus Tavares Bernardino
> Matheus Tavares Bernardino wrote: > > diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h > index 5451b061ee..efb8013912 100644 > --- a/target/hexagon/macros.h > +++ b/target/hexagon/macros.h > @@ -173,14 +173,20 @@ > #define MEM_STORE8(VA, DATA, SLOT) \ >

[PATCH] Hexagon: move GETPC() calls to top level helpers

2023-07-03 Thread Matheus Tavares Bernardino
, unifying the mem_load*() functions. Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/macros.h| 22 ++--- target/hexagon/op_helper.h | 11 ++--- target/hexagon/op_helper.c | 49 +++--- 3 files changed, 25 insertions(+), 57 deletions

Re: [PATCH] gdbstub: Permit reverse step/break to provide stop response

2023-06-28 Thread Matheus Tavares Bernardino
Peter Maydell wrote: > > On Fri, 23 Jun 2023 at 13:19, Matheus Tavares Bernardino > wrote: > > > > Ah, it's interesting that [1] doesn't include 'bc' and 'bs' in the list > > of cmds that may respond with a stop-reply packet: > > > > "The '

Re: [PATCH] gdbstub: Permit reverse step/break to provide stop response

2023-06-23 Thread Matheus Tavares Bernardino
'vStopped', and '?' packets can receive any of the below as a reply." But their definitions at [2] do say the following: 'bc' (and 'bc') [...] Reply: See Stop Reply Packets, for the reply specifications. So I guess the list from [1] is not exhaustive. Anyway, thanks for the fi

[PATCH 2/2] Hexagon (tests/.../hex_test.h): use portable printf formats

2023-05-30 Thread Matheus Tavares Bernardino
This fixes compiler messages like "warning: format specifies type 'unsigned int' but the argument has type 'uint32_t' (aka 'unsigned long') [-Wformat]". Signed-off-by: Matheus Tavares Bernardino --- tests/tcg/hexagon/hex_test.h | 14 ++ 1 file changed, 10 insertions(+), 4

[PATCH 0/2] Hexagon tests: fix test_load_tmp2 and non-portable format

2023-05-30 Thread Matheus Tavares Bernardino
This series includes two fixes on hexagon test files: one for a non-porable printf specifier, and the other for the use of an uninitialized register. Marco Liebel (1): Hexagon (hvx_misc test): fix uninitialized regs at test_load_tmp2 Matheus Tavares Bernardino (1): Hexagon (tests

[PATCH 1/2] Hexagon (hvx_misc test): fix uninitialized regs at test_load_tmp2

2023-05-30 Thread Matheus Tavares Bernardino
From: Marco Liebel This test case was using some vector registers which were not properly initialized. Signed-off-by: Marco Liebel Signed-off-by: Matheus Tavares Bernardino --- tests/tcg/hexagon/hvx_misc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/tcg

[PATCH v2 1/2] target/hexagon/*.py: clean up used 'toss' and 'numregs' vars

2023-05-24 Thread Matheus Tavares Bernardino
-by: Matheus Tavares Bernardino --- target/hexagon/gen_analyze_funcs.py | 10 +++--- target/hexagon/gen_helper_funcs.py | 30 target/hexagon/gen_helper_protos.py | 22 ++-- target/hexagon/gen_idef_parser_funcs.py | 4 +-- target/hexagon/gen_op_regs.py

[PATCH v2 0/2] Hexagon: minor cleanups to comments and python scripts

2023-05-24 Thread Matheus Tavares Bernardino
: replaced outdated comments with pseudocode v1: https://lore.kernel.org/qemu-devel/cover.1684873957.git.quic_mathb...@quicinc.com/ Matheus Tavares Bernardino (2): target/hexagon/*.py: clean up used 'toss' and 'numregs' vars Hexagon: fix outdated `hex_new_*` comments target/hexagon/genptr.c

[PATCH v2 2/2] Hexagon: fix outdated `hex_new_*` comments

2023-05-24 Thread Matheus Tavares Bernardino
name change in the future, let's replace them with pseudocode. Suggested-by: Taylor Simpson Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/genptr.c| 26 -- target/hexagon/translate.c | 2 +- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git

[PATCH 1/2] target/hexagon/*.py: remove undef vars from bad_register()

2023-05-23 Thread Matheus Tavares Bernardino
Some calls to `hex_common.bad_register()` in Hexagon python files are passing undefined variables. Let's remove those. Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/gen_helper_funcs.py | 8 target/hexagon/gen_tcg_funcs.py| 6 +++--- 2 files changed, 7 insertions

[PATCH 2/2] Hexagon: fix outdated `hex_new_*` references in comments

2023-05-23 Thread Matheus Tavares Bernardino
to assist developers, we can replace the old names with some pseudocode when convenient. Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/genptr.c| 10 +- target/hexagon/translate.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/hexagon/genptr.c b

[PATCH 0/2] Hexagon: two minor cleanups to comments and python scripts

2023-05-23 Thread Matheus Tavares Bernardino
These are two minor follow ups to the last Hexagon pull, updating some stale code comments and removing undefined variables from error messages at python scripts. Matheus Tavares Bernardino (2): target/hexagon/*.py: remove undef vars from bad_register() Hexagon: fix outdated `hex_new_

[PATCH v2] Hexagon (decode): look for pkts with multiple insns at the same slot

2023-05-08 Thread Matheus Tavares Bernardino
r to debug possible future errors caused by missing updates to `find_iclass_slots()` rules in target/hexagon/iclass.c. Co-authored-by: Taylor Simpson Signed-off-by: Taylor Simpson Signed-off-by: Matheus Tavares Bernardino --- Changes in v2: - Only call decode_set_slot_number() with !disas_only, fix

[PATCH] Hexagon (decode): look for pkts with multiple insns at the same slot

2023-05-04 Thread Matheus Tavares Bernardino
r to debug possible future errors caused by missing updates to `find_iclass_slots()` rules in target/hexagon/iclass.c. Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Taylor Simpson --- I extracted this patch from [1]. There are more changes needed to support v73 in qemu, so the f

[PATCH 0/2] Hexagon: improve output for arch version debugging

2023-05-04 Thread Matheus Tavares Bernardino
r did it read but does not know such version?"). And running `qemu-hexagon -cpu help` doesn't help either, as it just errors out with no output. This patchset tries to improve this process. https://lore.kernel.org/qemu-devel/cover.1673616964.git.quic_mathb...@quicinc.com/ Matheus Tavares Ber

[PATCH 2/2] Hexagon: append eflags to unknown cpu model string

2023-05-04 Thread Matheus Tavares Bernardino
CPU model 'unknown (0x69)' Signed-off-by: Matheus Tavares Bernardino --- linux-user/hexagon/target_elf.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/linux-user/hexagon/target_elf.h b/linux-user/hexagon/target_elf.h index b4e9f40527..f47e130537 100644 --- a/linux-user

[PATCH 1/2] Hexagon: list available CPUs with `-cpu help`

2023-05-04 Thread Matheus Tavares Bernardino
e printing. This is to avoid confusing situations like the following: $ qemu-hexagon -cpu help Available CPUs: v67-hexagon-cpu $ qemu-hexagon -cpu v67-hexagon-cpu ./prog qemu-hexagon: unable to find CPU model 'v67-hexagon-cpu' Signed-off-by: Matheus Tavares Bernardino -

[PATCH] Hexagon (target/hexagon/*.py): raise exception on reg parsing error

2023-05-04 Thread Matheus Tavares Bernardino
. This patch was generated with: git grep -l "Bad register" *hexagon* | \ xargs sed -i "" -e 's/print("Bad register parse: "[, ]*\([^)]*\))/hex_common.bad_register(\1)/g' Plus the bad_register() helper added to hex_common.py. Signed-off-by: Matheus Tavares B

[PATCH v3 6/6] Hexagon (linux-user/hexagon): handle breakpoints

2023-05-04 Thread Matheus Tavares Bernardino
This enables LLDB to work with hexagon linux-user mode through the GDB remote protocol. Helped-by: Richard Henderson Signed-off-by: Matheus Tavares Bernardino --- linux-user/hexagon/cpu_loop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/hexagon/cpu_loop.c b/linux-user

[PATCH v3 3/6] Hexagon: add core gdbstub xml data for LLDB

2023-05-04 Thread Matheus Tavares Bernardino
Signed-off-by: Matheus Tavares Bernardino --- MAINTAINERS| 1 + configs/targets/hexagon-linux-user.mak | 1 + target/hexagon/cpu.c | 3 +- gdb-xml/hexagon-core.xml | 84 ++ 4 files changed, 88 insertions(+), 1

[PATCH v3 4/6] Hexagon (gdbstub): fix p3:0 read and write via stub

2023-05-04 Thread Matheus Tavares Bernardino
From: Brian Cain Signed-off-by: Brian Cain Co-authored-by: Sid Manning Signed-off-by: Sid Manning Co-authored-by: Matheus Tavares Bernardino Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Taylor Simpson --- target/hexagon/gdbstub.c | 16 1 file changed, 16

[PATCH v3 5/6] Hexagon (gdbstub): add HVX support

2023-05-04 Thread Matheus Tavares Bernardino
From: Taylor Simpson Signed-off-by: Taylor Simpson Co-authored-by: Brian Cain Signed-off-by: Brian Cain Co-authored-by: Matheus Tavares Bernardino Signed-off-by: Matheus Tavares Bernardino --- configs/targets/hexagon-linux-user.mak | 2 +- target/hexagon/internal.h | 2

[PATCH v3 2/6] gdbstub: add test for untimely stop-reply packets

2023-05-04 Thread Matheus Tavares Bernardino
was in fact waiting an ACK. Signed-off-by: Matheus Tavares Bernardino Acked-by: Alex Bennée --- tests/guest-debug/run-test.py| 16 .../tcg/multiarch/system/Makefile.softmmu-target | 16 +++- 2 files changed, 27 insertions(+), 5 deletions(-) diff

[PATCH v3 0/6] Hexagon: add lldb support

2023-05-04 Thread Matheus Tavares Bernardino
ic_mathb...@quicinc.com/ v1: https://lore.kernel.org/qemu-devel/cover.1680808943.git.quic_mathb...@quicinc.com/ Brian Cain (1): Hexagon (gdbstub): fix p3:0 read and write via stub Matheus Tavares Bernardino (4): gdbstub: only send stop-reply packets when allowed to gdbstub: add test for untim

[PATCH v3 1/6] gdbstub: only send stop-reply packets when allowed to

2023-05-04 Thread Matheus Tavares Bernardino
-lldb. Let's change the gdbstub to send stop messages only as a response to a previous GDB command that accepts such a reply. Signed-off-by: Matheus Tavares Bernardino Acked-by: Alex Bennée --- gdbstub/internals.h | 5 + gdbstub/gdbstub.c | 37 - gdbstub

Re: [PATCH v2 RESEND 4/7] Hexagon: support qRegisterInfo at gdbstub

2023-04-21 Thread Matheus Tavares Bernardino
Philippe Mathieu-Daudé wrote: > > > Matheus Tavares wrote: > > > > diff --git a/target/hexagon/gdb_qreginfo.h b/target/hexagon/gdb_qreginfo.h > > new file mode 100644 > > index 00..64631ddd58 > > --- /dev/null > > +++ b/target/hexagon/gdb_qreginfo.h > > This should be

Re: [PATCH v2 RESEND 3/7] gdbstub: add support for the qRegisterInfo query

2023-04-21 Thread Matheus Tavares Bernardino
Alex Bennée wrote: > > > Matheus Tavares wrote: > > > > diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c > > index be18568d0a..f19f8c58c3 100644 > > --- a/gdbstub/gdbstub.c > > +++ b/gdbstub/gdbstub.c > > @@ -1578,6 +1599,12 @@ static const GdbCmdParseEntry gdb_gen_query_table[] > > = { > >

Re: [PATCH v2 RESEND 1/7] gdbstub: only send stop-reply packets when allowed to

2023-04-21 Thread Matheus Tavares Bernardino
Alex Bennée wrote: > > > Matheus Tavares wrote: > > > > diff --git a/gdbstub/user.c b/gdbstub/user.c > > index 80488b6bb9..bb03622c83 100644 > > --- a/gdbstub/user.c > > +++ b/gdbstub/user.c > > @@ -174,12 +177,14 @@ void gdb_signalled(CPUArchState *env, int sig) > > { > > char buf[4]; > >

[PATCH v2 RESEND 5/7] Hexagon (gdbstub): fix p3:0 read and write via stub

2023-04-20 Thread Matheus Tavares Bernardino
From: Brian Cain Co-authored-by: Sid Manning Signed-off-by: Sid Manning Signed-off-by: Brian Cain Co-authored-by: Matheus Tavares Bernardino Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Taylor Simpson --- target/hexagon/gdbstub.c | 16 1 file changed, 16

[PATCH v2 RESEND 2/7] gdbstub: add test for untimely stop-reply packets

2023-04-20 Thread Matheus Tavares Bernardino
was in fact waiting an ACK. Signed-off-by: Matheus Tavares Bernardino --- tests/guest-debug/run-test.py| 16 .../tcg/multiarch/system/Makefile.softmmu-target | 16 +++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/tests/guest

[PATCH v2 RESEND 6/7] Hexagon (gdbstub): add HVX support

2023-04-20 Thread Matheus Tavares Bernardino
From: Taylor Simpson Co-authored-by: Brian Cain Signed-off-by: Brian Cain Signed-off-by: Taylor Simpson Co-authored-by: Matheus Tavares Bernardino Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/gdbstub.c | 60 1 file changed, 60

[PATCH v2 RESEND 4/7] Hexagon: support qRegisterInfo at gdbstub

2023-04-20 Thread Matheus Tavares Bernardino
From: Brian Cain Signed-off-by: Brian Cain Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/gdb_qreginfo.h | 124 ++ target/hexagon/cpu.c | 3 + 2 files changed, 127 insertions(+) create mode 100644 target/hexagon/gdb_qreginfo.h diff

[PATCH v2 RESEND 3/7] gdbstub: add support for the qRegisterInfo query

2023-04-20 Thread Matheus Tavares Bernardino
From: Brian Cain Signed-off-by: Brian Cain Signed-off-by: Matheus Tavares Bernardino --- include/hw/core/cpu.h | 4 gdbstub/gdbstub.c | 27 +++ 2 files changed, 31 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 397fd3ac68

[PATCH v2 RESEND 1/7] gdbstub: only send stop-reply packets when allowed to

2023-04-20 Thread Matheus Tavares Bernardino
-lldb. Let's change the gdbstub to send stop messages only as a response to a previous GDB command that accepts such a reply. Signed-off-by: Matheus Tavares Bernardino --- gdbstub/internals.h | 5 + gdbstub/gdbstub.c | 37 - gdbstub/softmmu.c | 13

[PATCH v2 RESEND 7/7] Hexagon (linux-user/hexagon): handle breakpoints

2023-04-20 Thread Matheus Tavares Bernardino
From: Taylor Simpson This enables LLDB to work with hexagon linux-user mode through the GDB remote protocol. Signed-off-by: Taylor Simpson Signed-off-by: Matheus Tavares Bernardino --- linux-user/hexagon/cpu_loop.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/linux-user

[PATCH v2 RESEND 0/7] Hexagon: add lldb support

2023-04-20 Thread Matheus Tavares Bernardino
and write via stub Matheus Tavares Bernardino (2): gdbstub: only send stop-reply packets when allowed to gdbstub: add test for untimely stop-reply packets Taylor Simpson (2): Hexagon (gdbstub): add HVX support Hexagon (linux-user/hexagon): handle breakpoints gdbstub/internals.h

[PATCH 7/7] Hexagon (linux-user/hexagon): handle breakpoints

2023-04-06 Thread Matheus Tavares Bernardino
From: Taylor Simpson This enables LLDB to work with hexagon linux-user mode through the GDB remote protocol. Signed-off-by: Taylor Simpson Signed-off-by: Matheus Tavares Bernardino --- linux-user/hexagon/cpu_loop.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/linux-user

[PATCH 4/7] Hexagon: support qRegisterInfo at gdbstub

2023-04-06 Thread Matheus Tavares Bernardino
From: Brian Cain Signed-off-by: Brian Cain Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/gdb_qreginfo.h | 124 ++ target/hexagon/cpu.c | 3 + 2 files changed, 127 insertions(+) create mode 100644 target/hexagon/gdb_qreginfo.h diff

[PATCH 6/7] Hexagon (gdbstub): add HVX support

2023-04-06 Thread Matheus Tavares Bernardino
From: Taylor Simpson Co-authored-by: Brian Cain Signed-off-by: Brian Cain Signed-off-by: Taylor Simpson Co-authored-by: Matheus Tavares Bernardino Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/gdbstub.c | 60 1 file changed, 60

[PATCH 1/7] gdbstub: only send stop-reply packets when allowed to

2023-04-06 Thread Matheus Tavares Bernardino
-lldb. Let's change the gdbstub to send stop messages only as a response to a previous GDB command that accepts such a reply. Signed-off-by: Matheus Tavares Bernardino --- gdbstub/internals.h | 5 + gdbstub/gdbstub.c | 37 - gdbstub/softmmu.c | 13

[PATCH 5/7] Hexagon (gdbstub): fix p3:0 read and write via stub

2023-04-06 Thread Matheus Tavares Bernardino
From: Brian Cain Co-authored-by: Sid Manning Signed-off-by: Sid Manning Signed-off-by: Brian Cain Co-authored-by: Matheus Tavares Bernardino Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/gdbstub.c | 16 1 file changed, 16 insertions(+) diff --git a/target

[PATCH 3/7] gdbstub: add support for the qRegisterInfo query

2023-04-06 Thread Matheus Tavares Bernardino
From: Brian Cain Signed-off-by: Brian Cain Signed-off-by: Matheus Tavares Bernardino --- include/hw/core/cpu.h | 4 gdbstub/gdbstub.c | 27 +++ 2 files changed, 31 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 821e937020

[PATCH 2/7] gdbstub: add test for untimely stop-reply packets

2023-04-06 Thread Matheus Tavares Bernardino
was in fact waiting an ACK. Signed-off-by: Matheus Tavares Bernardino --- tests/guest-debug/run-test.py| 16 .../tcg/multiarch/system/Makefile.softmmu-target | 16 +++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/tests/guest

[PATCH 0/7] Hexagon: add lldb support

2023-04-06 Thread Matheus Tavares Bernardino
Matheus Tavares Bernardino (2): gdbstub: only send stop-reply packets when allowed to gdbstub: add test for untimely stop-reply packets Taylor Simpson (2): Hexagon (gdbstub): add HVX support Hexagon (linux-user/hexagon): handle breakpoints gdbstub/internals.h

[PATCH] Hexagon (translate.c): avoid redundant PC updates on COF

2023-03-22 Thread Matheus Tavares Bernardino
the additional "move_to_pc" flag instead of just avoiding the update whenever `dest == ctx->next_PC`, as that could potentially skip updates from a COF with met condition, whose ctx->branch_dest just happens to be equal to ctx->next_PC. Signed-off-by: Matheus Tavares Bernardino --

[PATCH RESEND v2 2/2] migration/xbzrle: fix out-of-bounds write with axv512

2023-03-13 Thread Matheus Tavares Bernardino
0 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x57ef0) Fix that by performing the overflow check in the inner loop, instead. Signed-off-by: Matheus Tavares Bernardino --- migration/xbzrle.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/migration/xbzrle.c b/migration/

[PATCH RESEND v2 1/2] migration/xbzrle: use ctz64 to avoid undefined result

2023-03-13 Thread Matheus Tavares Bernardino
which properly handles 0. Signed-off-by: Matheus Tavares Bernardino --- migration/xbzrle.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/migration/xbzrle.c b/migration/xbzrle.c index 05366e86c0..21b92d4eae 100644 --- a/migration/xbzrle.c +++ b/migration/xbzrle.c @@ -12,6

[PATCH RESEND v2 0/2] migration/xbzrle: fix two avx512 runtime issues

2023-03-13 Thread Matheus Tavares Bernardino
org/qemu-devel/cover.1678199971.git.quic_mathb...@quicinc.com/ (No changes since v1, only rebased on current master) Matheus Tavares Bernardino (2): migration/xbzrle: use ctz64 to avoid undefined result migration/xbzrle: fix out-of-bounds write with axv512 migration/xbzrle.c | 12 ++--

[PATCH 2/2] migration/xbzrle: fix out-of-bounds write with axv512

2023-03-07 Thread Matheus Tavares Bernardino
0 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x57ef0) Fix that by performing the overflow check in the inner loop, instead. Signed-off-by: Matheus Tavares Bernardino --- migration/xbzrle.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/migration/xbzrle.c b/migration/

[PATCH 1/2] migration/xbzrle: use ctz64 to avoid undefined result

2023-03-07 Thread Matheus Tavares Bernardino
which properly handles 0. Signed-off-by: Matheus Tavares Bernardino --- migration/xbzrle.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/migration/xbzrle.c b/migration/xbzrle.c index 05366e86c0..21b92d4eae 100644 --- a/migration/xbzrle.c +++ b/migration/xbzrle.c @@ -12,6

[PATCH 0/2] migration/xbzrle: fix two avx512 runtime issues

2023-03-07 Thread Matheus Tavares Bernardino
Matheus Tavares Bernardino (2): migration/xbzrle: use ctz64 to avoid undefined result migration/xbzrle: fix out-of-bounds write with axv512 migration/xbzrle.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.39.1

[PATCH] io/channel-tls: plug memory leakage on GSource

2023-03-06 Thread Matheus Tavares Bernardino
/unit/test-io-channel-tls shows no leakages. Signed-off-by: Matheus Tavares Bernardino --- io/channel-tls.c | 1 + 1 file changed, 1 insertion(+) diff --git a/io/channel-tls.c b/io/channel-tls.c index 8052945ba0..5a7a3d48d6 100644 --- a/io/channel-tls.c +++ b/io/channel-tls.c @@ -44

Re: hexagon: check-tcg rebuilding up to date image

2023-03-06 Thread Matheus Tavares Bernardino
Alex Bennée writes: > > Fabiano Rosas writes: > > > > > I think we might need to add DOCKER_BUILDKIT=1 $(RUNC) ... to properly > > make use of caching with docker. As for podman, I'm seeing conflicting > > information on the web as to whether it even supports caching. > > As opposed to

hexagon: check-tcg rebuilding up to date image

2023-03-03 Thread Matheus Tavares Bernardino
Hi, We noticed that local `make check-tcg` is rebuilding the docker image for qemu-hexagon at every run, whereas previously it would say "Image is up to date" and move on. This was changed at 0b1a649047 (tests/docker: use direct RUNC call to build containers, 2023-02-28), where we started to no

Re: [PATCH] Hexagon (meson.build): define min bison version

2023-02-07 Thread Matheus Tavares Bernardino
Thomas Huth wrote: > > Out of curiosity: Where did you encounter this problem? After having a quick > look at https://repology.org/project/bison/versions it seems to me that all > our supported OS distros should already ship bison 3.0 or newer... I actually noticed this when compiling our

[PATCH] Hexagon (meson.build): define min bison version

2023-02-07 Thread Matheus Tavares Bernardino
0025define-parse_002eerror Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hexagon/meson.build b/target/hexagon/meson.build index c9d31d095c..42b03c81e6 100644 --- a/target/hexagon/meson.build ++

[PATCH 1/2] Hexagon (iclass): update J4_hintjumpr slot constraints

2023-01-13 Thread Matheus Tavares Bernardino
during decoding time and throw an invalid packet exception. That will be done in the subsequent commit. Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/iclass.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/hexagon/iclass.c b/target/hexagon/iclass.c index

[PATCH 2/2] Hexagon (decode): look for pkts with multiple insns at the same slot

2023-01-13 Thread Matheus Tavares Bernardino
r to debug possible future errors caused by missing updates to `find_iclass_slots()` rules in target/hexagon/iclass.c. Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/decode.c | 30 +++--- tests/tcg/hexagon/Makefile.target | 10 ++ tests/t

[PATCH 0/2] Hexagon: update and enforce hintjr slot constraints

2023-01-13 Thread Matheus Tavares Bernardino
This small series basically fix an outdated hexagon slot rule for instruction hintjr and makes the decode machinery more resilient against any possible outdated slot constraints in the future. Matheus Tavares Bernardino (2): Hexagon (iclass): update J4_hintjumpr slot constraints Hexagon

[PATCH] target/hexagon/idef-parser: fix two typos in README

2022-12-27 Thread Matheus Tavares Bernardino
Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/idef-parser/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hexagon/idef-parser/README.rst b/target/hexagon/idef-parser/README.rst index 65e6bf4ee5..ff6d14150a 100644 --- a/target/hexagon/idef

[PATCH] accel/tcg/tcg-accel-ops-rr: fix trivial typo

2022-10-23 Thread Matheus Tavares Bernardino
Signed-off-by: Matheus Tavares Bernardino --- accel/tcg/tcg-accel-ops-rr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index cc8adc2380..cc912df108 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg

Re: [PATCH 7/8] Hexagon (target/hexagon) Use direct block chaining for direct jump/branch

2022-10-20 Thread Matheus Tavares Bernardino
Taylor Simpson wrote: > > diff --git a/target/hexagon/translate.h b/target/hexagon/translate.h > index eae358cf33..e60dbf0e7a 100644 > --- a/target/hexagon/translate.h > +++ b/target/hexagon/translate.h > @@ -54,6 +54,9 @@ typedef struct DisasContext { > bool qreg_is_predicated[NUM_QREGS]; >

  1   2   >