aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-05-24 15:12:31 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-05-24 15:12:31 +0100
commit7eb2ea035179e0243ebf7836365154674c2ceb97 (patch)
tree1a6f8e734a0a4108bead4b0c027deb2c16309a0c
parentecc82ca3e65191dca1bd7eacf4698cd81801f24e (diff)
downloadxen-7eb2ea035179e0243ebf7836365154674c2ceb97.tar.gz
xen-7eb2ea035179e0243ebf7836365154674c2ceb97.tar.bz2
xen-7eb2ea035179e0243ebf7836365154674c2ceb97.zip
linux/x86-64: force _PAGE_NX on the 1:1 mapping (matching native)
Signed-off-by: Jan Beulich <jbeulich@novell.com>
-rw-r--r--linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
index 55fcd37af5..acef5ea378 100644
--- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
+++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
@@ -479,18 +479,15 @@ phys_pmd_init(pmd_t *pmd, unsigned long address, unsigned long end)
pte = alloc_static_page(&pte_phys);
pte_save = pte;
for (k = 0; k < PTRS_PER_PTE; pte++, k++, address += PTE_SIZE) {
+ unsigned long pteval = address | _PAGE_NX | _KERNPG_TABLE;
+
if ((address >= end) ||
((address >> PAGE_SHIFT) >=
- xen_start_info->nr_pages)) {
- __set_pte(pte, __pte(0));
- continue;
- }
- if (make_readonly(address)) {
- __set_pte(pte,
- __pte(address | (_KERNPG_TABLE & ~_PAGE_RW)));
- continue;
- }
- __set_pte(pte, __pte(address | _KERNPG_TABLE));
+ xen_start_info->nr_pages))
+ pteval = 0;
+ else if (make_readonly(address))
+ pteval &= ~_PAGE_RW;
+ __set_pte(pte, __pte(pteval & __supported_pte_mask));
}
pte = pte_save;
early_make_page_readonly(pte, XENFEAT_writable_page_tables);