summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/head64.c
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@mailshack.com>2008-03-01 19:12:43 +0300
committerIngo Molnar <mingo@elte.hu>2008-04-17 19:40:52 +0400
commit320a6b2efceccb652befca0b1c9a92d6e4256ef6 (patch)
treeaa8e2e2009d9ac63b5f36952c085db9a25197221 /arch/x86/kernel/head64.c
parentf6eb62b6924b99ec7da97fb6f554685a9ad6dce4 (diff)
downloadlinux-320a6b2efceccb652befca0b1c9a92d6e4256ef6.tar.xz
x86: reserve end-of-conventional-memory to 1MB, 64-bit
This patch is an add-on to the 64-bit ebda patch. It makes the functions reserve_ebda_region (renamed from reserve_ebda) and copy_e820_map equal to the 32-bit versions of the previous patch. Changes: Use u64 and u32 for local variables in copy_e820_map. The amount of conventional memory and the start of the EBDA are detected by reading the BIOS data area directly. Paravirtual environments do not provide this area, so we bail out early in that case. They will just have to set up a correct memory map to start with. Add a safety net for zeroed out BIOS data area. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/head64.c')
-rw-r--r--arch/x86/kernel/head64.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index b684552347df..269a6b481fe6 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -55,12 +55,30 @@ static void __init copy_bootdata(char *real_mode_data)
/*
* The BIOS places the EBDA/XBDA at the top of conventional
* memory, and usually decreases the reported amount of
- * conventional memory (int 0x12) too.
+ * conventional memory (int 0x12) too. This also contains a
+ * workaround for Dell systems that neglect to reserve EBDA.
+ * The same workaround also avoids a problem with the AMD768MPX
+ * chipset: reserve a page before VGA to prevent PCI prefetch
+ * into it (errata #56). Usually the page is reserved anyways,
+ * unless you have no PS/2 mouse plugged in.
*/
-static __init void reserve_ebda(void)
+static void __init reserve_ebda_region(void)
{
unsigned int lowmem, ebda_addr;
+ /* To determine the position of the EBDA and the */
+ /* end of conventional memory, we need to look at */
+ /* the BIOS data area. In a paravirtual environment */
+ /* that area is absent. We'll just have to assume */
+ /* that the paravirt case can handle memory setup */
+ /* correctly, without our help. */
+#ifdef CONFIG_PARAVIRT
+ if ((boot_params.hdr.version >= 0x207) &&
+ (boot_params.hdr.hardware_subarch != 0)) {
+ return;
+ }
+#endif
+
/* end of low (conventional) memory */
lowmem = *(unsigned short *)__va(BIOS_LOWMEM_KILOBYTES);
lowmem <<= 10;
@@ -80,8 +98,8 @@ static __init void reserve_ebda(void)
lowmem = 0x9f000;
/* Paranoia: should never happen, but... */
- if (lowmem >= 0x100000)
- lowmem = 0xa0000;
+ if ((lowmem == 0) || (lowmem >= 0x100000))
+ lowmem = 0x9f000;
/* reserve all memory between lowmem and the 1MB mark */
reserve_early(lowmem, 0x100000, "BIOS reserved");
@@ -140,7 +158,7 @@ void __init x86_64_start_kernel(char * real_mode_data)
reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
}
- reserve_ebda();
+ reserve_ebda_region();
/*
* At this point everything still needed from the boot loader