summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-10-09 19:04:19 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-10-09 19:04:19 +0000
commit9594b8260b35e1cc7cfa14ce58e92388881e95f6 (patch)
tree5a8712c9f4c840f1b6191743484fe25e5d806b5c /sys/arch/amd64
parenta380e96290d8cc7f60fb2d23afd14098e1908852 (diff)
Skip memory areas smaller than 1 MB above the 16 MB boundary to deal with
buggy ACP BIOSes. Based on a diff from weingart@. ok deraadt@, oga@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/machdep.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index b87d7509213..418903872c9 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.83 2008/10/06 21:05:56 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.84 2008/10/09 19:04:18 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1305,6 +1305,17 @@ init_x86_64(paddr_t first_avail)
e1 = trunc_page(bmp->addr + bmp->size);
s2 = e2 = 0; s3 = e3 = 0; s4 = e4 = 0;
+ /*
+ * XXX Some buggy ACPI BIOSes use memory that they
+ * declare as free. Typically the affected memory
+ * areas are small blocks between areas reserved for
+ * ACPI and other BIOS goo. So skip areas smaller
+ * than 1 MB above the 16 MB boundary (to avoid
+ * affecting legacy stuff).
+ */
+ if (s1 > 16*1024*1024 && (e1 - s1) < 1*1024*1024)
+ continue;
+
/* Check and adjust our segment(s) */
/* Nuke page zero */
if (s1 < avail_start) {