From: Marc Zyngier <maz@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: suzuki.poulose@arm.com, catalin.marinas@arm.com,
james.morse@arm.com, linux-arm-kernel@lists.infradead.org,
will@kernel.org, kvmarm@lists.cs.columbia.edu,
julien.thierry.kdev@gmail.com
Subject: Re: [PATCH 0/2] arm64: add finalized cap helper
Date: Mon, 17 Feb 2020 14:48:04 +0000 [thread overview]
Message-ID: <58fa19a5899eb3295783afa7baf15c4e@kernel.org> (raw)
In-Reply-To: <20200210122708.38826-1-mark.rutland@arm.com>
On 2020-02-10 12:27, Mark Rutland wrote:
> Across arm64 we use cpus_have_const_cap() to check for a capability
> without a runtime check. Prior to capabilities being finalized
> cpus_have_const_cap() falls back to a runtime check of the cpu_hwcaps
> array. In some cases we know that code is never invoked prior to the
> capabilities being finalized, and the fallback code is redundant (and
> unsound if ever executed in hyp context).
>
> So that we can avoid the redundant code and detect when the caps are
> unexpectedly checked too early, this series adds a new
> cpus_have_final_cap() helper, and migrates the KVM hyp code over to it.
>
> I'm hoping to use this as part of the entry.S -> entry-common.c
> conversion, and there are other places in arm64 that could potentially
> use this today.
>
> Thanks,
> Mark.
>
> Mark Rutland (2):
> arm64: cpufeature: add cpus_have_final_cap()
> arm64: kvm: hyp: use cpus_have_final_cap()
>
> arch/arm64/include/asm/cpufeature.h | 47
> +++++++++++++++++++++++++++++++++----
> arch/arm64/kvm/hyp/switch.c | 14 +++++------
> arch/arm64/kvm/hyp/sysreg-sr.c | 8 +++----
> arch/arm64/kvm/hyp/tlb.c | 8 +++----
> 4 files changed, 57 insertions(+), 20 deletions(-)
Seems like a valuable optimization. For the series:
Reviewed-by: Marc Zyngier <maz@kernel.org>
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2020-02-17 14:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-10 12:27 [PATCH 0/2] arm64: add finalized cap helper Mark Rutland
2020-02-10 12:27 ` [PATCH 1/2] arm64: cpufeature: add cpus_have_final_cap() Mark Rutland
2020-02-10 16:37 ` Suzuki Kuruppassery Poulose
2020-02-10 17:37 ` Mark Rutland
2020-02-10 12:27 ` [PATCH 2/2] arm64: kvm: hyp: use cpus_have_final_cap() Mark Rutland
2020-02-17 14:48 ` Marc Zyngier [this message]
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=58fa19a5899eb3295783afa7baf15c4e@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.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).