From: jmatthew Date: Mon, 30 Jul 2018 09:04:52 +0000 (+0000) Subject: When converting the bios memory map to memory clusters, clip segments at X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3083b0fdfe2880bac7e072adba703740d3494143;p=openbsd When converting the bios memory map to memory clusters, clip segments at the 512GB mark as the direct map cannot address memory past that point. ok kettenis@ (quite a while ago) --- diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 05c91e3def1..29f4448a220 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.249 2018/07/27 21:11:31 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.250 2018/07/30 09:04:52 jmatthew Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -1485,6 +1485,16 @@ init_x86_64(paddr_t first_avail) continue; } + /* + * The direct map is limited to 512GB of memory, so + * discard anything above that. + */ + if (e1 >= (uint64_t)512*1024*1024*1024) { + e1 = (uint64_t)512*1024*1024*1024; + if (s1 > e1) + continue; + } + /* Crop stuff into "640K hole" */ if (s1 < IOM_BEGIN && e1 > IOM_BEGIN) e1 = IOM_BEGIN;