Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1639857

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

From Marc Zyngier <marc.zyngier@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path
Date 2017-05-11 18:20 +0200
Message-ID <tFYYO-ax-23@gated-at.bofh.it> (permalink)
References <tFXT4-7X6-47@gated-at.bofh.it> <tFY2M-81A-67@gated-at.bofh.it> <tFYm6-88r-21@gated-at.bofh.it> <tFYFt-8gi-33@gated-at.bofh.it>
Organization ARM Ltd

Show all headers | View raw


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...

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv2] arm64/cpufeature: don't use mutex in bringup path Mark Rutland <mark.rutland@arm.com> - 2017-05-11 17:10 +0200
  Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2017-05-11 17:20 +0200
    Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path Mark Rutland <mark.rutland@arm.com> - 2017-05-11 17:40 +0200
      Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path Mark Rutland <mark.rutland@arm.com> - 2017-05-11 17:50 +0200
      Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2017-05-11 18:00 +0200
        Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path Marc Zyngier <marc.zyngier@arm.com> - 2017-05-11 18:20 +0200
          Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path Mark Rutland <mark.rutland@arm.com> - 2017-05-11 20:00 +0200

csiph-web