[PATCH v2] hw: fix memory leak in IRQState allocation

2024-09-18 Thread Matheus Tavares Bernardino
e object is finalized, but the former doesn't. Fixes: e72a7f65c1 (hw: Move declaration of IRQState to header and add init function) Signed-off-by: Matheus Tavares Bernardino Reviewed-by: BALATON Zoltan --- In v2: adjusted function init_irq_fields name to reflect it is not public and ad

[PATCH] hw: fix memory leak in IRQState allocation

2024-09-17 Thread Matheus Tavares Bernardino
e object is finalized, but the former doesn't. Signed-off-by: Matheus Tavares Bernardino --- hw/core/irq.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/hw/core/irq.c b/hw/core/irq.c index db95ffc18f..7d80de1ca6 100644 --- a/hw/core/irq.c +++ b/

[PATCH v2] docs/fuzz: fix outdated mention to enable-sanitizers

2024-09-13 Thread Matheus Tavares Bernardino
This options has been removed at cb771ac1f5 (meson: Split --enable-sanitizers to --enable-{asan, ubsan}, 2024-08-13), so let's update its last standing mention in the docs. Signed-off-by: Matheus Tavares Bernardino --- In v2: fixed grammar typo and s/use-after-frees/uses-after-free/ v1:

[PATCH] docs/fuzz: fix outdated mention to enable-sanitizers

2024-09-12 Thread Matheus Tavares Bernardino
This options has been removed at cb771ac1f5 (meson: Split --enable-sanitizers to --enable-{asan, ubsan}, 2024-08-13), so let's update its last standing mention in the docs. Signed-off-by: Matheus Tavares Bernardino --- docs/devel/testing/fuzzing.rst | 5 +++-- 1 file changed, 3 insertions(

[PATCH] target/hexagon: relicense GPL files to BSD-3

2024-09-04 Thread Matheus Tavares Bernardino
touches Hexagon files that have been contributed exclusive from Quic Inc employees (ignoring both files directly changed by other contributors as well as files with patches that have Helped-by and Co-authored-by trailers from others). Signed-off-by: Matheus Tavares Bernardino --- target/hexagon

[PATCH v2] Hexagon: fix F2_conv_* instructions for negative zero

2024-07-29 Thread Matheus Tavares Bernardino
The implementation for these instructions handles -0 as an invalid float point value, whereas the Hexagon hardware considers it the same as +0 (which is valid). Let's fix that and add a regression test. Signed-off-by: Matheus Tavares Bernardino Reviewed-by: Brian Cain Reviewed-by: T

[PATCH] Hexagon: fix F2_conv_* instructions for negative zero

2024-07-28 Thread Matheus Tavares Bernardino
The implementation for these instructions handles -0 as an invalid float point value, whereas the Hexagon hardware considers it the same as +0 (which is valid). Let's fix that and add a regression test. Signed-off-by: Matheus Tavares Bernardino --- target/hexagon/op_helper.c

Re: [PATCH v2] Hexagon: lldb read/write predicate registers p0/p1/p2/p3

2024-06-17 Thread Matheus Tavares Bernardino
x00 > p2 = 0x00 > p3 = 0x00 > > (lldb) reg write p1 0xf > (lldb) reg read p3_0 > p3_0 = 0x0f00 > (lldb) reg write p3_0 0xff00ff00 > (lldb) reg read -s 1 > Predicate Registers: > p0 = 0x00 > p1 = 0xff > p2 = 0x00 > p3 = 0xff > > Signed-off-by: Taylor Simpson Reviewed-by: Matheus Tavares Bernardino

Re: [PATCH] Hexagon: lldb read/write predicate registers p0/p1/p2/p3

2024-06-12 Thread Matheus Tavares Bernardino
On Wed, 12 Jun 2024 10:42:39 -0600 Taylor Simpson wrote: > > diff --git a/target/hexagon/gdbstub.c b/target/hexagon/gdbstub.c > index 502c6987f0..e67e627fc9 100644 > --- a/target/hexagon/gdbstub.c > +++ b/target/hexagon/gdbstub.c > @@ -56,6 +64,15 @@ int hexagon_gdb_write_register(CPUState *cs, u

[PATCH] cpu: fix memleak of 'halt_cond' and 'thread'

2024-06-12 Thread Matheus Tavares Bernardino
Signed-off-by: Matheus Tavares Bernardino --- accel/tcg/tcg-accel-ops-rr.c | 1 + hw/core/cpu-common.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 84c36c1450..48c38714bd 100644 --- a/accel/tcg/tcg-accel-ops-r

[PATCH] Hexagon: fix HVX store new

2024-05-20 Thread Matheus Tavares Bernardino
type: '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

[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

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 --- Cha

[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/

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/

[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

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

2024-04-29 Thread Matheus Tavares Bernardino
omplete. 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

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 diffe

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

2024-04-11 Thread Matheus Tavares Bernardino
27;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 +

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 gen_

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 gen_

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 ge

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 regtype/re

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 reprodu

[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-Dau

[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 -

[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 it. Now,

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 --- gdbst

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
to simplify the code, 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/93a2ca786530cbc8a94f

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

2023-07-11 Thread Matheus Tavares Bernardino
to simplify the code, 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 &#

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

2023-07-11 Thread Matheus Tavares Bernardino
to simplify the code, 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/93a2ca786530cbc8a94f

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
to simplify the code, 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.k

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
to simplify the code, 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_nosh

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
to simplify the code, 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 inserti

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: >

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

2023-06-23 Thread Matheus Tavares Bernardino
#x27;, 'c', 'S', 's', 'vCont', 'vAttach', 'vRun', 'vStopped', and '?' packets can receive any of the below as a reply." But their definitions at [2] do say the following: 'bc' (and 'bc')

[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 fil

[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
Suggested-by: Taylor Simpson Signed-off-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_fun

[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 tar

[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

[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 inser

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

2023-05-23 Thread Matheus Tavares Bernardino
nt 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/genpt

[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 first pat

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

2023-05-04 Thread Matheus Tavares Bernardino
nary? Or 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/ Math

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

2023-05-04 Thread Matheus Tavares Bernardino
unable to find 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..f47e13053

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

2023-05-04 Thread Matheus Tavares Bernardino
before 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 Tavare

[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: Ma

[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
n GDB 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(-)

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

2023-05-04 Thread Matheus Tavares Bernardino
it.quic_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

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

2023-05-04 Thread Matheus Tavares Bernardino
ke hexagon-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 ---

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 gdb_qreginfo.h.inc

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
n GDB 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/

[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
ke hexagon-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/s

[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
p3:0 read 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/i

[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
ke hexagon-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/s

[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
n GDB 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/

[PATCH 0/7] Hexagon: add lldb support

2023-04-06 Thread Matheus Tavares Bernardino
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/intern

[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

  1   2   >