aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/pmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index bfeee119f2ee..d04d2457a1da 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -10788,9 +10788,11 @@ pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
sva >= VM_MAXUSER_ADDRESS)
return (true);
MPASS(eva <= VM_MAXUSER_ADDRESS);
- for (va = sva, prev_ppr = NULL; va < eva;) {
+ for (va = sva; va < eva; prev_ppr = ppr) {
ppr = rangeset_lookup(&pmap->pm_pkru, va);
- if ((ppr == NULL) ^ (prev_ppr == NULL))
+ if (va == sva)
+ prev_ppr = ppr;
+ else if ((ppr == NULL) ^ (prev_ppr == NULL))
return (false);
if (ppr == NULL) {
va += PAGE_SIZE;