diff options
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 12 |
1 files changed, 11 insertions, 1 deletions
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; |