ia64/xen-unstable

changeset 15210:1fde9ebb8019

linux/x86-64: force _PAGE_NX on the 1:1 mapping (matching native)
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Thu May 24 15:12:31 2007 +0100 (2007-05-24)
parents 965bf43c9f11
children 6a4af9502b4d
files linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Thu May 24 14:07:40 2007 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Thu May 24 15:12:31 2007 +0100
     1.3 @@ -479,18 +479,15 @@ phys_pmd_init(pmd_t *pmd, unsigned long 
     1.4  		pte = alloc_static_page(&pte_phys);
     1.5  		pte_save = pte;
     1.6  		for (k = 0; k < PTRS_PER_PTE; pte++, k++, address += PTE_SIZE) {
     1.7 +			unsigned long pteval = address | _PAGE_NX | _KERNPG_TABLE;
     1.8 +
     1.9  			if ((address >= end) ||
    1.10  			    ((address >> PAGE_SHIFT) >=
    1.11 -			     xen_start_info->nr_pages)) { 
    1.12 -				__set_pte(pte, __pte(0)); 
    1.13 -				continue;
    1.14 -			}
    1.15 -			if (make_readonly(address)) {
    1.16 -				__set_pte(pte, 
    1.17 -					  __pte(address | (_KERNPG_TABLE & ~_PAGE_RW)));
    1.18 -				continue;
    1.19 -			}
    1.20 -			__set_pte(pte, __pte(address | _KERNPG_TABLE));
    1.21 +			     xen_start_info->nr_pages))
    1.22 +				pteval = 0;
    1.23 +			else if (make_readonly(address))
    1.24 +				pteval &= ~_PAGE_RW;
    1.25 +			__set_pte(pte, __pte(pteval & __supported_pte_mask));
    1.26  		}
    1.27  		pte = pte_save;
    1.28  		early_make_page_readonly(pte, XENFEAT_writable_page_tables);