diff options
author | 2017-06-22 14:40:20 +0000 | |
---|---|---|
committer | 2017-06-22 14:40:20 +0000 | |
commit | 8929cd64b26afc524177459660f1e98e79a37c3d (patch) | |
tree | 51b2a5070f676fbebea9e3d9bdbcf18995e21322 | |
parent | typo; from jack burton (diff) | |
download | wireguard-openbsd-8929cd64b26afc524177459660f1e98e79a37c3d.tar.xz wireguard-openbsd-8929cd64b26afc524177459660f1e98e79a37c3d.zip |
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@
-rw-r--r-- | sys/arch/mips64/mips64/cache_tfp.c | 8 |
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); |