[PATCH 0/3] Handle some invalid encodings

Brian Cain posted 3 patches 1 day, 23 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260206183813.2573541-1-brian.cain@oss.qualcomm.com
Maintainers: Brian Cain <brian.cain@oss.qualcomm.com>, Laurent Vivier <laurent@vivier.eu>, Pierrick Bouvier <pierrick.bouvier@linaro.org>
There is a newer version of this series
linux-user/hexagon/cpu_loop.c        |  4 ++++
target/hexagon/decode.c              | 28 +++++++++++++++++++++++++---
target/hexagon/translate.c           | 18 ++++++++++++++++--
tests/tcg/hexagon/invalid-duplex.c   | 28 ++++++++++++++++++++++++++++
tests/tcg/hexagon/invalid-dups.c     | 23 +++++++++++++++++++++++
tests/tcg/hexagon/invalid-encoding.c | 20 ++++++++++++++++++++
tests/tcg/hexagon/Makefile.target    | 23 ++++++++++++++++++++++-
7 files changed, 138 insertions(+), 6 deletions(-)
create mode 100644 tests/tcg/hexagon/invalid-duplex.c
create mode 100644 tests/tcg/hexagon/invalid-dups.c
create mode 100644 tests/tcg/hexagon/invalid-encoding.c
[PATCH 0/3] Handle some invalid encodings
Posted by Brian Cain 1 day, 23 hours ago
Fix the issues reported by Alex Rønne Petersen causing zig test suite
failures.  The 0x0 case is a conflicting "multiple register write" - the
handler here will cover duplexes but not the more general case of multiple
register writes.  I'll include that in a subsequent patchset.

Brian Cain (3):
  target/hexagon: Fix invalid duplex decoding
  target/hexagon: Reject duplex encodings with duplicate dest registers
  target/hexagon: Return decode failure for invalid non-duplex encodings

 linux-user/hexagon/cpu_loop.c        |  4 ++++
 target/hexagon/decode.c              | 28 +++++++++++++++++++++++++---
 target/hexagon/translate.c           | 18 ++++++++++++++++--
 tests/tcg/hexagon/invalid-duplex.c   | 28 ++++++++++++++++++++++++++++
 tests/tcg/hexagon/invalid-dups.c     | 23 +++++++++++++++++++++++
 tests/tcg/hexagon/invalid-encoding.c | 20 ++++++++++++++++++++
 tests/tcg/hexagon/Makefile.target    | 23 ++++++++++++++++++++++-
 7 files changed, 138 insertions(+), 6 deletions(-)
 create mode 100644 tests/tcg/hexagon/invalid-duplex.c
 create mode 100644 tests/tcg/hexagon/invalid-dups.c
 create mode 100644 tests/tcg/hexagon/invalid-encoding.c

-- 
2.34.1

Re: [PATCH 0/3] Handle some invalid encodings
Posted by Pierrick Bouvier 1 day, 19 hours ago
On 2/6/26 10:38 AM, Brian Cain wrote:
> Fix the issues reported by Alex Rønne Petersen causing zig test suite
> failures.  The 0x0 case is a conflicting "multiple register write" - the
> handler here will cover duplexes but not the more general case of multiple
> register writes.  I'll include that in a subsequent patchset.
> 
> Brian Cain (3):
>    target/hexagon: Fix invalid duplex decoding
>    target/hexagon: Reject duplex encodings with duplicate dest registers
>    target/hexagon: Return decode failure for invalid non-duplex encodings
> 
>   linux-user/hexagon/cpu_loop.c        |  4 ++++
>   target/hexagon/decode.c              | 28 +++++++++++++++++++++++++---
>   target/hexagon/translate.c           | 18 ++++++++++++++++--
>   tests/tcg/hexagon/invalid-duplex.c   | 28 ++++++++++++++++++++++++++++
>   tests/tcg/hexagon/invalid-dups.c     | 23 +++++++++++++++++++++++
>   tests/tcg/hexagon/invalid-encoding.c | 20 ++++++++++++++++++++
>   tests/tcg/hexagon/Makefile.target    | 23 ++++++++++++++++++++++-
>   7 files changed, 138 insertions(+), 6 deletions(-)
>   create mode 100644 tests/tcg/hexagon/invalid-duplex.c
>   create mode 100644 tests/tcg/hexagon/invalid-dups.c
>   create mode 100644 tests/tcg/hexagon/invalid-encoding.c
> 

Sounds good.

I have one suggestion to improve it. For tests, it would be nice to 
catch SIGILL, so test returns 0 if it worked as expected, or exit with 1 
if SIGILL was not sent. It's just a suggestion though :)

Regards,
Pierrick

Re: [PATCH 0/3] Handle some invalid encodings
Posted by Brian Cain 1 day, 19 hours ago
On Fri, Feb 6, 2026 at 4:50 PM Pierrick Bouvier
<pierrick.bouvier@linaro.org> wrote:
>
> On 2/6/26 10:38 AM, Brian Cain wrote:
> > Fix the issues reported by Alex Rønne Petersen causing zig test suite
> > failures.  The 0x0 case is a conflicting "multiple register write" - the
> > handler here will cover duplexes but not the more general case of multiple
> > register writes.  I'll include that in a subsequent patchset.
> >
> > Brian Cain (3):
> >    target/hexagon: Fix invalid duplex decoding
> >    target/hexagon: Reject duplex encodings with duplicate dest registers
> >    target/hexagon: Return decode failure for invalid non-duplex encodings
> >
> >   linux-user/hexagon/cpu_loop.c        |  4 ++++
> >   target/hexagon/decode.c              | 28 +++++++++++++++++++++++++---
> >   target/hexagon/translate.c           | 18 ++++++++++++++++--
> >   tests/tcg/hexagon/invalid-duplex.c   | 28 ++++++++++++++++++++++++++++
> >   tests/tcg/hexagon/invalid-dups.c     | 23 +++++++++++++++++++++++
> >   tests/tcg/hexagon/invalid-encoding.c | 20 ++++++++++++++++++++
> >   tests/tcg/hexagon/Makefile.target    | 23 ++++++++++++++++++++++-
> >   7 files changed, 138 insertions(+), 6 deletions(-)
> >   create mode 100644 tests/tcg/hexagon/invalid-duplex.c
> >   create mode 100644 tests/tcg/hexagon/invalid-dups.c
> >   create mode 100644 tests/tcg/hexagon/invalid-encoding.c
> >
>
> Sounds good.
>
> I have one suggestion to improve it. For tests, it would be nice to
> catch SIGILL, so test returns 0 if it worked as expected, or exit with 1
> if SIGILL was not sent. It's just a suggestion though :)

Tsk - good call.  And that way I could combine the test cases.  I like
it, will do.

> Regards,
> Pierrick