From: Richard Henderson <rth@twiddle.net>
To: Tom Hanson <thomas.hanson@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] best way to implement emulation of AArch64 tagged addresses
Date: Fri, 8 Apr 2016 11:10:42 -0700 [thread overview]
Message-ID: <5707F422.1090100@twiddle.net> (raw)
In-Reply-To: <1460136006.50712.3.camel@TomH-Z-Workstation>
On 04/08/2016 10:20 AM, Tom Hanson wrote:
> Is it an option to mask off the tag bits in all cases? Is there any case
> it which those bits are valid address bits?
It's not impossible to mask off bits in the address -- we do that for running
32-bit on 64-bit all of the time. It's all a question of how well the average
program will perform, I suppose.
For instance. Are there more tagged addresses than non-tagged addresses? If
we mask off bits, that will affect *every* memory operation. If tagged
addresses are rare, then that is a waste. If tagged addresses are common,
however, then we may well spend too much time ping-ponging in the TLB.
The fastest method I can think of to ignore high order bits is to shift the
address comparator left. The TLB comparator would be stored pre-shifted, so
this would add only one insn on the fast path. Or perhaps zero in the case of
an arm/aarch64 host, where the compare insn itself can perform the shift.
Of course, a double-word shift would be completely out of the question when
doing 64-bit on 32-bit emulation. But we don't need that -- just shift the
high part of the address left to discard bits, leaving a funny looking hole in
the middle of the comparator.
This is simple enough that it should be relatively easy to patch up all of the
tcg backends to match, if we decide to go with it.
r~
next prev parent reply other threads:[~2016-04-08 18:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 15:51 [Qemu-devel] best way to implement emulation of AArch64 tagged addresses Peter Maydell
2016-04-04 16:28 ` Richard Henderson
2016-04-04 16:31 ` Peter Maydell
2016-04-04 17:56 ` Richard Henderson
2016-04-08 17:20 ` Tom Hanson
2016-04-08 18:06 ` Peter Maydell
2016-04-08 18:10 ` Richard Henderson [this message]
2016-04-09 0:29 ` Thomas Hanson
2016-04-09 15:57 ` Richard Henderson
2016-04-11 12:58 ` Thomas Hanson
2016-04-13 13:36 ` Tom Hanson
2016-04-04 16:35 ` Peter Maydell
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=5707F422.1090100@twiddle.net \
--to=rth@twiddle.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thomas.hanson@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).