All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: linux-kernel@vger.kernel.org,
	Dirk Brandewie <dirk.brandewie@gmail.com>,
	sodaville@linutronix.de, Ingo Molnar <mingo@elte.hu>,
	Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH] x86/trampoline: fallback to fixed trampoline address if no e820 map is provided
Date: Tue, 14 Dec 2010 22:19:39 +0100	[thread overview]
Message-ID: <201012142219.40062.ffainelli@freebox.fr> (raw)

From: Florian Fainelli <ffainelli@freebox.fr>

Since 893f38d1 (x86: Use find_e820() instead of hard coded trampoline address),
the trampoline base address should be provided by the BIOS as an e820 area.
Some minimalistic BIOSes (like CEFDK on CE4100) may not provide any e820 area,
still we should fallback to a fixed trampoline base address for SMP to work
correctly.

Cc: Dirk Brandewie <dirk.brandewie@gmail.com>
Cc: sodaville@linutronix.de
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
---
diff --git a/arch/x86/include/asm/trampoline.h b/arch/x86/include/asm/trampoline.h
index f4500fb..908b395 100644
--- a/arch/x86/include/asm/trampoline.h
+++ b/arch/x86/include/asm/trampoline.h
@@ -16,6 +16,7 @@ extern unsigned long initial_code;
 extern unsigned long initial_gs;
 
 #define TRAMPOLINE_SIZE roundup(trampoline_end - trampoline_data, PAGE_SIZE)
+#define TRAMPOLINE_BASE 0x6000
 
 extern unsigned long setup_trampoline(void);
 extern void __init reserve_trampoline_memory(void);
diff --git a/arch/x86/kernel/trampoline.c b/arch/x86/kernel/trampoline.c
index f1488a3..d025aae 100644
--- a/arch/x86/kernel/trampoline.c
+++ b/arch/x86/kernel/trampoline.c
@@ -21,8 +21,11 @@ void __init reserve_trampoline_memory(void)
 
 	/* Has to be in very low memory so we can execute real-mode AP code. */
 	mem = find_e820_area(0, 1<<20, TRAMPOLINE_SIZE, PAGE_SIZE);
-	if (mem == -1L)
-		panic("Cannot allocate trampoline\n");
+	if (mem == -1L) {
+		printk(KERN_INFO "BIOS did not provide e820 area for trampoline"
+				" ,using static trampoline address\n");
+		mem = TRAMPOLINE_BASE;
+	}
 
 	trampoline_base = __va(mem);
 	reserve_early(mem, mem + TRAMPOLINE_SIZE, "TRAMPOLINE");
-- 
1.7.1


             reply	other threads:[~2010-12-14 21:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14 21:19 Florian Fainelli [this message]
2010-12-23  9:57 ` [PATCH] x86/trampoline: fallback to fixed trampoline address if no e820 map is provided Florian Fainelli
2010-12-23 13:16   ` Yinghai
2010-12-23 13:20     ` Florian Fainelli
2010-12-23 17:46       ` Yinghai
2010-12-23 18:51     ` [sodaville] " H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201012142219.40062.ffainelli@freebox.fr \
    --to=florian@openwrt.org \
    --cc=dirk.brandewie@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sodaville@linutronix.de \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.