summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2017-06-22 14:40:21 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2017-06-22 14:40:21 +0000
commit74fda550bee4ab5ca53180d74ddf0cd98b877ca9 (patch)
treebe6a434148c6834e731a8a48f5a5f317705234cb /sys
parent89236f8c00515ef5686d5ab84119f4ec760591b3 (diff)
Improve the coalescing of instruction cache flushes on R8000 in order
not to perform redundant work. There is no direct way to flush the cache; rather, the kernel evicts unwanted bits from the cache by executing a block of instructions, which is expensive. With this diff, make build time decreases about 0.4%. Diff from miod@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mips64/mips64/cache_tfp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/mips64/mips64/cache_tfp.c b/sys/arch/mips64/mips64/cache_tfp.c
index 50e47d5fa62..8dbb66584d1 100644
--- a/sys/arch/mips64/mips64/cache_tfp.c
+++ b/sys/arch/mips64/mips64/cache_tfp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cache_tfp.c,v 1.6 2016/01/05 05:27:54 visa Exp $ */
+/* $OpenBSD: cache_tfp.c,v 1.7 2017/06/22 14:40:20 visa Exp $ */
/*
* Copyright (c) 2012 Miodrag Vallat.
@@ -128,9 +128,11 @@ tfp_InvalidateICache(struct cpu_info *ci, vaddr_t _va, size_t _sz)
vsize_t sz;
void (*inval_subr)(vsize_t);
+ if (ci->ci_cachepending_l1i != 0)
+ return;
+
if (_sz >= ci->ci_l1inst.size) {
- tfp_inval_icache(ci->ci_l1inst.size);
- ci->ci_cachepending_l1i = 0;
+ ci->ci_cachepending_l1i = 1;
} else {
/* extend the range to multiple of 32 bytes */
va = _va & ~(32UL - 1);