diff mbox series

[v3,1/6] arm64: cpufeature: Allow early detect of specific features

Message ID 1526902515-13769-2-git-send-email-julien.thierry@arm.com
State New
Headers show
Series [v3,1/6] arm64: cpufeature: Allow early detect of specific features | expand

Commit Message

Julien Thierry May 21, 2018, 11:35 a.m. UTC
From: Daniel Thompson <daniel.thompson@linaro.org>


Currently it is not possible to detect features of the boot CPU
until the other CPUs have been brought up.

This prevents us from reacting to features of the boot CPU until
fairly late in the boot process. To solve this we allow a subset
of features (that are likely to be common to all clusters) to be
detected based on the boot CPU alone.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>

[julien.thierry@arm.com: check non-boot cpu missing early features, avoid
			 duplicates between early features and normal
			 features]
Signed-off-by: Julien Thierry <julien.thierry@arm.com>

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/kernel/cpufeature.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
1.9.1

Comments

Suzuki K Poulose May 21, 2018, 11:45 a.m. UTC | #1
On 21/05/18 12:35, Julien Thierry wrote:
> From: Daniel Thompson <daniel.thompson@linaro.org>

> 

> Currently it is not possible to detect features of the boot CPU

> until the other CPUs have been brought up.

> 

> This prevents us from reacting to features of the boot CPU until

> fairly late in the boot process. To solve this we allow a subset

> of features (that are likely to be common to all clusters) to be

> detected based on the boot CPU alone.

> 

> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>

> [julien.thierry@arm.com: check non-boot cpu missing early features, avoid

> 			 duplicates between early features and normal

> 			 features]

> Signed-off-by: Julien Thierry <julien.thierry@arm.com>

> Cc: Catalin Marinas <catalin.marinas@arm.com>

> Cc: Will Deacon <will.deacon@arm.com>

> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>


nit: Since this is completely different from what Daniel started with,
you could simply reset the author to yourself. The boot CPU feature was
added keeping this user in mind.

The patch as such looks good to me.

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>


> ---

>   arch/arm64/kernel/cpufeature.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c

> index 9d1b06d..e03e897 100644

> --- a/arch/arm64/kernel/cpufeature.c

> +++ b/arch/arm64/kernel/cpufeature.c

> @@ -1030,7 +1030,7 @@ static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused)

>   	{

>   		.desc = "GIC system register CPU interface",

>   		.capability = ARM64_HAS_SYSREG_GIC_CPUIF,

> -		.type = ARM64_CPUCAP_SYSTEM_FEATURE,

> +		.type = ARM64_CPUCAP_STRICT_BOOT_CPU_FEATURE,

>   		.matches = has_useable_gicv3_cpuif,

>   		.sys_reg = SYS_ID_AA64PFR0_EL1,

>   		.field_pos = ID_AA64PFR0_GIC_SHIFT,

> --

> 1.9.1

>
Daniel Thompson May 21, 2018, 12:06 p.m. UTC | #2
On Mon, May 21, 2018 at 12:45:22PM +0100, Suzuki K Poulose wrote:
> On 21/05/18 12:35, Julien Thierry wrote:

> > From: Daniel Thompson <daniel.thompson@linaro.org>

> > 

> > Currently it is not possible to detect features of the boot CPU

> > until the other CPUs have been brought up.

> > 

> > This prevents us from reacting to features of the boot CPU until

> > fairly late in the boot process. To solve this we allow a subset

> > of features (that are likely to be common to all clusters) to be

> > detected based on the boot CPU alone.

> > 

> > Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>

> > [julien.thierry@arm.com: check non-boot cpu missing early features, avoid

> > 			 duplicates between early features and normal

> > 			 features]

> > Signed-off-by: Julien Thierry <julien.thierry@arm.com>

> > Cc: Catalin Marinas <catalin.marinas@arm.com>

> > Cc: Will Deacon <will.deacon@arm.com>

> > Cc: Suzuki K Poulose <suzuki.poulose@arm.com>

> 

> nit: Since this is completely different from what Daniel started with,

> you could simply reset the author to yourself. The boot CPU feature was

> added keeping this user in mind.


Agree! It's no longer my patch.

If you want to retain any credit than Suggested-by: would make quite
sufficient.


Daniel.


> 

> The patch as such looks good to me.

> 

> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>

> 

> > ---

> >   arch/arm64/kernel/cpufeature.c | 2 +-

> >   1 file changed, 1 insertion(+), 1 deletion(-)

> > 

> > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c

> > index 9d1b06d..e03e897 100644

> > --- a/arch/arm64/kernel/cpufeature.c

> > +++ b/arch/arm64/kernel/cpufeature.c

> > @@ -1030,7 +1030,7 @@ static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused)

