diff options
author | Tor Egge <tegge@FreeBSD.org> | 2000-08-16 21:24:44 +0000 |
---|---|---|
committer | Tor Egge <tegge@FreeBSD.org> | 2000-08-16 21:24:44 +0000 |
commit | d9b05734cc6ac483a0d4867db84e89bbdae0b15d (patch) | |
tree | 10f8b881eaae7136021045b9a87f458a1dab9ed0 /sys/i386 | |
parent | 58ea82758e00b2765e158d10f68f83ba03be3d97 (diff) | |
download | src-d9b05734cc6ac483a0d4867db84e89bbdae0b15d.tar.gz src-d9b05734cc6ac483a0d4867db84e89bbdae0b15d.zip |
Prepare for a cleanup of pmap module API pollution introduced by the
suggested fix in PR 12378.
Keep track of all existing pmaps independent of existing processes.
This allows for a process to temporarily connect to a different address
space without the risk of missing an update of the original address space if
the kernel grows.
pmap_pinit2() is no longer needed on the i386 platform but is left as a
stub until the alpha pmap code is updated.
PR: 12378
Notes
Notes:
svn path=/head/; revision=64728
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/pmap.c | 22 | ||||
-rw-r--r-- | sys/i386/include/pmap.h | 1 |
2 files changed, 14 insertions, 9 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 7b274469c127..edae2929fb87 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -146,6 +146,8 @@ static int protection_codes[8]; static struct pmap kernel_pmap_store; pmap_t kernel_pmap; +LIST_HEAD(pmaplist, pmap); +struct pmaplist allpmaps; vm_offset_t avail_start; /* PA of first available physical page */ vm_offset_t avail_end; /* PA of last available physical page */ @@ -312,6 +314,8 @@ pmap_bootstrap(firstaddr, loadaddr) kernel_pmap->pm_count = 1; kernel_pmap->pm_active = -1; /* don't allow deactivation */ TAILQ_INIT(&kernel_pmap->pm_pvlist); + LIST_INIT(&allpmaps); + LIST_INSERT_HEAD(&allpmaps, kernel_pmap, pm_list); nkpt = NKPT; /* @@ -1093,6 +1097,7 @@ pmap_pinit0(pmap) pmap->pm_ptphint = NULL; TAILQ_INIT(&pmap->pm_pvlist); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); + LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); } /* @@ -1136,6 +1141,10 @@ pmap_pinit(pmap) if ((ptdpg->flags & PG_ZERO) == 0) bzero(pmap->pm_pdir, PAGE_SIZE); + LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); + /* Wire in kernel global address entries. */ + /* XXX copies current process, does not fill in MPPTDI */ + bcopy(PTD + KPTDI, pmap->pm_pdir + KPTDI, nkpt * PTESIZE); #ifdef SMP pmap->pm_pdir[MPPTDI] = PTD[MPPTDI]; #endif @@ -1161,8 +1170,7 @@ void pmap_pinit2(pmap) struct pmap *pmap; { - /* XXX copies current process, does not fill in MPPTDI */ - bcopy(PTD + KPTDI, pmap->pm_pdir + KPTDI, nkpt * PTESIZE); + /* XXX: Remove this stub when no longer called */ } static int @@ -1359,6 +1367,7 @@ pmap_release(pmap) #endif ptdpg = NULL; + LIST_REMOVE(pmap, pm_list); retry: curgeneration = object->generation; for (p = TAILQ_FIRST(&object->memq); p != NULL; p = n) { @@ -1384,7 +1393,6 @@ retry: void pmap_growkernel(vm_offset_t addr) { - struct proc *p; struct pmap *pmap; int s; vm_offset_t ptppaddr; @@ -1422,13 +1430,9 @@ pmap_growkernel(vm_offset_t addr) newpdir = (pd_entry_t) (ptppaddr | PG_V | PG_RW | PG_A | PG_M); pdir_pde(PTD, kernel_vm_end) = newpdir; - LIST_FOREACH(p, &allproc, p_list) { - if (p->p_vmspace) { - pmap = vmspace_pmap(p->p_vmspace); - *pmap_pde(pmap, kernel_vm_end) = newpdir; - } + LIST_FOREACH(pmap, &allpmaps, pm_list) { + *pmap_pde(pmap, kernel_vm_end) = newpdir; } - *pmap_pde(kernel_pmap, kernel_vm_end) = newpdir; kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1); } splx(s); diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index 813f2ae02468..e81e9fbe3cd3 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -202,6 +202,7 @@ struct pmap { int pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statistics */ struct vm_page *pm_ptphint; /* pmap ptp hint */ + LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ }; #define pmap_resident_count(pmap) (pmap)->pm_stats.resident_count |