Date: Fri, 15 May 2009 11:24:07 -0500 From: Alan Cox <alc@cs.rice.edu> To: John Baldwin <jhb@freebsd.org>, =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= <des@des.no> Cc: alc@freebsd.org, arch@freebsd.org, freebsd-arch@freebsd.org Subject: Re: PTE modified bit emulation trap Message-ID: <4A0D9727.6030703@cs.rice.edu> In-Reply-To: <200905150804.36977.jhb@freebsd.org> References: <86tz3o4lb9.fsf@ds4.des.no> <86prec4kwj.fsf@ds4.des.no> <4A0C49FF.1070707@cs.rice.edu> <200905150804.36977.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin wrote: > On Thursday 14 May 2009 12:42:39 pm Alan Cox wrote: > >> Dag-Erling Smørgrav wrote: >> >>> [from -alpha, -hackers] >>> >>> Dag-Erling Smørgrav <des@des.no> writes: >>> >>> >>>> Coverity complains about the lack of error checking in the following >>>> code in sys/kern/kern_sysctl.c, around line 1390: >>>> >>>> /* >>>> * Touch all the wired pages to avoid PTE modified >>>> * bit emulation traps on Alpha while holding locks >>>> * in the sysctl handler. >>>> */ >>>> for (i = (wiredlen + PAGE_SIZE - 1) / PAGE_SIZE, >>>> cp = req->oldptr; i > 0; i--, cp += PAGE_SIZE) { >>>> copyin(cp, &dummy, 1); >>>> copyout(&dummy, cp, 1); >>>> } >>>> >>>> Since Alpha is dead, can we remove this, or is it still needed for other >>>> platforms? >>>> >>>> >>> kmacy suggested you might be the right person to ask... the conclusion >>> so far is that it *might* be necessary on sparc64 and / or mips. >>> >>> >> I think that this code may no longer be needed, but I want to >> double-check. I faced a related problem implementing superpages >> support, so I introduced an additional "access type" parameter to >> pmap_enter(). This parameter was specifically intended to allow a >> pmap_enter() implementation to preset the PTE's modified bit. I think >> that the simulated page fault that occurs on vslock()-style wiring >> passes "write access" to pmap_enter(). If so, then it's just a matter >> of tweaking the MIPS or any other pmap_enter() to actually do something >> with the "access type" parameter. Currently, only the architectures >> that implement the pmap-level support for superpages, i.e., amd64 and >> i386, do anything with this parameter. >> > > Then it sounds like the code should definitely be removed and that if any > problems do crop up, they can be fixed in pmap_enter() instead. > > I've had a chance to verify what I said above, so you can remove the code. I don't think that sparc64 will require any changes, but MIPS needs a two-line change to pmap_enter(). I'll see that the change gets made. Alan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A0D9727.6030703>