From 47f275d2945a3d2110e392aa3f6eb3d7dad9772a Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 13 Feb 2008 11:16:46 -0800 Subject: [PATCH] --- yaml --- r: 86339 b: refs/heads/master c: 829157be590af1c2555fb74c3c4db3327e3201fc h: refs/heads/master i: 86337: edd5bfc2f2e5ddf6404bf7a500e260e35e984b5d 86335: 0008f7d85dd3a930f9522d9b9d6c964a2ac41f9c v: v3 --- [refs] | 2 +- trunk/arch/x86/boot/memory.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index e5e2ec7c28a0..cc1b3afc64d1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4cd20952d74323df06e438c0c3273b5be89d6bfd +refs/heads/master: 829157be590af1c2555fb74c3c4db3327e3201fc diff --git a/trunk/arch/x86/boot/memory.c b/trunk/arch/x86/boot/memory.c index 378353956b5d..e77d89f9e8aa 100644 --- a/trunk/arch/x86/boot/memory.c +++ b/trunk/arch/x86/boot/memory.c @@ -37,6 +37,12 @@ static int detect_memory_e820(void) "=m" (*desc) : "D" (desc), "d" (SMAP), "a" (0xe820)); + /* BIOSes which terminate the chain with CF = 1 as opposed + to %ebx = 0 don't always report the SMAP signature on + the final, failing, probe. */ + if (err) + break; + /* Some BIOSes stop returning SMAP in the middle of the search loop. We don't know exactly how the BIOS screwed up the map at that point, we might have a @@ -47,9 +53,6 @@ static int detect_memory_e820(void) break; } - if (err) - break; - count++; desc++; } while (next && count < E820MAX);