Re: Query about set_pages_* API
From: Arjan van de Ven
Date: Sat Feb 09 2008 - 18:57:28 EST
On Sat, 09 Feb 2008 15:40:12 -0700
Larry Finger <Larry.Finger@xxxxxxxxxxxx> wrote:
> 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.
it depends on what the code is trying to achieve.
(this makes it not a trivial 1:1 scripted replacement ;-)
Which attribute is the code trying to change? Is it trying to make
a piece of code (non) cachable? or executable? You need to figure out what
the intent is..
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/