use critical_enter/exit to add a critical section around BIOS call,
this unbreaks WITNESS. Pointed out by: jhb
This commit is contained in:
parent
f740e3df9b
commit
9ca980d0e7
@ -425,7 +425,7 @@ vm86_initialize(void)
|
||||
pcb = &vml->vml_pcb;
|
||||
ext = &vml->vml_ext;
|
||||
|
||||
mtx_init(&vm86_lock, "vm86 lock", NULL, MTX_SPIN);
|
||||
mtx_init(&vm86_lock, "vm86 lock", NULL, MTX_DEF);
|
||||
|
||||
bzero(pcb, sizeof(struct pcb));
|
||||
pcb->new_ptd = vm86pa | PG_V | PG_RW | PG_U;
|
||||
@ -578,9 +578,11 @@ vm86_intcall(int intnum, struct vm86frame *vmf)
|
||||
return (EINVAL);
|
||||
|
||||
vmf->vmf_trapno = intnum;
|
||||
mtx_lock_spin(&vm86_lock);
|
||||
mtx_lock(&vm86_lock);
|
||||
critical_enter();
|
||||
retval = vm86_bioscall(vmf);
|
||||
mtx_unlock_spin(&vm86_lock);
|
||||
critical_exit();
|
||||
mtx_unlock(&vm86_lock);
|
||||
return (retval);
|
||||
}
|
||||
|
||||
@ -600,7 +602,8 @@ vm86_datacall(intnum, vmf, vmc)
|
||||
u_int page;
|
||||
int i, entry, retval;
|
||||
|
||||
mtx_lock_spin(&vm86_lock);
|
||||
mtx_lock(&vm86_lock);
|
||||
critical_enter();
|
||||
for (i = 0; i < vmc->npages; i++) {
|
||||
page = vtophys(vmc->pmap[i].kva & PG_FRAME);
|
||||
entry = vmc->pmap[i].pte_num;
|
||||
@ -617,7 +620,8 @@ vm86_datacall(intnum, vmf, vmc)
|
||||
pte[entry] = vmc->pmap[i].old_pte;
|
||||
pmap_invalidate_page(kernel_pmap, vmc->pmap[i].kva);
|
||||
}
|
||||
mtx_unlock_spin(&vm86_lock);
|
||||
critical_exit();
|
||||
mtx_unlock(&vm86_lock);
|
||||
|
||||
return (retval);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user