amd64 pmap_pkru_same: prev_ppr was always NULL

Fix the logic so it works as it appears.

Reported by:	Coverity
Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	D26211 (in progress, so omitting full URL)
This commit is contained in:
Eric van Gyzen 2020-09-18 20:53:40 +00:00
parent 7afab8a67e
commit d8d2dda141

View File

@ -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;