From: Robin Murphy <robin.murphy@arm.com>
To: Dave Martin <Dave.Martin@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
catalin.marinas@arm.com, will.deacon@arm.com,
linux-kernel@vger.kernel.org,
Andre Przywara <andre.przywara@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: Run enable method for errata work arounds on late CPUs
Date: Wed, 17 Jan 2018 13:20:42 +0000 [thread overview]
Message-ID: <29147833-b47f-3ad9-e2d8-295551c43900@arm.com> (raw)
In-Reply-To: <20180117122548.GE22781@e103592.cambridge.arm.com>
On 17/01/18 12:25, Dave Martin wrote:
> On Wed, Jan 17, 2018 at 10:05:56AM +0000, Suzuki K Poulose wrote:
>> When a CPU is brought up after we have finalised the system
>> wide capabilities (i.e, features and errata), we make sure the
>> new CPU doesn't need a new errata work around which has not been
>> detected already. However we don't run enable() method on the new
>> CPU for the errata work arounds already detected. This could
>> cause the new CPU running without potential work arounds.
>> It is upto the "enable()" method to decide if this CPU should
>> do something about the errata.
>>
>> Fixes: commit 6a6efbb45b7d95c84 ("arm64: Verify CPU errata work arounds on hotplugged CPU")
>> Cc: Will Deacon <will.deacon@arm.com>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: Andre Przywara <andre.przywara@arm.com>
>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: Dave Martin <dave.martin@arm.com>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> ---
>> arch/arm64/kernel/cpu_errata.c | 9 ++++++---
>> 1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
>> index 90a9e465339c..54e41dfe41f6 100644
>> --- a/arch/arm64/kernel/cpu_errata.c
>> +++ b/arch/arm64/kernel/cpu_errata.c
>> @@ -373,15 +373,18 @@ void verify_local_cpu_errata_workarounds(void)
>> {
>> const struct arm64_cpu_capabilities *caps = arm64_errata;
>>
>> - for (; caps->matches; caps++)
>> - if (!cpus_have_cap(caps->capability) &&
>> - caps->matches(caps, SCOPE_LOCAL_CPU)) {
>> + for (; caps->matches; caps++) {
>> + if (cpus_have_cap(caps->capability)) {
>> + if (caps->enable)
>> + caps->enable((void *)caps);
>
> Do we really need this cast?
Seems to me like the prototype for .enable needs updating. If any
existing callback was actually using the (non-const) void* for some
purpose (thankfully nothing seems to be), then passing the capability
pointer into that would be unlikely to end well anyway.
We probably want to replace or append that with a proper const struct
arm64_cpu_capabilities* argument, to make it more of a method call.
Robin.
> Can enable() fail, or do we already guarantee that it succeeds (by
> having detected the cap in the first place)?
>
>> + } else if (caps->matches(caps, SCOPE_LOCAL_CPU)) {
>
> [...]
>
> Cheers
> ---Dave
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
next prev parent reply other threads:[~2018-01-17 13:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-17 10:05 Suzuki K Poulose
2018-01-17 12:25 ` Dave Martin
2018-01-17 13:20 ` Robin Murphy [this message]
2018-01-17 13:31 ` Suzuki K Poulose
2018-01-17 13:43 ` Robin Murphy
2018-01-17 14:04 ` Suzuki K Poulose
2018-01-17 13:22 ` Suzuki K Poulose
2018-01-17 14:38 ` Dave Martin
2018-01-17 14:52 ` Suzuki K Poulose
2018-01-17 16:29 ` Dave Martin
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=29147833-b47f-3ad9-e2d8-295551c43900@arm.com \
--to=robin.murphy@arm.com \
--cc=Dave.Martin@arm.com \
--cc=andre.przywara@arm.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--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®