From: Richard Henderson <rth@twiddle.net>
To: Peter Maydell <peter.maydell@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>
Cc: Thomas Hanson <thomas.hanson@linaro.org>
Subject: Re: [Qemu-devel] best way to implement emulation of AArch64 tagged addresses
Date: Mon, 4 Apr 2016 09:28:32 -0700 [thread overview]
Message-ID: <57029630.3070300@twiddle.net> (raw)
In-Reply-To: <CAFEAcA8c4opwvO6LJ-Ecai3x77goxyhj7P8OuzgB64As752Fiw@mail.gmail.com>
On 04/04/2016 08:51 AM, Peter Maydell wrote:
> I thought of two possible ways to approach implementing this.
> Option (1) would be to change the codegen in translate-a64.c so that
> we mask out high bits before doing the QEMU load/store TCG op.
> Option (2) leaves the VA that we pass to the TCG load/store alone
> (ie with tag bits intact) and tries to handle this all in the va-to-pa
> code.
>
> I think option (1) is a non-starter because of that requirement to
> report the full address with tags in the FAR (as well as being slower
> due to all the extra masking on memory operations). So that leaves
> option (2), possibly with some help from common code to make things
> a bit less awkward.
Agreed.
> In particular I think if you just do the relevant handling of the tag
> bits in target-arm's get_phys_addr() and its subroutines then this
> should work ok, with the exceptions that:
> * the QEMU TLB code will think that [tag A + address X] and
> [tag B + address X] are different virtual addresses and they will
> miss each other in the TLB
Yep. Not only miss, but actively contend with each other.
> * tlb invalidate by address becomes nasty because we need to invalidate
> [every tag + address X]
Hmm. We should require only one flush for X. But the common code doesn't know
that... I suppose a new tlb_flush_page_mask would do the trick.
> Can we fix those just by having arm_tlb_fill() call
> tlb_set_page_with_attrs() with the vaddr with the tag masked out?
No, that misses when we perform the full vaddr+tag comparison on the TCG fast path.
> [NB: this is all assuming softmmu; getting tagged addresses to work
> in linux-user mode would require doing the masking in translate.c,
> but I definitely don't want two implementations so I guess we just
> ignore linux-user here.]
Let's just say it's another user for the oft wished for softmmu-in-linux-user.
r~
next prev parent reply other threads:[~2016-04-04 16:28 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 [this message]
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
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=57029630.3070300@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 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.