summaryrefslogtreecommitdiffstats
path: root/sys/arch/arm64/dev/smmu.c
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2021-04-03 15:10:58 +0000
committerpatrick <patrick@openbsd.org>2021-04-03 15:10:58 +0000
commitab86b9020dc7a7e0f5e6f0a183513a03d13d2e53 (patch)
treeb938b3d8eb0816576de5be191079980f482b8129 /sys/arch/arm64/dev/smmu.c
parentRun the CMAC tests through EVP_PKEY_new_CMAC_key(). (diff)
downloadwireguard-openbsd-ab86b9020dc7a7e0f5e6f0a183513a03d13d2e53.tar.xz
wireguard-openbsd-ab86b9020dc7a7e0f5e6f0a183513a03d13d2e53.zip
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 '')
-rw-r--r--sys/arch/arm64/dev/smmu.c7
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 */