target/arm: Record tagged bit for user-only in sve_probe_page
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 7 Jul 2022 10:36:08 +0000 (11:36 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 7 Jul 2022 10:36:08 +0000 (11:36 +0100)
Fixes a bug in that we were not honoring MTE from user-only
SVE. Copy the user-only MTE logic from allocation_tag_mem
into sve_probe_page.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/sve_helper.c

index db15d03ded837ae11d776d7321a432076131b4c5..0c6379e6e80e3cc1efd40341576f9a8d2e054b17 100644 (file)
@@ -5337,6 +5337,9 @@ bool sve_probe_page(SVEHostPage *info, bool nofault, CPUARMState *env,
 
 #ifdef CONFIG_USER_ONLY
     memset(&info->attrs, 0, sizeof(info->attrs));
+    /* Require both MAP_ANON and PROT_MTE -- see allocation_tag_mem. */
+    arm_tlb_mte_tagged(&info->attrs) =
+        (flags & PAGE_ANON) && (flags & PAGE_MTE);
 #else
     /*
      * Find the iotlbentry for addr and return the transaction attributes.