aboutsummaryrefslogtreecommitdiff
path: root/i386/intel
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-12 15:56:07 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-12 15:58:06 +0200
commit5a9f9578e3075a39e7b14db6e5b8e8c4e01f245f (patch)
tree9082901770befb730df9bee44dd75fb4c93e89c9 /i386/intel
parentb30320dd03ddba56152cfe615eadeb0a8e40864e (diff)
downloadgnumach-5a9f9578e3075a39e7b14db6e5b8e8c4e01f245f.tar.gz
gnumach-5a9f9578e3075a39e7b14db6e5b8e8c4e01f245f.tar.bz2
gnumach-5a9f9578e3075a39e7b14db6e5b8e8c4e01f245f.zip
pmap: Make pmap_protect sparse-pde aware
222020cff440 ("pmap: dynamically allocate the whole user page tree map") made the pde array sparse, but missed updating pmap_protect accordingly: we have to re-lookup for the pde on each PDE_MAPPED_SIZE section.
Diffstat (limited to 'i386/intel')
-rw-r--r--i386/intel/pmap.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
index 42c6207f..8aa27867 100644
--- a/i386/intel/pmap.c
+++ b/i386/intel/pmap.c
@@ -1899,7 +1899,6 @@ void pmap_protect(
vm_offset_t e,
vm_prot_t prot)
{
- pt_entry_t *pde;
pt_entry_t *spte, *epte;
vm_offset_t l;
int spl;
@@ -1938,12 +1937,13 @@ void pmap_protect(
SPLVM(spl);
simple_lock(&map->lock);
- pde = pmap_pde(map, s);
while (s < e) {
+ pt_entry_t *pde = pde = pmap_pde(map, s);
+
l = (s + PDE_MAPPED_SIZE) & ~(PDE_MAPPED_SIZE-1);
if (l > e)
l = e;
- if (*pde & INTEL_PTE_VALID) {
+ if (pde && (*pde & INTEL_PTE_VALID)) {
spte = (pt_entry_t *)ptetokv(*pde);
spte = &spte[ptenum(s)];
epte = &spte[intel_btop(l-s)];
@@ -1980,7 +1980,6 @@ void pmap_protect(
#endif /* MACH_PV_PAGETABLES */
}
s = l;
- pde++;
}
PMAP_UPDATE_TLBS(map, _s, e);