[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] CPU TLB flush with multithread TCG.
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] CPU TLB flush with multithread TCG. |
Date: |
Wed, 11 Feb 2015 03:33:22 +0000 |
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?
>
> Thanks,
> Fred
--
Alex Bennée