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.
This commit is contained in:
cinap_lenrek 2020-06-28 16:26:59 +02:00
parent 675ebaeca3
commit 30ab804b58

View file

@ -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){