summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-07-09 20:05:56 +0000
committerkib <kib@FreeBSD.org>2010-07-09 20:05:56 +0000
commit5e9badadafc232a66f795183716dc2ec221a1038 (patch)
treeb4ff0d315f57ea5cc351fd958106a75e3a3d98dc /sys/amd64
parent7c09dc242c035943fb8ed54909fd0a8461cb99ba (diff)
downloadFreeBSD-src-5e9badadafc232a66f795183716dc2ec221a1038.zip
FreeBSD-src-5e9badadafc232a66f795183716dc2ec221a1038.tar.gz
For both i386 and amd64 pmap,
- change the type of pm_active to cpumask_t, which it is; - in pmap_remove_pages(), compare with PCPU(curpmap), instead of dereferencing the long chain of pointers [1]. For amd64 pmap, remove the unneeded checks for validity of curpmap in pmap_activate(), since curpmap should be always valid after r209789. Submitted by: alc [1] Reviewed by: alc MFC after: 3 weeks
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/pmap.c4
-rw-r--r--sys/amd64/include/pmap.h2
2 files changed, 2 insertions, 4 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 8836157..3b03d08 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -4018,7 +4018,7 @@ pmap_remove_pages(pmap_t pmap)
uint64_t inuse, bitmask;
int allfree;
- if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) {
+ if (pmap != PCPU_GET(curpmap)) {
printf("warning: pmap_remove_pages called with non-current pmap\n");
return;
}
@@ -4998,11 +4998,9 @@ pmap_activate(struct thread *td)
pmap = vmspace_pmap(td->td_proc->p_vmspace);
oldpmap = PCPU_GET(curpmap);
#ifdef SMP
-if (oldpmap) /* XXX FIXME */
atomic_clear_int(&oldpmap->pm_active, PCPU_GET(cpumask));
atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask));
#else
-if (oldpmap) /* XXX FIXME */
oldpmap->pm_active &= ~PCPU_GET(cpumask);
pmap->pm_active |= PCPU_GET(cpumask);
#endif
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 6f0b188..53a4d63 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -244,7 +244,7 @@ struct pmap {
struct mtx pm_mtx;
pml4_entry_t *pm_pml4; /* KVA of level 4 page table */
TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */
- u_int pm_active; /* active on cpus */
+ cpumask_t pm_active; /* active on cpus */
uint32_t pm_gen_count; /* generation count (pmap lock dropped) */
u_int pm_retries;
/* spare u_int here due to padding */
OpenPOWER on IntegriCloud