summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2012-03-25 13:45:05 +0000
committermiod <miod@openbsd.org>2012-03-25 13:45:05 +0000
commit8be368617e6d99b34ca59285ee5ca01dd86a5eac (patch)
treeb8e4ed3b8cad4b9b83eefada9920c57464753a0c
parentDo not fatal() when failing to connect to a relay. (diff)
downloadwireguard-openbsd-8be368617e6d99b34ca59285ee5ca01dd86a5eac.tar.xz
wireguard-openbsd-8be368617e6d99b34ca59285ee5ca01dd86a5eac.zip
Only set the low order bits of CpuCacheAliasMask if it is nonzero, regression
of previous computation fix.
-rw-r--r--sys/arch/mips64/mips64/cache_loongson2.S6
-rw-r--r--sys/arch/mips64/mips64/cache_r10k.S6
-rw-r--r--sys/arch/mips64/mips64/cache_r5k.S6
3 files changed, 15 insertions, 3 deletions
diff --git a/sys/arch/mips64/mips64/cache_loongson2.S b/sys/arch/mips64/mips64/cache_loongson2.S
index 7772713d37f..4a67811c366 100644
--- a/sys/arch/mips64/mips64/cache_loongson2.S
+++ b/sys/arch/mips64/mips64/cache_loongson2.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cache_loongson2.S,v 1.5 2012/03/19 20:42:26 miod Exp $ */
+/* $OpenBSD: cache_loongson2.S,v 1.6 2012/03/25 13:45:05 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -152,7 +152,11 @@ ConfResult:
addu t1, ta0, -1 # Use icache for alias mask
srl t1, t2
+ and t1, ~(PAGE_SIZE - 1)
+ beqz t1, 1f
+ nop
or t1, (PAGE_SIZE - 1)
+1:
PTR_S t1, CpuCacheAliasMask
sw ta0, CI_L1INSTCACHESIZE(a0) # store cache size.
diff --git a/sys/arch/mips64/mips64/cache_r10k.S b/sys/arch/mips64/mips64/cache_r10k.S
index a9f2e03adf1..59007cca103 100644
--- a/sys/arch/mips64/mips64/cache_r10k.S
+++ b/sys/arch/mips64/mips64/cache_r10k.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cache_r10k.S,v 1.13 2012/03/19 20:42:26 miod Exp $ */
+/* $OpenBSD: cache_r10k.S,v 1.14 2012/03/25 13:45:05 miod Exp $ */
/*
* Copyright (c) 2004 Opsycon AB (www.opsycon.se)
@@ -158,7 +158,11 @@ ConfResult:
addu t1, ta0, -1 # Use icache for alias mask
srl t1, t2
+ and t1, ~(PAGE_SIZE - 1)
+ beqz t1, 1f
+ nop
or t1, (PAGE_SIZE - 1)
+1:
#ifdef MULTIPROCESSOR
PTR_L ta2, CpuCacheAliasMask
or t1, ta2 # Pick largest mask
diff --git a/sys/arch/mips64/mips64/cache_r5k.S b/sys/arch/mips64/mips64/cache_r5k.S
index 45b5cf49517..5a972b8970f 100644
--- a/sys/arch/mips64/mips64/cache_r5k.S
+++ b/sys/arch/mips64/mips64/cache_r5k.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cache_r5k.S,v 1.32 2012/03/19 20:42:26 miod Exp $ */
+/* $OpenBSD: cache_r5k.S,v 1.33 2012/03/25 13:45:05 miod Exp $ */
/*
* Copyright (c) 1998-2004 Opsycon AB (www.opsycon.se)
@@ -368,7 +368,11 @@ ConfResult:
addu t1, ta0, -1 # Use icache for alias mask
srl t1, t2
+ and t1, ~(PAGE_SIZE - 1)
+ beqz t1, 1f
+ nop
or t1, (PAGE_SIZE - 1)
+1:
PTR_S t1, CpuCacheAliasMask
sw ta0, CI_L1INSTCACHESIZE(a0) # store cache size.