Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1385177
| From | Catalin Marinas <catalin.marinas@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 2/5] arm64: Allow a capability to be checked on a single CPU |
| Date | 2016-04-22 15:40 +0200 |
| Message-ID | <rqJto-2Ga-11@gated-at.bofh.it> (permalink) |
| References | <rqHrz-1aV-3@gated-at.bofh.it> <rqHrB-1aV-53@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v4 0/5] arm64: Fix behavior of maxcpus=n Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-04-22 13:30 +0200
[PATCH v4 3/5] irqchip/gic: Restore CPU interface checking Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-04-22 13:30 +0200
Re: [PATCH v4 3/5] irqchip/gic: Restore CPU interface checking Catalin Marinas <catalin.marinas@arm.com> - 2016-04-22 15:40 +0200
[PATCH v4 1/5] arm64: cpufeature: Add scope for capability check Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-04-22 13:30 +0200
Re: [PATCH v4 1/5] arm64: cpufeature: Add scope for capability check Catalin Marinas <catalin.marinas@arm.com> - 2016-04-22 15:40 +0200
[PATCH v4 2/5] arm64: Allow a capability to be checked on a single CPU Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-04-22 13:30 +0200
Re: [PATCH v4 2/5] arm64: Allow a capability to be checked on a single CPU Catalin Marinas <catalin.marinas@arm.com> - 2016-04-22 15:40 +0200
csiph-web