@@ -156,8 +156,10 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t phys)
156
156
* not set) must return false. PROT_NONE mappings do not have the
157
157
* PTE_VALID bit set.
158
158
*/
159
- #define pte_access_permitted (pte , write ) \
159
+ #define pte_access_permitted_no_overlay (pte , write ) \
160
160
(((pte_val(pte) & (PTE_VALID | PTE_USER)) == (PTE_VALID | PTE_USER)) && (!(write) || pte_write(pte)))
161
+ #define pte_access_permitted (pte , write ) \
162
+ pte_access_permitted_no_overlay(pte, write)
161
163
#define pmd_access_permitted (pmd , write ) \
162
164
(pte_access_permitted(pmd_pte(pmd), (write)))
163
165
#define pud_access_permitted (pud , write ) \
@@ -373,10 +375,11 @@ static inline void __sync_cache_and_tags(pte_t pte, unsigned int nr_pages)
373
375
/*
374
376
* If the PTE would provide user space access to the tags associated
375
377
* with it then ensure that the MTE tags are synchronised. Although
376
- * pte_access_permitted() returns false for exec only mappings, they
377
- * don't expose tags (instruction fetches don't check tags).
378
+ * pte_access_permitted_no_overlay() returns false for exec only
379
+ * mappings, they don't expose tags (instruction fetches don't check
380
+ * tags).
378
381
*/
379
- if (system_supports_mte () && pte_access_permitted (pte , false) &&
382
+ if (system_supports_mte () && pte_access_permitted_no_overlay (pte , false) &&
380
383
!pte_special (pte ) && pte_tagged (pte ))
381
384
mte_sync_tags (pte , nr_pages );
382
385
}
0 commit comments