summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-04-16 14:32:44 +0000
committerpatrick <patrick@openbsd.org>2019-04-16 14:32:44 +0000
commitdac51afe7a0b9eeb603bb495ca27cb45858ae1fd (patch)
tree05bf1c0f700c765092862abb4640e07d3160704c
parentelfrdsetroot is now rdsetroot(8). (diff)
downloadwireguard-openbsd-dac51afe7a0b9eeb603bb495ca27cb45858ae1fd.tar.xz
wireguard-openbsd-dac51afe7a0b9eeb603bb495ca27cb45858ae1fd.zip
When entering kernel pages uncached we need to make sure to flush the
caches. If the physical page was previously used by userland it is likely that this page is still in the cache and writing to the newly mapped page could result in unexpected behaviour. ok kettenis@
-rw-r--r--sys/arch/arm64/arm64/pmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/arch/arm64/arm64/pmap.c b/sys/arch/arm64/arm64/pmap.c
index f0366c8d8c7..59b018eaddc 100644
--- a/sys/arch/arm64/arm64/pmap.c
+++ b/sys/arch/arm64/arm64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.60 2019/02/10 22:45:58 tedu Exp $ */
+/* $OpenBSD: pmap.c,v 1.61 2019/04/16 14:32:44 patrick Exp $ */
/*
* Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com>
*
@@ -650,6 +650,8 @@ _pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot, int flags, int cache)
pmap_pte_insert(pted);
ttlb_flush(pm, va & ~PAGE_MASK);
+ if (cache == PMAP_CACHE_CI || cache == PMAP_CACHE_DEV)
+ cpu_idcache_wbinv_range(va & ~PAGE_MASK, PAGE_SIZE);
}
void