From: "Emilio G. Cota" <cota@braap.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel <qemu-devel@nongnu.org>,
"Pranith Kumar" <bobby.prani@gmail.com>
Subject: Re: [Qemu-devel] ideas for improving TLB performance (help with TCG backend wanted)
Date: Mon, 1 Oct 2018 21:54:49 -0400 [thread overview]
Message-ID: <20181002015449.GA19082@flamenco> (raw)
In-Reply-To: <4d2fbab5-13c8-1c19-5e58-02968cdcfef0@linaro.org>
On Mon, Oct 01, 2018 at 15:40:37 -0500, Richard Henderson wrote:
> On 10/1/18 1:34 PM, Emilio G. Cota wrote:
> > On Thu, Sep 20, 2018 at 01:19:51 +0100, Alex Bennée wrote:
> >> If we are going to have an indirection then we can also drop the
> >> requirement to scale the TLB according to the number of MMU indexes we
> >> have to support. It's fairly wasteful when a bunch of them are almost
> >> never used unless you are running stuff that uses them.
> >
> > So with dynamic TLB sizing, what you're suggesting here is to resize
> > each MMU array independently (depending on their use rate) instead
> > of using a single "TLB size" for all MMU indexes. Am I understanding
> > your point correctly?
>
> You cannot do that without flushing the TBs (and with out-of-line memory ops,
> the prologue as well) and regenerating. The TLB size is baked into the code.
> And we really don't have any extra registers free to vary that.
Can you please elaborate on this? I can't see where this is
baked into the generated code, other than the TLB lookup.
Grepping for CPU_TLB_SIZE and CPU_TLB_BITS only shows a few
places.
I have written today a prototype of dynamic TLB flushing. It
uses no extra registers because mmu_idx is known at generation time.
I haven't done any extensive testing yet, but at least it boots
aarch64 and x86_64 guests on an x86_64 host.
The code (some messy WIP commits in there, sorry) is at:
https://github.com/cota/qemu/tree/tlb2
Please take a look -- am I doing anything horribly wrong there?
Thanks,
Emilio
next prev parent reply other threads:[~2018-10-02 1:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180919175423.GA25553@flamenco>
[not found] ` <87va71uijc.fsf@linaro.org>
2018-10-01 18:34 ` [Qemu-devel] ideas for improving TLB performance (help with TCG backend wanted) Emilio G. Cota
2018-10-01 20:40 ` Richard Henderson
2018-10-02 1:54 ` Emilio G. Cota [this message]
2018-10-02 6:48 ` Alex Bennée
2018-10-02 18:09 ` Emilio G. Cota
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=20181002015449.GA19082@flamenco \
--to=cota@braap.org \
--cc=alex.bennee@linaro.org \
--cc=bobby.prani@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).