[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c6dfb0da-acec-620a-dba6-71aac6efce0b@arm.com>
Date: Thu, 11 May 2017 17:08:19 +0100
From: Marc Zyngier <marc.zyngier@....com>
To: Suzuki K Poulose <Suzuki.Poulose@....com>,
Mark Rutland <mark.rutland@....com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
bigeasy@...utronix.de, catalin.marinas@....com,
peterz@...radead.org, tglx@...utronix.de, will.deacon@....com
Subject: Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path
On 11/05/17 16:54, Suzuki K Poulose wrote:
> On 11/05/17 16:37, Mark Rutland wrote:
>> On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote:
>>> On 11/05/17 16:01, Mark Rutland wrote:
>>>> +static inline bool cpus_have_const_cap(int num)
>>>> +{
>>>> + if (static_branch_likely(&arm64_const_caps_ready))
>>>> + return __cpus_have_const_cap(num);
>>>> + else
>>>> + return cpus_have_cap(num);
>>>
>>> We use cpus_have_const_cap() from hyp code, via has_vhe() and we could potentially
>>> try to access unmapped kernel data from hyp if we fallback to cpus_have_cap().
>>> However, it looks like we have already set arm64_const_caps_ready, so should not
>>> hit it in practise. May be we could add a stricter version of the helper ?
>>>
>>> static inline cpus_have_const_cap_strict(int num)
>>> {
>>> BUG_ON(!static_branch_likely(&arm64_const_caps_ready);
>>> return __cpus_have_const_cap(num);
>>> }
>>
>> Just to check, is that the only user of cpus_have_const_cap() at hyp?
>
> Uh, no we have one more, via system_supports_fpsimd() in __actvate_traps.
Indeed, and I'd definitely expect to see more of that trickling in (if
only to deal with errata).
I'm OK with the BUG_ON version, TBH. It's not pretty, but it will be
perfectly visible if it fires.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
Powered by blists - more mailing lists