On Wed, 3 Jun 2020 at 02:13, Richard Henderson <richard.hender...@linaro.org> wrote: > > Fill out the stub that was added earlier. > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > target/arm/internals.h | 47 +++++++++++++++ > target/arm/mte_helper.c | 126 +++++++++++++++++++++++++++++++++++++++- > 2 files changed, 172 insertions(+), 1 deletion(-) > > diff --git a/target/arm/internals.h b/target/arm/internals.h > index fb92ef6b84..8ae80f3945 100644 > --- a/target/arm/internals.h > +++ b/target/arm/internals.h > @@ -1318,6 +1318,9 @@ FIELD(MTEDESC, WRITE, 8, 1) > FIELD(MTEDESC, ESIZE, 9, 5) > FIELD(MTEDESC, TSIZE, 14, 10) /* mte_checkN only */ > > +bool mte_probe1(CPUARMState *env, uint32_t desc, uint64_t ptr, uintptr_t ra); > +uint64_t mte_check1(CPUARMState *env, uint32_t desc, uint64_t ptr, uintptr_t > ra); > + > static inline int allocation_tag_from_addr(uint64_t ptr) > { > return extract64(ptr, 56, 4); > @@ -1328,4 +1331,48 @@ static inline uint64_t > address_with_allocation_tag(uint64_t ptr, int rtag) > return deposit64(ptr, 56, 4, rtag); > } > > +/* Return true if tbi bits mean that the access is checked. */ > +static inline bool tbi_check(uint32_t desc, int bit55) > +{ > + return (desc >> (R_MTEDESC_TBI_SHIFT + bit55)) & 1; > +} > + > +/* Return true if tcma bits mean that the access is unchecked. */ > +static inline bool tcma_check(uint32_t desc, int bit55, int ptr_tag)
It's a bit confusing that one of these foo_check()s returns "true for checked access" and the other one returns "true for unchecked access"... thanks -- PMM