[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1201858487.4051.17.camel@caritas-dev.intel.com>
Date: Fri, 01 Feb 2008 17:34:47 +0800
From: "Huang, Ying" <ying.huang@...el.com>
To: Ingo Molnar <mingo@...hat.com>, "H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>, Andi Kleen <ak@...e.de>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 1/4] x86: check __supported_pte_mask in set_memory_x/nx
This patch adds __supported_pte_mask checking to set_memory_x/nx.
Signed-off-by: Huang Ying <ying.huang@...el.com>
---
arch/x86/mm/pageattr.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -445,13 +445,21 @@ EXPORT_SYMBOL(set_memory_wb);
int set_memory_x(unsigned long addr, int numpages)
{
- return change_page_attr_clear(addr, numpages, __pgprot(_PAGE_NX));
+ if (__supported_pte_mask & _PAGE_NX)
+ return change_page_attr_clear(addr, numpages,
+ __pgprot(_PAGE_NX));
+ else
+ return 0;
}
EXPORT_SYMBOL(set_memory_x);
int set_memory_nx(unsigned long addr, int numpages)
{
- return change_page_attr_set(addr, numpages, __pgprot(_PAGE_NX));
+ if (__supported_pte_mask & _PAGE_NX)
+ return change_page_attr_set(addr, numpages,
+ __pgprot(_PAGE_NX));
+ else
+ return 0;
}
EXPORT_SYMBOL(set_memory_nx);
--
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