Manuel Bouyer <bou...@antioche.eu.org> wrote: > > Hmmm.... lets see... thinks ... > > copyin/out can fault or be interrupted, both can cause a process switch. > > So there ought to be code somewhere (probably in the return from > > trap/intr code) that will restore the pmap to allow the copy to > > continue. This would rather indicate that the end of copyin/out ought > > to be clearing a 'need process's pmap' flag. > > Not looked ... > > This is precisely this logic that I didn't find for the interrupt case. > There is the onfault_table[] which contains critical sections and is used > in trap() to know if the fault comes from one of the copy routines. > It's not used outside of trap(), and wouldn't cover the case of > interrupt in the copy routine but outside of the *_start/*_end labels.
http://nxr.netbsd.org/xref/src/sys/arch/amd64/amd64/trap.c?r=1.66#551 -- Mindaugas