diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-02-13 14:16:46 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-02-26 06:55:52 -0500 |
commit | 829157be590af1c2555fb74c3c4db3327e3201fc (patch) | |
tree | 75f4744449a9a06dd1186215cb2d6d5ab7235798 /arch/x86 | |
parent | 4cd20952d74323df06e438c0c3273b5be89d6bfd (diff) |
x86: handle BIOSes which terminate e820 with CF=1 and no SMAP
The proper way to terminate the e820 chain is with %ebx == 0 on the
last legitimate memory block. However, several BIOSes don't do that
and instead return error (CF = 1) when trying to read off the end of
the list. For this error return, %eax doesn't necessarily return the
SMAP signature -- correctly so, since %ah should contain an error code
in this case.
To deal with some particularly broken BIOSes, we clear the entire e820
chain if the SMAP signature is missing in the middle, indicating a
plain insane e820 implementation. However, we need to make the test
for CF = 1 before the SMAP check.
This fixes at least one HP laptop (nc6400) for which none of the
memory-probing methods (e820, e801, 88) functioned fully according to
spec.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/boot/memory.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c index 378353956b5d..e77d89f9e8aa 100644 --- a/arch/x86/boot/memory.c +++ b/arch/x86/boot/memory.c | |||
@@ -37,6 +37,12 @@ static int detect_memory_e820(void) | |||
37 | "=m" (*desc) | 37 | "=m" (*desc) |
38 | : "D" (desc), "d" (SMAP), "a" (0xe820)); | 38 | : "D" (desc), "d" (SMAP), "a" (0xe820)); |
39 | 39 | ||
40 | /* BIOSes which terminate the chain with CF = 1 as opposed | ||
41 | to %ebx = 0 don't always report the SMAP signature on | ||
42 | the final, failing, probe. */ | ||
43 | if (err) | ||
44 | break; | ||
45 | |||
40 | /* Some BIOSes stop returning SMAP in the middle of | 46 | /* Some BIOSes stop returning SMAP in the middle of |
41 | the search loop. We don't know exactly how the BIOS | 47 | the search loop. We don't know exactly how the BIOS |
42 | screwed up the map at that point, we might have a | 48 | screwed up the map at that point, we might have a |
@@ -47,9 +53,6 @@ static int detect_memory_e820(void) | |||
47 | break; | 53 | break; |
48 | } | 54 | } |
49 | 55 | ||
50 | if (err) | ||
51 | break; | ||
52 | |||
53 | count++; | 56 | count++; |
54 | desc++; | 57 | desc++; |
55 | } while (next && count < E820MAX); | 58 | } while (next && count < E820MAX); |