* x86 bootmem corruption
@ 2001-05-11 16:07 Andrea Arcangeli
2001-05-11 16:18 ` Alan Cox
0 siblings, 1 reply; 3+ messages in thread
From: Andrea Arcangeli @ 2001-05-11 16:07 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
Bootmem allocations are executed before all the reserved memory is been
reserved. This is the fix against 2.4.5pre1. This might explain weird
crashes and "reserved twice" error messages at boot on highmem systems.
I didn't yet had the confirm this patch hels but certainly it is a
necessary fix for correctness.
--- initmem/arch/i386/kernel/setup.c.~1~ Tue May 1 19:35:18 2001
+++ initmem/arch/i386/kernel/setup.c Fri May 11 01:59:19 2001
@@ -934,7 +934,6 @@
* trampoline before removing it. (see the GDT stuff)
*/
reserve_bootmem(PAGE_SIZE, PAGE_SIZE);
- smp_alloc_memory(); /* AP processor realmode stacks in low memory*/
#endif
#ifdef CONFIG_X86_IO_APIC
@@ -943,18 +942,6 @@
*/
find_smp_config();
#endif
- paging_init();
-#ifdef CONFIG_X86_IO_APIC
- /*
- * get boot-time SMP configuration:
- */
- if (smp_found_config)
- get_smp_config();
-#endif
-#ifdef CONFIG_X86_LOCAL_APIC
- init_apic_mappings();
-#endif
-
#ifdef CONFIG_BLK_DEV_INITRD
if (LOADER_TYPE && INITRD_START) {
if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
@@ -971,6 +958,26 @@
initrd_start = 0;
}
}
+#endif
+
+ /*
+ * NOTE: before this point _nobody_ is allowed to allocate
+ * any memory using the bootmem allocator.
+ */
+
+#ifdef CONFIG_SMP
+ smp_alloc_memory(); /* AP processor realmode stacks in low memory*/
+#endif
+ paging_init();
+#ifdef CONFIG_X86_IO_APIC
+ /*
+ * get boot-time SMP configuration:
+ */
+ if (smp_found_config)
+ get_smp_config();
+#endif
+#ifdef CONFIG_X86_LOCAL_APIC
+ init_apic_mappings();
#endif
/*
Andrea
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: x86 bootmem corruption
2001-05-11 16:07 x86 bootmem corruption Andrea Arcangeli
@ 2001-05-11 16:18 ` Alan Cox
2001-05-11 16:27 ` Andrea Arcangeli
0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2001-05-11 16:18 UTC (permalink / raw)
To: Andrea Arcangeli; +Cc: Linus Torvalds, linux-kernel
> reserved. This is the fix against 2.4.5pre1. This might explain weird
> crashes and "reserved twice" error messages at boot on highmem systems.
Reserved twice occurs for two known reasons
BIOS reporting the same region twice or overlaps (fixed in -ac sent to Linus)
find_smp_config blindly reserves pages that may already be marked as ROM and
thus reserved anyway
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: x86 bootmem corruption
2001-05-11 16:18 ` Alan Cox
@ 2001-05-11 16:27 ` Andrea Arcangeli
0 siblings, 0 replies; 3+ messages in thread
From: Andrea Arcangeli @ 2001-05-11 16:27 UTC (permalink / raw)
To: Alan Cox; +Cc: Linus Torvalds, linux-kernel
On Fri, May 11, 2001 at 05:18:35PM +0100, Alan Cox wrote:
> > reserved. This is the fix against 2.4.5pre1. This might explain weird
> > crashes and "reserved twice" error messages at boot on highmem systems.
>
> Reserved twice occurs for two known reasons
>
> BIOS reporting the same region twice or overlaps (fixed in -ac sent to Linus)
> find_smp_config blindly reserves pages that may already be marked as ROM and
> thus reserved anyway
when it happens because of a double reserve that's fine I know, it _can_
be harmless, I'm not trying to hide those messages. What I'm saying is
that it can _also_ indicate somebody allocated the page before we reserved
it and currently x86 allocates from the bootmem allocator before
reserving all its pages, that's a bug and I provided the fix.
Andrea
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-05-11 16:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-11 16:07 x86 bootmem corruption Andrea Arcangeli
2001-05-11 16:18 ` Alan Cox
2001-05-11 16:27 ` Andrea Arcangeli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox