tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kprempt, pmap_load() and copy*



On Sun, Jun 19, 2011 at 06:19:27PM +0100, Mindaugas Rasiukevicius wrote:
> Manuel Bouyer <bouyer%antioche.eu.org@localhost> 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

Yes, this handle traps (this is what I says above). My question is
not about pagefault traps, but about one of the copy* routines being
interrupted by an interrupt which cause a context (and so pmap) switch.
AFAIK doreti will call pmap_load() only when returning to user mode
(it checks SEL_RPL)

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index