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


Groups > linux.kernel > #1242196 > unrolled thread

Re: [PATCH v2 12/22] arm64: Delay cpu feature checks

Started byCatalin Marinas <catalin.marinas@arm.com>
First post2015-10-08 13:10 +0200
Last post2015-10-13 12:20 +0200
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.


Contents

  Re: [PATCH v2 12/22] arm64: Delay cpu feature checks Catalin Marinas <catalin.marinas@arm.com> - 2015-10-08 13:10 +0200
    Re: [PATCH v2 12/22] arm64: Delay cpu feature checks "Suzuki K. Poulose" <Suzuki.Poulose@arm.com> - 2015-10-13 12:20 +0200

#1242196 — Re: [PATCH v2 12/22] arm64: Delay cpu feature checks

FromCatalin Marinas <catalin.marinas@arm.com>
Date2015-10-08 13:10 +0200
SubjectRe: [PATCH v2 12/22] arm64: Delay cpu feature checks
Message-ID<qhhfc-1Eh-9@gated-at.bofh.it>
On Mon, Oct 05, 2015 at 06:02:01PM +0100, Suzuki K. Poulose wrote:
> @@ -647,16 +648,119 @@ void check_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
>  		cpus_set_cap(caps[i].capability);
>  	}
>  
> -	/* second pass allows enable() to consider interacting capabilities */
> -	for (i = 0; caps[i].desc; i++) {
> -		if (cpus_have_cap(caps[i].capability) && caps[i].enable)
> -			caps[i].enable();
> +	/*
> +	 * second pass allows enable() invoked on active each CPU
> +	 * to consider interacting capabilities.
> +	 */

This comment doesn't read properly.

> -void check_local_cpu_features(void)
> +/*
> + * Park the CPU which doesn't have the capability as advertised
> + * by the system.
> + */
> +static void fail_incapable_cpu(char *cap_type,
> +				 const struct arm64_cpu_capabilities *cap)
> +{
> +	/*XXX: Are we really safe to call printk here ? */
> +	pr_crit("FATAL: CPU%d is missing %s : %s \n",
> +			smp_processor_id(), cap_type, cap->desc);

I'm not sure it's safe either, basically we haven't fully brought the
CPU into the system.

> +	asm volatile(
> +			" 1:	wfe \n\t"
> +			"	b 1b\n"
> +		    );
> +}

We could add a wfi as well in the mix.

However, if we have PSCI, we should use it to park the CPUs back into
firmware (via cpu_operations.cpu_die), and only use the above loop if
that fails.

> +/*
> + * Run through the enabled system capabilities and enable() it on this CPU.

s/it/them/

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1245540

From"Suzuki K. Poulose" <Suzuki.Poulose@arm.com>
Date2015-10-13 12:20 +0200
Message-ID<qj4Qz-3vO-27@gated-at.bofh.it>
In reply to#1242196
On 08/10/15 12:08, Catalin Marinas wrote:
> On Mon, Oct 05, 2015 at 06:02:01PM +0100, Suzuki K. Poulose wrote:
>> +	/*
>> +	 * second pass allows enable() invoked on active each CPU
>> +	 * to consider interacting capabilities.
>> +	 */
>
> This comment doesn't read properly.
>

Fixed locally

>> +	/*XXX: Are we really safe to call printk here ? */
>> +	pr_crit("FATAL: CPU%d is missing %s : %s \n",
>> +			smp_processor_id(), cap_type, cap->desc);
>
> I'm not sure it's safe either, basically we haven't fully brought the
> CPU into the system.

Btw, we already print "Booted secondary cpu" from secondary_start_kernel()
before we trigger the notifiers. So I think it should be safe to call it
at the moment.

>
>> +	asm volatile(
>> +			" 1:	wfe \n\t"
>> +			"	b 1b\n"
>> +		    );
>> +}
>
> We could add a wfi as well in the mix.
>
> However, if we have PSCI, we should use it to park the CPUs back into
> firmware (via cpu_operations.cpu_die), and only use the above loop if
> that fails.

Added cpu_die() and falls back to the trap as above.


>
>> +/*
>> + * Run through the enabled system capabilities and enable() it on this CPU.
>
> s/it/them/
>

Fixed.

Thanks
Suzuki

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web