Date: Fri, 15 May 2009 08:04:36 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-arch@freebsd.org Cc: alc@freebsd.org, Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= <des@des.no>, Alan Cox <alc@cs.rice.edu>, arch@freebsd.org Subject: Re: PTE modified bit emulation trap Message-ID: <200905150804.36977.jhb@freebsd.org> In-Reply-To: <4A0C49FF.1070707@cs.rice.edu> References: <86tz3o4lb9.fsf@ds4.des.no> <86prec4kwj.fsf@ds4.des.no> <4A0C49FF.1070707@cs.rice.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 14 May 2009 12:42:39 pm Alan Cox wrote: > Dag-Erling Sm=C3=B8rgrav wrote: > > [from -alpha, -hackers] > > > > Dag-Erling Sm=C3=B8rgrav <des@des.no> writes: > > =20 > >> 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 =3D (wiredlen + PAGE_SIZE - 1) / PAGE_SIZE, > >> cp =3D req->oldptr; i > 0; i--, cp +=3D PAGE_SIZE) { > >> copyin(cp, &dummy, 1); > >> copyout(&dummy, cp, 1); > >> } > >> > >> Since Alpha is dead, can we remove this, or is it still needed for oth= er > >> platforms? > >> =20 > > > > 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. > > =20 >=20 > I think that this code may no longer be needed, but I want to=20 > double-check. I faced a related problem implementing superpages=20 > support, so I introduced an additional "access type" parameter to=20 > pmap_enter(). This parameter was specifically intended to allow a=20 > pmap_enter() implementation to preset the PTE's modified bit. I think=20 > that the simulated page fault that occurs on vslock()-style wiring=20 > passes "write access" to pmap_enter(). If so, then it's just a matter=20 > of tweaking the MIPS or any other pmap_enter() to actually do something=20 > with the "access type" parameter. Currently, only the architectures=20 > that implement the pmap-level support for superpages, i.e., amd64 and=20 > i386, do anything with this parameter. Then it sounds like the code should definitely be removed and that if any=20 problems do crop up, they can be fixed in pmap_enter() instead. =2D-=20 John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905150804.36977.jhb>