From: Catalin Marinas <catalin.marinas@arm.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com,
marc.zyngier@arm.com, will.deacon@arm.com,
linux-kernel@vger.kernel.org, Vadim.Lomovtsev@caviumnetworks.com
Subject: Re: [PATCH v4 2/5] arm64: Allow a capability to be checked on a single CPU
Date: Fri, 22 Apr 2016 14:32:09 +0100 [thread overview]
Message-ID: <20160422133209.GJ2998@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <1461324335-5081-3-git-send-email-suzuki.poulose@arm.com>
On Fri, Apr 22, 2016 at 12:25:32PM +0100, Suzuki K. Poulose wrote:
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -1005,6 +1005,24 @@ static void __init setup_feature_capabilities(void)
> enable_cpu_capabilities(arm64_features);
> }
>
> +/*
> + * Check if the current CPU has a given feature capability.
> + * Should be called from non-preemptible context.
> + */
> +bool this_cpu_has_cap(unsigned int cap)
> +{
> + const struct arm64_cpu_capabilities *caps = arm64_features;
> +
> + if (WARN_ON(preemptible()))
> + return false;
> +
> + for (caps = arm64_features; caps->desc; caps++)
> + if (caps->capability == cap && caps->matches)
> + return caps->matches(caps, SCOPE_LOCAL_CPU);
Nitpick: you don't need to initialise "caps" twice.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
next prev parent reply other threads:[~2016-04-22 13:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 11:25 [PATCH v4 0/5] arm64: Fix behavior of maxcpus=n Suzuki K Poulose
2016-04-22 11:25 ` [PATCH v4 1/5] arm64: cpufeature: Add scope for capability check Suzuki K Poulose
2016-04-22 13:29 ` Catalin Marinas
2016-04-22 11:25 ` [PATCH v4 2/5] arm64: Allow a capability to be checked on a single CPU Suzuki K Poulose
2016-04-22 13:32 ` Catalin Marinas [this message]
2016-04-22 11:25 ` [PATCH v4 3/5] irqchip/gic: Restore CPU interface checking Suzuki K Poulose
2016-04-22 13:33 ` Catalin Marinas
2016-04-22 11:25 ` [PATCH v4 4/5] arm64: Verify CPU errata work arounds on hotplugged CPU Suzuki K Poulose
2016-04-22 13:40 ` Catalin Marinas
2016-04-22 13:43 ` Suzuki K Poulose
2016-04-22 11:25 ` [PATCH v4 5/5] arm64: Fix behavior of maxcpus=N Suzuki K Poulose
2016-04-22 13:50 ` Catalin Marinas
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=20160422133209.GJ2998@e104818-lin.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=Vadim.Lomovtsev@caviumnetworks.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 \
--cc=will.deacon@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
all inboxes | Powered by JetHome®