[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <479A40F6.1050006@goop.org>
Date: Fri, 25 Jan 2008 12:05:10 -0800
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: Ingo Molnar <mingo@...e.hu>
CC: "Huang, Ying" <ying.huang@...el.com>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>, Andi Kleen <ak@...e.de>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] x86: fix NX bit handling in change_page_attr
Ingo Molnar wrote:
> * Ingo Molnar <mingo@...e.hu> wrote:
>
>
>> ...
>> + ref_prot = pte_pgprot(pte_mkexec(pte_clrhuge(*kpte)));
>>
>> i.e. it now goes through all the proper accessors.
>>
>
> i guess it would be nicer to have the proper accessors to just clear the
> NX bit from ref-prot - instead of re-constructing the *kpte from
> scratch. But i see no other way to do it right now than to access
> pgprot_val() as an lvalue. Jeremy, what would be the best approach here?
The pte_* accessors are really just helpers, so they're not mandatory.
Something like this would be fine:
refprot = __pgprot(pgprot_val(refprot) & ~_PAGE_NX);
This is identical to the lvalue form, but avoids using it as an lvalue.
J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists