1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

- Grab the vm lock around all of pmap_emulate_reference() as it manipulates

vm_page_t's.
- Add a KTR_TRAP tracepoint to trap() on the alpha that displays the
  contents of a0, a1, and a2 to make debugging of nested traps that
  panic before displaying any useful output easier.
This commit is contained in:
John Baldwin 2001-06-25 23:52:25 +00:00
parent b7e554f5d6
commit eaa942ebbd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=78786
2 changed files with 14 additions and 8 deletions

View File

@ -2887,10 +2887,8 @@ pmap_emulate_reference(struct proc *p, vm_offset_t v, int user, int write)
m->md.pv_flags |= PV_TABLE_REF;
faultoff = PG_FOR | PG_FOE;
if (user_addr && mtx_trylock(&vm_mtx)) {
if (user_addr)
vm_page_flag_set(m, PG_REFERENCED);
mtx_unlock(&vm_mtx);
}
if (write) {
m->md.pv_flags |= PV_TABLE_MOD;

View File

@ -334,6 +334,8 @@ trap(a0, a1, a2, entry, framep)
cnt.v_trap++;
ucode = 0;
user = (framep->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) != 0;
CTR5(KTR_TRAP, "%s trap: pid %d, (%lx, %lx, %lx)",
user ? "user" : "kernel", p->p_pid, a0, a1, a2);
if (user) {
mtx_lock_spin(&sched_lock);
sticks = p->p_sticks;
@ -481,13 +483,19 @@ trap(a0, a1, a2, entry, framep)
switch (a1) {
case ALPHA_MMCSR_FOR:
case ALPHA_MMCSR_FOE:
pmap_emulate_reference(p, a0, user, 0);
goto out;
case ALPHA_MMCSR_FOW:
pmap_emulate_reference(p, a0, user, 1);
goto out;
{
int hadvmlock;
hadvmlock = mtx_owned(&vm_mtx);
if (hadvmlock == 0)
mtx_lock(&vm_mtx);
pmap_emulate_reference(p, a0, user,
a1 == ALPHA_MMCSR_FOW);
if (hadvmlock == 0)
mtx_unlock(&vm_mtx);
goto out;
}
case ALPHA_MMCSR_INVALTRANS:
case ALPHA_MMCSR_ACCESS:
{