git: 4fd450a87df0 - main - amd64 pmap: Pre-set PG_M on 2MB KASAN shadow map entries
Mark Johnston
markj at FreeBSD.org
Wed Aug 11 01:31:00 UTC 2021
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=4fd450a87df015fe85cadfac0e22c73e3c878d24
commit 4fd450a87df015fe85cadfac0e22c73e3c878d24
Author: Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-08-10 20:23:42 +0000
Commit: Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-08-11 01:22:07 +0000
amd64 pmap: Pre-set PG_M on 2MB KASAN shadow map entries
Also remove a redundant assertion in pmap_kasan_enter().
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31295
---
sys/amd64/amd64/pmap.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index bc203990faa1..bff4f5376fda 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -11321,7 +11321,7 @@ pmap_kasan_enter(vm_offset_t va)
m = pmap_kasan_enter_alloc_2m();
if (m != NULL) {
*pde = (pd_entry_t)(VM_PAGE_TO_PHYS(m) | X86_PG_RW |
- X86_PG_PS | X86_PG_V | pg_nx);
+ X86_PG_PS | X86_PG_V | X86_PG_A | X86_PG_M | pg_nx);
} else {
m = pmap_kasan_enter_alloc_4k();
*pde = (pd_entry_t)(VM_PAGE_TO_PHYS(m) | X86_PG_RW |
@@ -11333,8 +11333,6 @@ pmap_kasan_enter(vm_offset_t va)
pte = pmap_pde_to_pte(pde, va);
if ((*pte & X86_PG_V) != 0)
return;
- KASSERT((*pte & X86_PG_V) == 0,
- ("%s: shadow address %#lx is already mapped", __func__, va));
m = pmap_kasan_enter_alloc_4k();
*pte = (pt_entry_t)(VM_PAGE_TO_PHYS(m) | X86_PG_RW | X86_PG_V |
X86_PG_M | X86_PG_A | pg_nx);
More information about the dev-commits-src-all
mailing list