summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-06-28 16:26:59 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-06-28 16:26:59 +0200
commit30ab804b5878a9f4721fb1de3f03f4a0400a6fb1 (patch)
treed24e407f7d1968592268085282e0addc654687d2
parent675ebaeca3c38d2684b249faae1fc24c5c2b6e0e (diff)
kernel: segflush() needs to flush tlb of other processes
instruction cache maintenance is done on tlb miss; when a page gets fauled in; with putmmu() checking the page->txtflush cpu bitmap. syssegflush() used to only call flushmmu() after segflush() for the calling process, but when a segment is shared with other processes, we have to flush the other processes tlb as well. this adds the missing procflushseg() call into segflush(). note that procflushseg() leaves the calling process alone, so the flushmmu() call in syssegflush() is still required. segmentioproc() does not need to call flushmmu() after segflush() as it is never going to jump to the modified page, hence the stale icache does not matter.
-rw-r--r--sys/src/9/port/segment.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/src/9/port/segment.c b/sys/src/9/port/segment.c
index 83b723eb8..bc3e61cb7 100644
--- a/sys/src/9/port/segment.c
+++ b/sys/src/9/port/segment.c
@@ -704,6 +704,8 @@ segflush(void *va, uintptr len)
error(Ebadarg);
s->flushme = 1;
+ if(s->ref > 1)
+ procflushseg(s);
more:
len = (s->top < to ? s->top : to) - from;
if(s->mapsize > 0){