> >   	{

> >   		.desc = "GIC system register CPU interface",

> >   		.capability = ARM64_HAS_SYSREG_GIC_CPUIF,

> > -		.type = ARM64_CPUCAP_SYSTEM_FEATURE,

> > +		.type = ARM64_CPUCAP_STRICT_BOOT_CPU_FEATURE,

> >   		.matches = has_useable_gicv3_cpuif,

> >   		.sys_reg = SYS_ID_AA64PFR0_EL1,

> >   		.field_pos = ID_AA64PFR0_GIC_SHIFT,

> > --

> > 1.9.1

> > 

>
Julien Thierry May 21, 2018, 12:10 p.m. UTC | #3
On 21/05/18 13:06, Daniel Thompson wrote:
> On Mon, May 21, 2018 at 12:45:22PM +0100, Suzuki K Poulose wrote:

>> On 21/05/18 12:35, Julien Thierry wrote:

>>> From: Daniel Thompson <daniel.thompson@linaro.org>

>>>

>>> Currently it is not possible to detect features of the boot CPU

>>> until the other CPUs have been brought up.

>>>

>>> This prevents us from reacting to features of the boot CPU until

>>> fairly late in the boot process. To solve this we allow a subset

>>> of features (that are likely to be common to all clusters) to be

>>> detected based on the boot CPU alone.

>>>

>>> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>

>>> [julien.thierry@arm.com: check non-boot cpu missing early features, avoid

>>> 			 duplicates between early features and normal

>>> 			 features]

>>> Signed-off-by: Julien Thierry <julien.thierry@arm.com>

>>> Cc: Catalin Marinas <catalin.marinas@arm.com>

>>> Cc: Will Deacon <will.deacon@arm.com>

>>> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>

>>

>> nit: Since this is completely different from what Daniel started with,

>> you could simply reset the author to yourself. The boot CPU feature was

>> added keeping this user in mind.

> 

> Agree! It's no longer my patch.

> 

> If you want to retain any credit than Suggested-by: would make quite

> sufficient.

> 


Good point, I didn't think of that.

I'll change this after I get other reviews for this version.

Thanks,

> 

>>

>> The patch as such looks good to me.

>>

>> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>

>>

>>> ---

>>>    arch/arm64/kernel/cpufeature.c | 2 +-

>>>    1 file changed, 1 insertion(+), 1 deletion(-)

>>>

>>> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c

>>> index 9d1b06d..e03e897 100644

>>> --- a/arch/arm64/kernel/cpufeature.c

>>> +++ b/arch/arm64/kernel/cpufeature.c

>>> @@ -1030,7 +1030,7 @@ static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused)

>>>    	{

>>>    		.desc = "GIC system register CPU interface",

>>>    		.capability = ARM64_HAS_SYSREG_GIC_CPUIF,

>>> -		.type = ARM64_CPUCAP_SYSTEM_FEATURE,

>>> +		.type = ARM64_CPUCAP_STRICT_BOOT_CPU_FEATURE,

>>>    		.matches = has_useable_gicv3_cpuif,

>>>    		.sys_reg = SYS_ID_AA64PFR0_EL1,

>>>    		.field_pos = ID_AA64PFR0_GIC_SHIFT,

>>> --

>>> 1.9.1

>>>

>>


-- 
Julien Thierry
diff mbox series

Patch

diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 9d1b06d..e03e897 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1030,7 +1030,7 @@  static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused)
 	{
 		.desc = "GIC system register CPU interface",
 		.capability = ARM64_HAS_SYSREG_GIC_CPUIF,
-		.type = ARM64_CPUCAP_SYSTEM_FEATURE,
+		.type = ARM64_CPUCAP_STRICT_BOOT_CPU_FEATURE,
 		.matches = has_useable_gicv3_cpuif,
 		.sys_reg = SYS_ID_AA64PFR0_EL1,
 		.field_pos = ID_AA64PFR0_GIC_SHIFT,