summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-03-24 17:12:52 +0000
committermiod <miod@openbsd.org>2014-03-24 17:12:52 +0000
commitc27a65bc2beab96dd6d45465e64c3ad2d9000cc4 (patch)
tree4617c69caa94c070497ee9d774f6f3ee3b977087
parentMake sure tlb_probe() reads the probe result before reenabling interrupts (diff)
downloadwireguard-openbsd-c27a65bc2beab96dd6d45465e64c3ad2d9000cc4.tar.xz
wireguard-openbsd-c27a65bc2beab96dd6d45465e64c3ad2d9000cc4.zip
Only need to call tlb_probe() once per pair, instead of once per page.
-rw-r--r--sys/arch/mips64/mips64/r4000_errata.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/mips64/mips64/r4000_errata.c b/sys/arch/mips64/mips64/r4000_errata.c
index c246c1731ac..969934a4af8 100644
--- a/sys/arch/mips64/mips64/r4000_errata.c
+++ b/sys/arch/mips64/mips64/r4000_errata.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: r4000_errata.c,v 1.1 2014/03/22 00:01:04 miod Exp $ */
+/* $OpenBSD: r4000_errata.c,v 1.2 2014/03/24 17:12:52 miod Exp $ */
/*
* Copyright (c) 2014 Miodrag Vallat.
@@ -187,8 +187,8 @@ eop_tlb_miss_handler(struct trap_frame *trapframe, struct cpu_info *ci,
* Clear possible TLB entries for the pages we're about to wire.
*/
- for (i = npairs * 2, va = faultva & PG_HVPN; i != 0;
- i--, va += PAGE_SIZE) {
+ for (i = npairs, va = faultva & PG_HVPN; i != 0;
+ i--, va += 2 * PAGE_SIZE) {
tlbidx = tlb_probe(va | asid);
if (tlbidx >= 0)
tlb_update_indexed(CKSEG0_BASE, PG_NV, PG_NV, tlbidx);