Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149439734
D55956.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D55956.diff
View Options
diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -5369,19 +5369,27 @@
pv_entry_t pv;
vm_paddr_t opa, pa;
vm_page_t mpte, om;
+ vm_memattr_t memattr;
bool nosleep;
int full_lvl, lvl, rv;
KASSERT(ADDR_IS_CANONICAL(va),
("%s: Address not in canonical form: %lx", __func__, va));
+ memattr = m->md.pv_memattr;
+ if ((prot & PROT_MTE) != 0) {
+ MPASS(memattr == VM_MEMATTR_DEFAULT);
+ memattr = VM_MEMATTR_TAGGED;
+ mte_sync_tags(m);
+ }
+
va = trunc_page(va);
if ((m->oflags & VPO_UNMANAGED) == 0)
VM_PAGE_OBJECT_BUSY_ASSERT(m);
pa = VM_PAGE_TO_PHYS(m);
new_l3 = (pt_entry_t)(PHYS_TO_PTE(pa) | ATTR_AF | pmap_sh_attr |
L3_PAGE);
- new_l3 |= pmap_pte_memattr(pmap, m->md.pv_memattr);
+ new_l3 |= pmap_pte_memattr(pmap, memattr);
new_l3 |= pmap_pte_prot(pmap, prot);
if ((flags & PMAP_ENTER_WIRED) != 0)
new_l3 |= ATTR_SW_WIRED;
diff --git a/sys/sys/mman.h b/sys/sys/mman.h
--- a/sys/sys/mman.h
+++ b/sys/sys/mman.h
@@ -55,7 +55,13 @@
#if __BSD_VISIBLE
#define PROT_CHERI0 0x08
#define PROT_CHERI1 0x10
-#define _PROT_ALL (PROT_READ | PROT_WRITE | PROT_EXEC)
+#ifdef __aarch64__
+#define PROT_MTE 0x20
+#define _PROT_ARCH (PROT_MTE)
+#else
+#define _PROT_ARCH 0
+#endif
+#define _PROT_ALL (PROT_READ | PROT_WRITE | PROT_EXEC | _PROT_ARCH)
#define PROT_EXTRACT(prot) ((prot) & _PROT_ALL)
#define _PROT_MAX_SHIFT 16
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 25, 11:38 AM (2 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30204395
Default Alt Text
D55956.diff (1 KB)
Attached To
Mode
D55956: arm64: Add PROT_MTE to mmap
Attached
Detach File
Event Timeline
Log In to Comment