diff options
author | gallatin <gallatin@FreeBSD.org> | 2001-05-21 16:09:29 +0000 |
---|---|---|
committer | gallatin <gallatin@FreeBSD.org> | 2001-05-21 16:09:29 +0000 |
commit | 8a5413bcc8a83a93ac0cc948ea211396622b1b0c (patch) | |
tree | ede0917f2e462971a5f6263610286ad9ac20e8bc /sys | |
parent | 1c57c3b027ac5130744e1c6856910c6af48734c7 (diff) | |
download | FreeBSD-src-8a5413bcc8a83a93ac0cc948ea211396622b1b0c.zip FreeBSD-src-8a5413bcc8a83a93ac0cc948ea211396622b1b0c.tar.gz |
Change pmap_emulate_reference() so that it only touches the vm_page
flags if it is safe to do so, otherwise it will just alter the pmap state
(eg, clear the appropriate PG_FOx bits).
This gets alpha booting in the face of the vm_mtx introduction.
Reviewed by: dfr
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/alpha/pmap.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 4d62f4b..ea7090e 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -2830,6 +2830,7 @@ pmap_emulate_reference(struct proc *p, vm_offset_t v, int user, int write) pt_entry_t faultoff, *pte; vm_offset_t pa; vm_page_t m; + int user_addr; /* * Convert process and virtual address to physical address. @@ -2838,10 +2839,12 @@ pmap_emulate_reference(struct proc *p, vm_offset_t v, int user, int write) if (user) panic("pmap_emulate_reference: user ref to kernel"); pte = vtopte(v); + user_addr = 0; } else { KASSERT(p != NULL, ("pmap_emulate_reference: bad proc")); KASSERT(p->p_vmspace != NULL, ("pmap_emulate_reference: bad p_vmspace")); pte = pmap_lev3pte(p->p_vmspace->vm_map.pmap, v); + user_addr = 1; } #ifdef DEBUG /* These checks are more expensive */ if (!pmap_pte_v(pte)) @@ -2883,7 +2886,12 @@ pmap_emulate_reference(struct proc *p, vm_offset_t v, int user, int write) m = PHYS_TO_VM_PAGE(pa); m->md.pv_flags |= PV_TABLE_REF; faultoff = PG_FOR | PG_FOE; - vm_page_flag_set(m, PG_REFERENCED); + + if (user_addr && mtx_trylock(&vm_mtx)) { + vm_page_flag_set(m, PG_REFERENCED); + mtx_unlock(&vm_mtx); + } + if (write) { m->md.pv_flags |= PV_TABLE_MOD; vm_page_dirty(m); |