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
0fca57b8b8
commit
b3925aab09
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106607
@ -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