PATCH: Fix for 4KB kernel corruption
Hi,
4KB page size kernel is broken on Lion with 8GB memory. ia64_boot_param structure was getting corrupted. Appended patch fixes this problem.
PAGE_ALIGN is required because: rsvd_region[i].end need not be page aligned and in the next iteration of the for loop this can potentially become bootmap_start. This can lead to corruption of rsvd_region[i] as init_bootmem() takes the pfn of bootmap_start and initialises the bootmem.
Thanks,
Suresh
diff -u linux-2.4.14/arch/ia64/kernel/setup.c~linux-2.4.14/arch/ia64/kernel/setup.c
arch/ia64/kernel/setup.c Thu Nov 15 16:28:01 2001 renamed from arch/ia64/kernel/setup.c~ Thu Nov 15 16:27:23 2001 +1 -1
@@ -175,7 +175,7 @@ /* nothing more available in this segment */ if (range_end = end) return 0; - free_start = rsvd_region[i].end; + free_start = PAGE_ALIGN(rsvd_region[i].end); } return 0; }
Hi,
4KB page size kernel is broken on Lion with 8GB memory. ia64_boot_param structure was getting corrupted. Appended patch fixes this problem.
PAGE_ALIGN is required because: rsvd_region[i].end need not be page aligned and in the next iteration of the for loop this can potentially become bootmap_start. This can lead to corruption of rsvd_region[i] as init_bootmem() takes the pfn of bootmap_start and initialises the bootmem.
Thanks,
Suresh
diff -u linux-2.4.14/arch/ia64/kernel/setup.c~linux-2.4.14/arch/ia64/kernel/setup.c
arch/ia64/kernel/setup.c Thu Nov 15 16:28:01 2001 renamed from arch/ia64/kernel/setup.c~ Thu Nov 15 16:27:23 2001 +1 -1
@@ -175,7 +175,7 @@ /* nothing more available in this segment */ if (range_end = end) return 0; - free_start = rsvd_region[i].end; + free_start = PAGE_ALIGN(rsvd_region[i].end); } return 0; }
Hi Siddha,
Can this corruption happen with on lion with 4Go of memory also ?
Thanks,
Philippe.
Quoted 32 lines · Suresh B
Hi,
4KB page size kernel is broken on Lion with 8GB memory.
ia64_boot_paramstructure was getting corrupted. Appended patch fixes this problem.
PAGE_ALIGNis required because: rsvd_region[i].end need not be page aligned and in the next iteration of the for loop this can potentially becomebootmap_start. This can lead to corruption of rsvd_region[i] asinit_bootmem()takes the pfn ofbootmap_startand initialises the bootmem.Thanks,
Sureshdiff -u linux-2.4.14/arch/ia64/kernel/setup.c~
linux-2.4.14/arch/ia64/kernel/setup.carch/ia64/kernel/setup.c Thu Nov 15 16:28:01 2001 renamed from arch/ia64/kernel/setup.c~ Thu Nov 15 16:27:23 2001 +1
-1@@ -175,7 +175,7 @@ /* nothing more available in this segment */ if (range_end = end) return 0; - free_start = rsvd_region[i].end; + free_start = PAGE_ALIGN(rsvd_region[i].end); } return 0; }_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64
Hi Philippe,
You may or mayn't see this problem. It depends up on the EFI memory map. In our case, it is so happening that bootmap is allocated from the end of one of the reserved regions and corrupting that reserved region.
Thanks,
Suresh
Quoted 57 lines
-----Original Message-----
From: Philippe Gramoullé [mailto:[email protected]]
Sent: Friday, November 16, 2001 2:24 AM
To: Siddha, Suresh B
Cc: [email protected]
Subject: Re: [Linux-ia64] PATCH: Fix for 4KB kernel corruptionHi Siddha,
Can this corruption happen with on lion with 4Go of memory also ?
Thanks,
Philippe.
Quoted 4 lines · Suresh B
Hi,
4KB page size kernel is broken on Lion with 8GB memory.
ia64_boot_paramQuoted 3 lines
structure was getting corrupted. Appended patch fixes this problem.
PAGE_ALIGNis required because: rsvd_region[i].end need notbe page aligned
Quoted 1 line
and in the next iteration of the for loop this can
potentially become
Quoted 2 lines
bootmap_start. This can lead to corruption of rsvd_region[i] asinit_bootmem()takes the pfn ofbootmap_startandinitialises the bootmem.
Quoted 7 lines
Thanks,
Sureshdiff -u linux-2.4.14/arch/ia64/kernel/setup.c~
linux-2.4.14/arch/ia64/kernel/setup.c
--- linux-2.4.14/arch/ia64/kernel/setup.c~ Thu Nov 1516:27:23 2001
Quoted 1 line
+++
linux-2.4.14/arch/ia64/kernel/setup.cThu Nov 1516:28:01 2001
Quoted 14 lines
arch/ia64/kernel/setup.c Thu Nov 15 16:28:01 2001 renamed from arch/ia64/kernel/setup.c~ Thu Nov 15 16:27:23 2001 +1
-1@@ -175,7 +175,7 @@ /* nothing more available in this segment */ if (range_end == end) return 0; - free_start = rsvd_region[i].end; + free_start = PAGE_ALIGN(rsvd_region[i].end); } return 0; }_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Suresh B
Suresh> Hi, 4KB page size kernel is broken on Lion with 8GB Suresh> memory. ia64_boot_param structure was getting Suresh> corrupted. Appended patch fixes this problem.
Thanks I applied the patch and also make sure the end address is page aligned. It's not strictly needed, but it's cleaner that way (since the bootmap size is measured as a page count).
--david