From: Frederic Konrad <fred.konrad@greensocs.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: mttcg@listserver.greensocs.com,
Peter Maydell <peter.maydell@linaro.org>,
Jan Kiszka <jan.kiszka@siemens.com>,
qemu-devel <qemu-devel@nongnu.org>,
Alexander Graf <agraf@suse.de>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] CPU TLB flush with multithread TCG.
Date: Wed, 11 Feb 2015 09:42:24 +0100 [thread overview]
Message-ID: <54DB15F0.1060004@greensocs.com> (raw)
In-Reply-To: <87pp9hrukd.fsf@linaro.org>
On 11/02/2015 04:33, Alex Bennée wrote:
> Frederic Konrad <fred.konrad@greensocs.com> 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
next prev parent reply other threads:[~2015-02-11 8:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 10:02 [Qemu-devel] CPU TLB flush with multithread TCG Frederic Konrad
2015-02-11 3:33 ` Alex Bennée
2015-02-11 8:35 ` Mark Burton
2015-02-11 8:42 ` Frederic Konrad [this message]
2015-02-11 17:17 ` Frederic Konrad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54DB15F0.1060004@greensocs.com \
--to=fred.konrad@greensocs.com \
--cc=agraf@suse.de \
--cc=alex.bennee@linaro.org \
--cc=jan.kiszka@siemens.com \
--cc=mttcg@listserver.greensocs.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.