From owner-freebsd-arch@FreeBSD.ORG Thu May 14 16:42:48 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58EE6106564A; Thu, 14 May 2009 16:42:48 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id 3121E8FC0A; Thu, 14 May 2009 16:42:47 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 34B5A2C2C9B; Thu, 14 May 2009 11:42:47 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6iHK+oOTSeu3; Thu, 14 May 2009 11:42:39 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 678162C2C60; Thu, 14 May 2009 11:42:39 -0500 (CDT) Message-ID: <4A0C49FF.1070707@cs.rice.edu> Date: Thu, 14 May 2009 11:42:39 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.21 (X11/20090404) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <86tz3o4lb9.fsf@ds4.des.no> <86prec4kwj.fsf@ds4.des.no> In-Reply-To: <86prec4kwj.fsf@ds4.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: alc@freebsd.org, arch@freebsd.org Subject: Re: PTE modified bit emulation trap X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2009 16:42:48 -0000 Dag-Erling Smørgrav wrote: > [from -alpha, -hackers] > > Dag-Erling Smørgrav 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. Alan