Frederic Konrad <address@hidden> writes:
Hi everybody,
In multithread tlb_flush is broken as CPUA can flush an other CPUB and
CPUB can be
executing code, and fixing this can be quite hard:
* We need to exit the CPU which is flushed.
* Makes sure the CPU is stopped.
* Then we can flush tlb.
The big issues are:
* Two threads can be doing a flush at the same time.
* Something can restart the CPU during the flush.
A better idea I think is that instead of flushing tlb we can put a flag
in CPUState such
as flush_request and ask the cpu to exit.
Then later once the CPU is exited we can flush tlbs if flush_request is set.
It will ensure that the CPU won't execute code as it's associated thread
will be
flushing.
Can this work?
Does this imply deferring the work? Surely if we don't flush when
instructed things could break down very quickly?