From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: pbonzini@redhat.com, qemu-arm@nongnu.org,
Idan Horowitz <idan.horowitz@gmail.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 2/2] target/arm: Bail out early on 0-length tlb range invalidate
Date: Wed, 26 Jan 2022 10:34:20 +1100 [thread overview]
Message-ID: <3f89816f-5e59-bac5-01bc-d9cc73d15927@linaro.org> (raw)
In-Reply-To: <CAFEAcA-VuVPfDaPCZ9ta+vtmj9RUb_BBMCihTGKsEV4SSphaEw@mail.gmail.com>
On 1/26/22 9:06 AM, Peter Maydell wrote:
> On Tue, 25 Jan 2022 at 22:05, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> On 1/11/22 3:47 AM, Idan Horowitz wrote:
>>> If the given range specifies no addresses to be flushed there's no reason
>>> to schedule a function on all CPUs that does nothing.
>>>
>>> Signed-off-by: Idan Horowitz <idan.horowitz@gmail.com>
>>> ---
>>> target/arm/helper.c | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>>
>>> diff --git a/target/arm/helper.c b/target/arm/helper.c
>>> index cfca0f5ba6..1e819835c2 100644
>>> --- a/target/arm/helper.c
>>> +++ b/target/arm/helper.c
>>> @@ -4564,6 +4564,10 @@ static void do_rvae_write(CPUARMState *env, uint64_t value,
>>> length = tlbi_aa64_range_get_length(env, value);
>>> bits = tlbbits_for_regime(env, one_idx, baseaddr);
>>>
>>> + if (length == 0) {
>>> + return;
>>> + }
>>> +
>>> if (synced) {
>>> tlb_flush_range_by_mmuidx_all_cpus_synced(env_cpu(env),
>>> baseaddr,
>>>
>>
>> Looks good. I guess we could sort the extractions above so that we do
>>
>> length = ...;
>> if (length == 0) {
>> return;
>> }
>>
>> addr = ...
>> bits = ...
>>
>> Either way,
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
> Should we handle this in the tlb_flush_* functions themselves,
> or is it just Arm that has to fix up a special case of "actually
> the length is zero" ?
Hmm. Probably should handle this in tlb_*, yes.
So far, Arm is the only user regardless.
r~
next prev parent reply other threads:[~2022-01-25 23:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 16:47 [PATCH 1/2] accel/tcg: Optimize jump cache flush during tlb range flush Idan Horowitz
2022-01-10 16:47 ` [PATCH 2/2] target/arm: Bail out early on 0-length tlb range invalidate Idan Horowitz
2022-01-25 22:05 ` Richard Henderson
2022-01-25 22:06 ` Peter Maydell
2022-01-25 23:34 ` Richard Henderson [this message]
2022-01-14 15:48 ` [PATCH 1/2] accel/tcg: Optimize jump cache flush during tlb range flush Alex Bennée
2022-01-14 16:41 ` Idan Horowitz
2022-01-14 20:56 ` Idan Horowitz
2022-01-25 21:55 ` Richard Henderson
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=3f89816f-5e59-bac5-01bc-d9cc73d15927@linaro.org \
--to=richard.henderson@linaro.org \
--cc=idan.horowitz@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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 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).