From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757535AbYBJAA7 (ORCPT ); Sat, 9 Feb 2008 19:00:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756003AbYBJAAw (ORCPT ); Sat, 9 Feb 2008 19:00:52 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:34139 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755999AbYBJAAv (ORCPT ); Sat, 9 Feb 2008 19:00:51 -0500 Date: Sat, 9 Feb 2008 16:00:40 -0800 From: Arjan van de Ven To: Larry Finger Cc: LKML Subject: Re: Query about set_pages_* API Message-ID: <20080209160040.088b99a6@laptopd505.fenrus.org> In-Reply-To: <47AE2BCC.3040605@lwfinger.net> References: <47AE2BCC.3040605@lwfinger.net> Organization: Intel X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.3; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 09 Feb 2008 15:40:12 -0700 Larry Finger wrote: > Is the set_pages_* API that replaces change_page_attr described > somewhere? I have been unable to find it with Google. > > I'm trying to modify the VirtualBox kernel module to work with > 2.6.24-git (and 2.6.25) on x86_64 architecture. The current code has > a value of the third argument of the call (prot) with 3 variants. All > variations have the following bits set: _PAGE_PRESENT, _PAGE_RW, > _PAGE_DIRTY, and _PAGE_ACCESSED. Number 2 adds _PAGE_NX to the above, > and number 3 adds _PAGE_GLOBAL to the bits in variation 1. > > From the code in arch/x86/mm/pageattr.c, I figured I need to call > set_pages_wb() unconditionally, and set_pages_nx() if _PAGE_NX is > set. Will these calls be sufficient? I thought about calling > set_pages_rw(), but that entry is not exported. > ok looking at the actual code.. it seems to only care about making a piece of memory executable (and then clearing it before freeing), so all you need is set_memory_x() and set_memory_nx() -- If you want to reach me at my work email, use arjan@linux.intel.com For development, discussion and tips for power savings, visit http://www.lesswatts.org