Skip to contentSkip to conversation

linux/x86-64: fix phys_pmd_init() (regression from c/s 547)

PATCH New Jan Beulich 1 participant 1 message May 28, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux/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.

arch/x86_64/mm/init-xen.c +3 -3
@@ -457,9 +457,9 @@ phys_pmd_init(pmd_t *pmd_page, unsigned 
 		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;