qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/4] cputlb: Add tlb_set_asid_for_mmuidx
Date: Thu, 15 Nov 2018 18:56:14 +0000	[thread overview]
Message-ID: <CAFEAcA8jD0bRzLUbATTSW+wEh90iv3eaA7=eQA2kQnT=T2hRbg@mail.gmail.com> (raw)
In-Reply-To: <94e3624b-a2a3-7a1e-7dc7-6e43d8447f1e@linaro.org>

On 15 November 2018 at 18:51, Richard Henderson
<richard.henderson@linaro.org> wrote:
> On 11/15/18 7:36 PM, Peter Maydell wrote:
>> On 29 October 2018 at 15:53, Richard Henderson
>> <richard.henderson@linaro.org> wrote:
>>> Although we can't do much with ASIDs except remember them, this
>>> will allow cleanups within target/ that should make things clearer.
>>>
>>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

>>> +void tlb_set_asid_for_mmuidx(CPUState *cpu, uint32_t asid, uint16_t idxmap,
>>> +                             uint16_t depmap)
>>> +{
>>> +    CPUArchState *env = cpu->env_ptr;
>>> +    uint16_t work, to_flush = 0;
>>
>> The other functions that work on the tlb defer their
>> actual operation to an async-work type function or
>> do a run-on-cpu if the passed-in CPU is not the current
>> CPU. Do we need to do that here too?
>
> I don't *think* so.  I would expect an ASID to be set in response to some
> cpu-local change, like setting TTBR0_EL1.  Something that cannot be done across
> cpus.  I could assert_cpu_is_self, if you like.

Yes, if the function expects to be called only for the
current CPU we should assert and document this.

> What I *should* be adding as well is cross-cpu asid-specific tlb flushing, a-la
> TLBI ASID.  That would need the run-on-cpu stuff.
>
>> So this will flush all the passed in indexes in idxmap
>> if any one of them was previously the wrong ASID. Is that
>> necessary, or could we just flush only the ones which
>> were wrong and not flush any that were already the correct ASID ?
>
> It probably wouldn't be necessary.  But I also sort of expect the set of
> indexes to always have the same ASID -- e.g. kernel vs user views of the same
> address space, e.g. S12NSE0 + S12NSE1.  I don't really know what to do when
> this presumed invariant is violated.

We should either document the invariant at the cputlb.c level
(and assert it, if not too tedious to do), or say that the cputlb
code doesn't care, and just only flush the indexes which have the
wrong ASID currently, I think.

thanks
-- PMM

  reply	other threads:[~2018-11-15 18:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 15:53 [Qemu-devel] [PATCH 0/4] target/arm: Minimize TLB flushing for ASID changes Richard Henderson
2018-10-29 15:53 ` [Qemu-devel] [PATCH 1/4] cputlb: Add tlb_set_asid_for_mmuidx Richard Henderson
2018-11-15 18:36   ` Peter Maydell
2018-11-15 18:51     ` Richard Henderson
2018-11-15 18:56       ` Peter Maydell [this message]
2018-10-29 15:53 ` [Qemu-devel] [PATCH 2/4] target/arm: Install ASIDs for long-form from EL1 Richard Henderson
2018-10-29 15:53 ` [Qemu-devel] [PATCH 3/4] target/arm: Install ASIDs for short-form " Richard Henderson
2018-11-15 18:52   ` Peter Maydell
2018-11-16 13:47   ` Peter Maydell
2018-10-29 15:53 ` [Qemu-devel] [PATCH 4/4] target/arm: Install ASIDs for EL2 Richard Henderson
2018-11-15 18:38   ` Peter Maydell
2018-10-30 15:40 ` [Qemu-devel] [PATCH 0/4] target/arm: Minimize TLB flushing for ASID changes Emilio G. Cota
2018-11-05 16:30 ` Peter Maydell
2018-11-05 17:38   ` Richard Henderson
2018-11-15 18:25 ` 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='CAFEAcA8jD0bRzLUbATTSW+wEh90iv3eaA7=eQA2kQnT=T2hRbg@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --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).