On Tue, 31 Oct 2023 at 09:23, Marielle Novastrider <marie...@novastrider.com> wrote: > > > > > On 31 Oct 2023, at 00:56, Marielle Novastrider <marie...@novastrider.com> > > wrote: > > > >> On 30 Oct 2023, at 09:52, Peter Maydell <peter.mayd...@linaro.org> wrote: > >> > >> ...but we don't implement FEAT_MTE3 yet. We would add this feature test > >> function, and the GET_FEATURE_ID() line, when we do, but we don't > >> need it until then. > > > > Understood. > > > > I made this patch as I noticed the discrepancy between cpuid and hwcap > > output. > > > > The following code produces the value of 3 on current master, which would > > be erroneous if FEAT_MT3 is unimplemented: > > > > #include <stdint.h> > > #include <stdio.h> > > > > int main() { > > uint64_t aa64pfr1; > > __asm__("mrs %0, s3_0_c0_c4_1" : "=r"(aa64pfr1)); > > std::printf("%lu\n", (aa64pfr1 >> 8) & 0xf); > > return 0; > > } > > > > I can submit another patch to correct this.
> I note that commit 86f0d4c7290eb2b21ec3eb44956ec245441275db suggests that > FEAT_MTE3 is already implemented. I'm sorry, you're right -- we have implemented MTE3. I was confused by the lack of an existing feature test function for it, but we didn't need the feature test because FEAT_MTE3 only added behaviour to previously-reserved values of the TCF field, so we allowed our behaviour on non-FEAT_MTE3 CPUs to be "happens to behave like FEAT_MTE3". Your patch as it stands is correct, and I've applied it to target-arm.next. (There's a trivial conflict as a change has just landed which moves all the feature test functions to their own header, but I have fixed that up while applying.) Thanks for the patch! -- PMM