From: Will Deacon <will.deacon@arm.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, marc.zyngier@arm.com,
catalin.marinas@arm.com, mark.rutland@arm.com,
Vadim.Lomovtsev@caviumnetworks.com,
James Morse <james.morse@arm.com>,
Andre Przywara <andre.przywara@arm.com>
Subject: Re: [PATCH 1/5] arm64: cpufeature: Add scope for capability check
Date: Thu, 14 Apr 2016 18:38:10 +0100 [thread overview]
Message-ID: <20160414173809.GN4584@arm.com> (raw)
In-Reply-To: <1459941854-5190-2-git-send-email-suzuki.poulose@arm.com>
Hi Suzuki,
On Wed, Apr 06, 2016 at 12:24:10PM +0100, Suzuki K Poulose wrote:
> Add scope parameter to the arm64_cpu_capabilities::matches(),
> so that this can be reused for checking the capability on a
> given CPU vs the system wide. By default, the system uses
> 'system' wide values for setting the CPU_HWCAPs and ELF_HWCAPs.
>
> Cc: James Morse <james.morse@arm.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Andre Przywara <andre.przywara@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
> arch/arm64/include/asm/cpufeature.h | 8 +++++++-
> arch/arm64/kernel/cpu_errata.c | 2 +-
> arch/arm64/kernel/cpufeature.c | 37 +++++++++++++++++++----------------
> 3 files changed, 28 insertions(+), 19 deletions(-)
>
> diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
> index ca8fb4b..5f10344 100644
> --- a/arch/arm64/include/asm/cpufeature.h
> +++ b/arch/arm64/include/asm/cpufeature.h
> @@ -78,10 +78,16 @@ struct arm64_ftr_reg {
> struct arm64_ftr_bits *ftr_bits;
> };
>
> +/* scope of capability check */
> +enum {
> + SCOPE_SYSTEM,
> + SCOPE_CPU,
> +};
> +
> struct arm64_cpu_capabilities {
> const char *desc;
> u16 capability;
> - bool (*matches)(const struct arm64_cpu_capabilities *);
> + bool (*matches)(const struct arm64_cpu_capabilities *caps, int scope);
> void (*enable)(void *); /* Called on all active CPUs */
> union {
> struct { /* To be used for erratum handling only */
> diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
> index 06afd04..2fd5780 100644
> --- a/arch/arm64/kernel/cpu_errata.c
> +++ b/arch/arm64/kernel/cpu_errata.c
> @@ -22,7 +22,7 @@
> #include <asm/cpufeature.h>
>
> static bool __maybe_unused
> -is_affected_midr_range(const struct arm64_cpu_capabilities *entry)
> +is_affected_midr_range(const struct arm64_cpu_capabilities *entry, int __unused)
Maybe it would be better to WARN if somebody passes SCOPE_SYSTEM, rather
than silently treat it as per-cpu?
Will
next prev parent reply other threads:[~2016-04-14 17:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-06 11:24 [PATCH 0/5] arm64: Fix behavior of maxcpus=n Suzuki K Poulose
2016-04-06 11:24 ` [PATCH 1/5] arm64: cpufeature: Add scope for capability check Suzuki K Poulose
2016-04-14 17:38 ` Will Deacon [this message]
2016-04-14 17:47 ` Suzuki K Poulose
2016-04-15 12:55 ` Will Deacon
2016-04-15 13:26 ` Suzuki K Poulose
2016-04-06 11:24 ` [PATCH 2/5] arm64: Allow a capability to be checked on a single CPU Suzuki K Poulose
2016-04-06 11:24 ` [PATCH 3/5] irqchip/gic: Restore CPU interface checking Suzuki K Poulose
2016-04-06 11:24 ` [PATCH 4/5] arm64: Verify CPU errata work arounds on hotplugged CPU Suzuki K Poulose
2016-04-14 17:39 ` Will Deacon
2016-04-14 17:49 ` Suzuki K Poulose
2016-04-15 14:10 ` Suzuki K Poulose
2016-04-15 14:12 ` Will Deacon
2016-04-18 13:41 ` Suzuki K Poulose
2016-04-06 11:24 ` [PATCH 5/5] arm64: Fix behavior of maxcpus=N Suzuki K Poulose
2016-04-07 9:18 ` James Morse
2016-04-07 9:26 ` Suzuki K Poulose
2016-04-07 10:07 ` [UPDATED] " Suzuki K Poulose
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=20160414173809.GN4584@arm.com \
--to=will.deacon@arm.com \
--cc=Vadim.Lomovtsev@caviumnetworks.com \
--cc=andre.przywara@arm.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=suzuki.poulose@arm.com \
/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).