summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2021-03-02 01:34:43 +0000
committerpatrick <patrick@openbsd.org>2021-03-02 01:34:43 +0000
commit5d8d9ab1e3bf3e4437b36cda436988100ccf7a44 (patch)
tree91578b644e9d3ff9f9da3c0a6f792d29af0ce63a
parentoff by one in bounds test (diff)
downloadwireguard-openbsd-5d8d9ab1e3bf3e4437b36cda436988100ccf7a44.tar.xz
wireguard-openbsd-5d8d9ab1e3bf3e4437b36cda436988100ccf7a44.zip
Do *not* delay while waiting for IOTLB invalidation to complete. A 1ms
delay is awful in a hot path, and the SMMU is actually quite quick on invalidation, so simply removing the delay is worth a thousand roses. Found with mental support from dlg@ (and btrace)
-rw-r--r--sys/arch/arm64/dev/smmu.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/arch/arm64/dev/smmu.c b/sys/arch/arm64/dev/smmu.c
index 5be66346c1c..0b206a63875 100644
--- a/sys/arch/arm64/dev/smmu.c
+++ b/sys/arch/arm64/dev/smmu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smmu.c,v 1.3 2021/03/01 21:38:20 patrick Exp $ */
+/* $OpenBSD: smmu.c,v 1.4 2021/03/02 01:34:43 patrick Exp $ */
/*
* Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com>
* Copyright (c) 2021 Patrick Wildt <patrick@blueri.se>
@@ -389,7 +389,6 @@ smmu_tlb_sync_global(struct smmu_softc *sc)
if ((smmu_gr0_read_4(sc, SMMU_STLBGSTATUS) &
SMMU_STLBGSTATUS_GSACTIVE) == 0)
return;
- delay(1000);
}
printf("%s: global TLB sync timeout\n",
@@ -407,7 +406,6 @@ smmu_tlb_sync_context(struct smmu_domain *dom)
if ((smmu_cb_read_4(sc, dom->sd_cb_idx, SMMU_CB_TLBSTATUS) &
SMMU_CB_TLBSTATUS_SACTIVE) == 0)
return;
- delay(1000);
}
printf("%s: context TLB sync timeout\n",