All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Desnogues <laurent.desnogues@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 0/3] target-arm: cache tbflags in CPUARMState
Date: Mon, 26 Sep 2016 13:13:41 +0200	[thread overview]
Message-ID: <CABoDooPppBS6UNd1nvvrT+GuKjpt94Gwu47_wtwU-Ah-k_r4pw@mail.gmail.com> (raw)
In-Reply-To: <CABoDooPE9PP4fQg544LymGFF1PHzbPPTxUwpNnkpy5A1AurO2w@mail.gmail.com>

On Mon, Sep 26, 2016 at 12:04 PM, Laurent Desnogues
<laurent.desnogues@gmail.com> wrote:
> Hello,
>
> On Wed, Sep 14, 2016 at 11:56 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> Computing TranslationBlock flags is pretty expensive on ARM, especially
>> 32-bit.  Because tbflags are computed on every tb lookup, it is not
>> unlikely to see cpu_get_tb_cpu_state close to the top of the profile
>> now that QHT makes the hash table much more efficient.
>>
>> However, most tbflags only change when the EL is switched or after
>> MSR instructions.  Based on this observation, this series caches these
>> tbflags in CPUARMState, resulting in a 10-15% speedup on 32-bit code.
>
> I like that patch!
>
> I quickly tested with some softmmu images on both AArch32 and AArch64
> and I can confirm the speedup.
>
> As far as your patch goes:
>
> Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
> Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
>
> Thanks,
>
> Laurent
>
> PS - BTW, I couldn't run any user mode program since they segfault on
> mainline for some reason I have no time to look into.  The v2.7.0 tag
> works.

It turned out this was a mistake on my side.

I ran one SPEC2k test with the patch in user mode, and got a few
percent improvements for both AArch32 and AArch64.

Thanks,

Laurent

>
>> Paolo
>>
>> Paolo Bonzini (3):
>>   target-arm: introduce cpu_dynamic_tb_cpu_flags
>>   target-arm: add env->tbflags
>>   target-arm: cache most tbflags
>>
>>  target-arm/cpu.c           |  2 ++
>>  target-arm/cpu.h           | 58 ++++++++++++++++++++++++++++++++--------------
>>  target-arm/helper.c        |  2 ++
>>  target-arm/helper.h        |  1 +
>>  target-arm/op_helper.c     |  7 ++++++
>>  target-arm/translate-a64.c |  4 ++++
>>  target-arm/translate.c     | 12 ++++++++--
>>  target-arm/translate.h     |  1 +
>>  8 files changed, 68 insertions(+), 19 deletions(-)
>>
>> --
>> 2.7.4
>>
>>

  reply	other threads:[~2016-09-26 11:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  9:56 [Qemu-devel] [PATCH 0/3] target-arm: cache tbflags in CPUARMState Paolo Bonzini
2016-09-14  9:56 ` [Qemu-devel] [PATCH 1/3] target-arm: introduce cpu_dynamic_tb_cpu_flags Paolo Bonzini
2016-09-14  9:56 ` [Qemu-devel] [PATCH 2/3] target-arm: add env->tbflags Paolo Bonzini
2016-09-26 22:00   ` Peter Maydell
2016-09-27  8:15     ` Paolo Bonzini
2016-09-14  9:56 ` [Qemu-devel] [PATCH 3/3] target-arm: cache most tbflags Paolo Bonzini
2016-09-26 10:04 ` [Qemu-devel] [PATCH 0/3] target-arm: cache tbflags in CPUARMState Laurent Desnogues
2016-09-26 11:13   ` Laurent Desnogues [this message]
2016-11-10 11:42 ` Alex Bennée
2016-11-10 12:19   ` Paolo Bonzini
2016-11-10 13:37     ` Alex Bennée

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=CABoDooPppBS6UNd1nvvrT+GuKjpt94Gwu47_wtwU-Ah-k_r4pw@mail.gmail.com \
    --to=laurent.desnogues@gmail.com \
    --cc=pbonzini@redhat.com \
    --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 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.