Currently, all versions of Hexagon CPU are treated the same, and all
opcodes are able to run on any version. This series changes the behavior
such that only the opcodes available on the currently executing Hexagon
CPU version can execute.
Changes include:
Mark which Hexagon CPU version is currently executing
Check that each opcode is supported in the Hexagon CPU version
If not, raise SIGILL
Properly handle disassembly (-d in_asm)
Test case added
Note that this series borrows elements from Brian Cain's "Handle some
invalid encodings" series. Therefore, it will need slight rework after
those patches are merged.
Co-authored-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
Co-authored-by: Brian Cain <brian.cain@oss.qualcomm.com>
Brian Cain (2):
Hexagon (linux-user/hexagon) Convert INVALID_PACKET into SIGILL
tests/tcg/hexagon: Add test for revision-gated instruction decoding
Matheus Tavares Bernardino (1):
Hexagon (target/hexagon) Introduce tag_rev_info.c.inc
Taylor Simpson (5):
Hexagon (target/hexagon) Properly handle Hexagon CPU version
Hexagon (linux-user/hexagon) Identify Hexagon version in ELF file
Hexagon (target/hexagon) Add Hexagon version field to DisasContext
Hexagon (target/hexagon) Check each opcode against current CPU version
Hexagon (target/hexagon) Disassembly of invalid packets
target/hexagon/cpu-qom.h | 21 ++++
target/hexagon/cpu.h | 2 +
target/hexagon/cpu_bits.h | 4 +-
target/hexagon/translate.h | 1 +
disas/hexagon.c | 3 +-
linux-user/hexagon/cpu_loop.c | 4 +
linux-user/hexagon/elfload.c | 43 ++++----
target/hexagon/cpu.c | 31 ++++--
target/hexagon/decode.c | 43 +++++++-
target/hexagon/translate.c | 20 +++-
tests/tcg/hexagon/check_rev_gating.c | 141 +++++++++++++++++++++++++++
tests/tcg/hexagon/invalid-slots.c | 76 +++++++++++----
target/hexagon/tag_rev_info.c.inc | 61 ++++++++++++
tests/tcg/hexagon/Makefile.target | 12 +--
14 files changed, 409 insertions(+), 53 deletions(-)
create mode 100644 tests/tcg/hexagon/check_rev_gating.c
create mode 100644 target/hexagon/tag_rev_info.c.inc
--
2.43.0