On Sat, 15 Aug 2026 at 21:39, Richard Henderson <[email protected]> wrote: > > We had a confusing relationship between 'probe' and 'ra == 0'. > Make this explicit via an enumeration. > > Signed-off-by: Richard Henderson <[email protected]> > --- > target/arm/tcg/mte_helper.c | 130 ++++++++++++++++++++++-------------- > 1 file changed, 80 insertions(+), 50 deletions(-) > > diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c > index dd4c10ef4f..31bf58c937 100644 > --- a/target/arm/tcg/mte_helper.c > +++ b/target/arm/tcg/mte_helper.c > @@ -87,28 +87,48 @@ typedef struct AllocationTagMem { > MemTxAttrs attrs; > } AllocationTagMem; > > +typedef enum { > + /* Trap on missing pages, invalid tag access, or watchpoints. */ > + ATM_NORMAL, > + /* Gracefully return no tag memory for invalid pages. */ > + ATM_PROBE_PAGES, > + /* > + * Basic page access has already been checked, > + * so a missing tlb entry is some sort of bug. > + * Assert the tlb entry is present, but gracefully fail if tag > + * access is not permitted to the page. > + */ > + ATM_ASSERT_PAGES, > +} AllocationTagMemKind; > + > static AllocationTagMem > allocation_tag_mem_internal(CPUARMState *env, int ptr_mmu_idx, > vaddr ptr, MMUAccessType ptr_access, > int ptr_size, MMUAccessType tag_access, > - bool probe, uintptr_t ra) > + uintptr_t ra, AllocationTagMemKind atm_kind)
I think we generally prefer to make 'uintptr_t ra' the final argument to a function call (though we don't 100% follow that convention). Otherwise Reviewed-by: Peter Maydell <[email protected]> thanks -- PMM
