summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2012-05-17 19:34:04 +0000
committermiod <miod@openbsd.org>2012-05-17 19:34:04 +0000
commit61d3dce3bb58612b7b66cde20701cdacc1174490 (patch)
tree40876c5a907c17336172ad6c5d10973c62d4b415
parentQuit if write(2) returns -1 when writing to the tty, which can (diff)
downloadwireguard-openbsd-61d3dce3bb58612b7b66cde20701cdacc1174490.tar.xz
wireguard-openbsd-61d3dce3bb58612b7b66cde20701cdacc1174490.zip
Correct virtual aliasing mask computation.
Note that this would only affect 4KB page size IP22 kernels, which is not the default IP22 configuration, and which noone not out of his or her mind would do. In other words: this is a correctness fix with no impact on Real Life (c)(R)TM
-rw-r--r--sys/arch/mips64/mips64/cache_r4k.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/mips64/mips64/cache_r4k.c b/sys/arch/mips64/mips64/cache_r4k.c
index e15544b6e61..0fe0127be23 100644
--- a/sys/arch/mips64/mips64/cache_r4k.c
+++ b/sys/arch/mips64/mips64/cache_r4k.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cache_r4k.c,v 1.3 2012/04/21 12:20:30 miod Exp $ */
+/* $OpenBSD: cache_r4k.c,v 1.4 2012/05/17 19:34:04 miod Exp $ */
/*
* Copyright (c) 2012 Miodrag Vallat.
@@ -68,7 +68,8 @@ Mips4k_ConfigCache(struct cpu_info *ci)
ci->ci_l1instcacheset = ci->ci_l1instcachesize;
ci->ci_l1datacacheset = ci->ci_l1datacachesize;
- cache_valias_mask = (ci->ci_l1instcachesize | ci->ci_l1datacachesize) &
+ cache_valias_mask =
+ (max(ci->ci_l1instcachesize, ci->ci_l1datacachesize) - 1) &
~PAGE_MASK;
if ((cfg & (1 << 17)) == 0) { /* SC */