> -----Original Message-----
> From: Taylor Simpson
> Sent: Tuesday, May 9, 2023 11:46 AM
> To: Matheus Tavares Bernardino <quic_mathb...@quicinc.com>; qemu-
> de...@nongnu.org
> Subject: RE: [PATCH v2] Hexagon (decode): look for pkts with multiple insns
> at the same slot
> 
> 
> 
> > -----Original Message-----
> > From: Matheus Tavares Bernardino <quic_mathb...@quicinc.com>
> > Sent: Monday, May 8, 2023 8:37 AM
> > To: qemu-devel@nongnu.org
> > Cc: Taylor Simpson <tsimp...@quicinc.com>
> > Subject: [PATCH v2] Hexagon (decode): look for pkts with multiple insns at
> > the same slot
> >
> > Each slot in a packet can be assigned to at most one instruction.
> > Although the assembler generally ought to enforce this rule, we better be
> > safe than sorry and also do some check to properly throw an "invalid
> packet"
> > exception on wrong slot assignments.
> >
> > This should also make it easier to debug possible future errors caused by
> > missing updates to `find_iclass_slots()` rules in target/hexagon/iclass.c.
> >
> > Co-authored-by: Taylor Simpson <tsimp...@quicinc.com>
> > Signed-off-by: Taylor Simpson <tsimp...@quicinc.com>
> > Signed-off-by: Matheus Tavares Bernardino
> <quic_mathb...@quicinc.com>
> > ---
> > Changes in v2:
> > - Only call decode_set_slot_number() with !disas_only, fixing the -d
> >   in_asm case.
> >
> > v1: https://lore.kernel.org/qemu-
> >
> devel/7a90f0925f182e56cf49ec3ec01484739fa2f174.1683226473.git.quic_mat
> > hb...@quicinc.com/
> >
> >  target/hexagon/decode.c           | 30 +++++++++++++++++++++++++++---
> >  tests/tcg/hexagon/invalid-slots.c | 29
> +++++++++++++++++++++++++++++
> > tests/tcg/hexagon/Makefile.target | 11 +++++++++++
> >  3 files changed, 67 insertions(+), 3 deletions(-)  create mode 100644
> > tests/tcg/hexagon/invalid-slots.c
> >
> > diff --git a/tests/tcg/hexagon/Makefile.target
> > b/tests/tcg/hexagon/Makefile.target
> > index 7c94db4bc4..0c69216c6c 100644
> > --- a/tests/tcg/hexagon/Makefile.target
> > +++ b/tests/tcg/hexagon/Makefile.target
> > @@ -49,6 +49,17 @@ HEX_TESTS += vector_add_int  HEX_TESTS +=
> > scatter_gather  HEX_TESTS += hvx_misc  HEX_TESTS += hvx_histogram
> > +HEX_TESTS += invalid-slots
> > +
> > +run-and-check-exception = $(call run-test,$2,$3 2>$2.stderr; \
> > +   test $$? -eq 1 && grep -q "exception $(strip $1)" $2.stderr)
> > +
> > +run-invalid-slots: invalid-slots
> > +   $(call run-and-check-exception, 0x15, $@, $(QEMU) $(QEMU_OPTS)
> > $<)
> > +
> > +run-plugin-invalid-slots-with-%: invalid-slots
> > +   $(call run-and-check-exception, 0x15, $@, $(QEMU) $(QEMU_OPTS)
> > \
> > +   -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) $(call
> > +strip-plugin,$<))
> 
> This isn't invoked and is missing some pieces.  I'll remove it from the PR.
> 
> Otherwise,
> Reviewed-by: Taylor Simpson <tsimp...@quicinc.com>

Also
Tested-by: Taylor Simpson <tsimp...@quicinc.com>



Reply via email to