summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-03-24 13:04:16 +0000
committerpatrick <patrick@openbsd.org>2017-03-24 13:04:16 +0000
commit3efc265e49f3f8c020f2edab54ecd212fdf8353c (patch)
treeb331764d4b748fd21c62fb3b562e99fdcd1703a5
parentBackout mlarkin's previous commit while he is away: (diff)
downloadwireguard-openbsd-3efc265e49f3f8c020f2edab54ecd212fdf8353c.tar.xz
wireguard-openbsd-3efc265e49f3f8c020f2edab54ecd212fdf8353c.zip
Mainline u-boot on the ClearFog seems to insert an empty memory region
into the /memory node which we happily physload into UVM. This leads to a quickly panic(9)ing system when there is actual physical memory starting at zero due to how the physeg array is sorted when using the binary search strategy. To fix this, do not physload an empty memory region. ok jsg@ kettenis@
-rw-r--r--sys/arch/armv7/armv7/armv7_machdep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/arch/armv7/armv7/armv7_machdep.c b/sys/arch/armv7/armv7/armv7_machdep.c
index f186eefcdf1..0ee2189d67e 100644
--- a/sys/arch/armv7/armv7/armv7_machdep.c
+++ b/sys/arch/armv7/armv7/armv7_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_machdep.c,v 1.46 2017/03/10 08:38:12 kettenis Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.47 2017/03/24 13:04:16 patrick Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -758,6 +758,8 @@ initarm(void *arg0, void *arg1, void *arg2, paddr_t loadaddr)
for (i = 1; i < physsegs; i++) {
if (fdt_get_reg(node, i, &reg))
break;
+ if (reg.size == 0)
+ continue;
memstart = reg.addr;
memend = MIN(reg.addr + reg.size, (paddr_t)-PAGE_SIZE);