Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1604591 > unrolled thread
| Started by | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| First post | 2017-03-20 15:00 +0100 |
| Last post | 2017-03-20 15:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 03/17] arm64: Allow checking of a CPU-local erratum Mark Rutland <mark.rutland@arm.com> - 2017-03-20 15:00 +0100
Re: [PATCH 03/17] arm64: Allow checking of a CPU-local erratum Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2017-03-20 15:30 +0100
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Date | 2017-03-20 15:00 +0100 |
| Subject | Re: [PATCH 03/17] arm64: Allow checking of a CPU-local erratum |
| Message-ID | <tn60O-5sH-19@gated-at.bofh.it> |
On Mon, Mar 06, 2017 at 11:26:08AM +0000, Marc Zyngier wrote:
> this_cpu_has_cap() only checks the feature array, and not the errata
> one. In order to be able to check for a CPU-local erratum, allow it
> to inspect the latter as well.
>
> This is consistent with cpus_have_cap()'s behaviour, which includes
> errata already.
>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
This sounds sensible to me.
Suzuki, any comments?
Thanks,
Mark.
> ---
> arch/arm64/kernel/cpufeature.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index abda8e861865..6eb77ae99b79 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -1090,20 +1090,29 @@ static void __init setup_feature_capabilities(void)
> * 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)
> +static bool __this_cpu_has_cap(const struct arm64_cpu_capabilities *cap_array,
> + unsigned int cap)
> {
> const struct arm64_cpu_capabilities *caps;
>
> if (WARN_ON(preemptible()))
> return false;
>
> - for (caps = arm64_features; caps->desc; caps++)
> + for (caps = cap_array; caps->desc; caps++)
> if (caps->capability == cap && caps->matches)
> return caps->matches(caps, SCOPE_LOCAL_CPU);
>
> return false;
> }
>
> +extern const struct arm64_cpu_capabilities arm64_errata[];
> +
> +bool this_cpu_has_cap(unsigned int cap)
> +{
> + return (__this_cpu_has_cap(arm64_features, cap) ||
> + __this_cpu_has_cap(arm64_errata, cap));
> +}
> +
> void __init setup_cpu_features(void)
> {
> u32 cwg;
> --
> 2.11.0
>
[toc] | [next] | [standalone]
| From | Suzuki K Poulose <Suzuki.Poulose@arm.com> |
|---|---|
| Date | 2017-03-20 15:30 +0100 |
| Message-ID | <tn6tP-5Wi-19@gated-at.bofh.it> |
| In reply to | #1604591 |
On 20/03/17 13:56, Mark Rutland wrote:
> On Mon, Mar 06, 2017 at 11:26:08AM +0000, Marc Zyngier wrote:
>> this_cpu_has_cap() only checks the feature array, and not the errata
>> one. In order to be able to check for a CPU-local erratum, allow it
>> to inspect the latter as well.
>>
>> This is consistent with cpus_have_cap()'s behaviour, which includes
>> errata already.
>>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>
> This sounds sensible to me.
>
> Suzuki, any comments?
Yes, this looks fine to me.
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>
> Thanks,
> Mark.
>
>> ---
>> arch/arm64/kernel/cpufeature.c | 13 +++++++++++--
>> 1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
>> index abda8e861865..6eb77ae99b79 100644
>> --- a/arch/arm64/kernel/cpufeature.c
>> +++ b/arch/arm64/kernel/cpufeature.c
>> @@ -1090,20 +1090,29 @@ static void __init setup_feature_capabilities(void)
>> * 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)
>> +static bool __this_cpu_has_cap(const struct arm64_cpu_capabilities *cap_array,
>> + unsigned int cap)
>> {
>> const struct arm64_cpu_capabilities *caps;
>>
>> if (WARN_ON(preemptible()))
>> return false;
>>
>> - for (caps = arm64_features; caps->desc; caps++)
>> + for (caps = cap_array; caps->desc; caps++)
>> if (caps->capability == cap && caps->matches)
>> return caps->matches(caps, SCOPE_LOCAL_CPU);
>>
>> return false;
>> }
>>
>> +extern const struct arm64_cpu_capabilities arm64_errata[];
>> +
>> +bool this_cpu_has_cap(unsigned int cap)
>> +{
>> + return (__this_cpu_has_cap(arm64_features, cap) ||
>> + __this_cpu_has_cap(arm64_errata, cap));
>> +}
>> +
>> void __init setup_cpu_features(void)
>> {
>> u32 cwg;
>> --
>> 2.11.0
>>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web