From 1e7976875e539c508f69a0fb4c3fa077a5384bf5 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 29 May 2009 09:17:16 +0100 Subject: [PATCH] xen/x86-64: fix phys_pmd_init() (regression from c/s 547) I didn't pay attention to the fact that 'end' must always be an upper bound, while xen_start_info->nr_pages must be additionally during boot. Signed-off-by: Jan Beulich --- arch/x86_64/mm/init-xen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86_64/mm/init-xen.c b/arch/x86_64/mm/init-xen.c index 00ffa5ee..a977e43d 100644 --- a/arch/x86_64/mm/init-xen.c +++ b/arch/x86_64/mm/init-xen.c @@ -457,9 +457,9 @@ phys_pmd_init(pmd_t *pmd, unsigned long address, unsigned long end) for (k = 0; k < PTRS_PER_PTE; pte++, k++, address += PTE_SIZE) { unsigned long pteval = address | _PAGE_NX | _KERNPG_TABLE; - if (address >= (after_bootmem - ? end - : xen_start_info->nr_pages << PAGE_SHIFT)) + if (address >= end || + (!after_bootmem && + (address >> PAGE_SHIFT) >= xen_start_info->nr_pages)) pteval = 0; else if (make_readonly(address)) pteval &= ~_PAGE_RW; -- 2.39.5