aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-09-18 12:30:39 +0000
committerMark Johnston <markj@FreeBSD.org>2020-09-18 12:30:39 +0000
commit04636a71c6f49442d0909f468577a925b6088e25 (patch)
treeb64f7f033a65a6151cda785b6609acbb7dc315ff
parent3d1098617b81300ef215f02e3d967147aed03bb0 (diff)
downloadsrc-04636a71c6f49442d0909f468577a925b6088e25.tar.gz
src-04636a71c6f49442d0909f468577a925b6088e25.zip
Ensure that a protection key is selected in pmap_enter_largepage().
Reviewed by: alc, kib Reported by: Coverity MFC with: r365518 Differential Revision: https://reviews.freebsd.org/D26464
Notes
Notes: svn path=/head/; revision=365878
-rw-r--r--sys/amd64/amd64/pmap.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 3f7876a91604..bfeee119f2ee 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -6537,14 +6537,14 @@ restart:
mp->ref_count++;
}
KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 &&
- (origpte & PG_FRAME) == (newpte & PG_FRAME)),
- ("va %#lx changing 1G phys page pdpe %#lx newpte %#lx",
- va, origpte, newpte));
- if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0)
+ (origpte & PG_FRAME) == (pten & PG_FRAME)),
+ ("va %#lx changing 1G phys page pdpe %#lx pten %#lx",
+ va, origpte, pten));
+ if ((pten & PG_W) != 0 && (origpte & PG_W) == 0)
pmap->pm_stats.wired_count += NBPDP / PAGE_SIZE;
- else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0)
+ else if ((pten & PG_W) == 0 && (origpte & PG_W) != 0)
pmap->pm_stats.wired_count -= NBPDP / PAGE_SIZE;
- *pdpe = newpte;
+ *pdpe = pten;
} else /* (psind == 1) */ { /* 2M */
if (!pmap_pkru_same(pmap, va, va + NBPDR))
return (KERN_PROTECTION_FAILURE);
@@ -6573,14 +6573,14 @@ restart:
mp->ref_count++;
}
KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 &&
- (origpte & PG_FRAME) == (newpte & PG_FRAME)),
- ("va %#lx changing 2M phys page pde %#lx newpte %#lx",
- va, origpte, newpte));
- if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0)
+ (origpte & PG_FRAME) == (pten & PG_FRAME)),
+ ("va %#lx changing 2M phys page pde %#lx pten %#lx",
+ va, origpte, pten));
+ if ((pten & PG_W) != 0 && (origpte & PG_W) == 0)
pmap->pm_stats.wired_count += NBPDR / PAGE_SIZE;
- else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0)
+ else if ((pten & PG_W) == 0 && (origpte & PG_W) != 0)
pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE;
- *pde = newpte;
+ *pde = pten;
}
if ((origpte & PG_V) == 0)
pmap_resident_count_inc(pmap, pagesizes[psind] / PAGE_SIZE);