diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2021-04-03 15:10:59 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2021-04-03 15:10:59 +0000 |
commit | f8e71ba7238c534909522200398a0819b7841f73 (patch) | |
tree | f3f3792622221244cf1dc9ab12c1b9b228ed25a4 /sys/arch/arm64 | |
parent | 79202f634450158b7c3241929f3860e2912007b8 (diff) |
Exclude the first page from I/O virtual address space, which is the NULL
pointer address. Not allowing this one to be allocated might help find
driver bugs, where the device is programmed with a NULL pointer. We have
plenty of address space anyway, so excluding this single page does not
hurt at all and can only have positive effects.
Idea from kettenis@
Diffstat (limited to 'sys/arch/arm64')
-rw-r--r-- | sys/arch/arm64/dev/smmu.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/arm64/dev/smmu.c b/sys/arch/arm64/dev/smmu.c index 344e0b92f3f..565e9df3a9f 100644 --- a/sys/arch/arm64/dev/smmu.c +++ b/sys/arch/arm64/dev/smmu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smmu.c,v 1.11 2021/03/22 20:34:45 patrick Exp $ */ +/* $OpenBSD: smmu.c,v 1.12 2021/04/03 15:10:58 patrick Exp $ */ /* * Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com> * Copyright (c) 2021 Patrick Wildt <patrick@blueri.se> @@ -750,8 +750,9 @@ smmu_domain_create(struct smmu_softc *sc, uint32_t sid) snprintf(dom->sd_exname, sizeof(dom->sd_exname), "%s:%x", sc->sc_dev.dv_xname, sid); - dom->sd_iovamap = extent_create(dom->sd_exname, 0, (1LL << iovabits)-1, - M_DEVBUF, NULL, 0, EX_WAITOK | EX_NOCOALESCE); + dom->sd_iovamap = extent_create(dom->sd_exname, PAGE_SIZE, + (1LL << iovabits) - 1, M_DEVBUF, NULL, 0, EX_WAITOK | + EX_NOCOALESCE); #if 0 /* FIXME PCIe address space */ |