qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] CPU TLB flush with multithread TCG.


From: Frederic Konrad
Subject: Re: [Qemu-devel] CPU TLB flush with multithread TCG.
Date: Wed, 11 Feb 2015 09:42:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 11/02/2015 04:33, Alex Bennée wrote:
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?

Yes this imply deferring the work. It might be an issue as we can't exit the CPU
directly, they will finish their execution before flushing..

But maybe it's only a problem if the CPU flushes himself?
eg: if CPUB is executing instructions and CPUA wants to flush it: does that makes a difference if the flush happen before or after the block of instruction executed by
CPUB?

Thanks,
Fred

Thanks,
Fred




reply via email to

[Prev in Thread] Current Thread [Next in Thread]