Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] arm64: cpufeature: add POE to cpucap_is_possible()
@ 2024-10-08 14:01 Joey Gouly
  2024-10-14 17:13 ` Will Deacon
  2024-10-16 16:30 ` Catalin Marinas
  0 siblings, 2 replies; 3+ messages in thread
From: Joey Gouly @ 2024-10-08 14:01 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: catalin.marinas, joey.gouly, will

Since de66cb37ab6 ("arm64: Add cpucap_is_possible()"),
alternative_has_cap_unlikely() includes the IS_ENABLED() check.

Add CONFIG_ARM64_POE to cpucap_is_possible() to avoid the explicit check.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
---

Small cosmetic change I noticed when looking at some other patches.

 arch/arm64/include/asm/cpucaps.h    | 2 ++
 arch/arm64/include/asm/cpufeature.h | 3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index a6e5b07b64fd..a08a1212ffbb 100644
--- a/arch/arm64/include/asm/cpucaps.h
+++ b/arch/arm64/include/asm/cpucaps.h
@@ -42,6 +42,8 @@ cpucap_is_possible(const unsigned int cap)
 		return IS_ENABLED(CONFIG_ARM64_BTI);
 	case ARM64_HAS_TLB_RANGE:
 		return IS_ENABLED(CONFIG_ARM64_TLB_RANGE);
+	case ARM64_HAS_S1POE:
+		return IS_ENABLED(CONFIG_ARM64_POE);
 	case ARM64_UNMAP_KERNEL_AT_EL0:
 		return IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0);
 	case ARM64_WORKAROUND_843419:
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
index 3d261cc123c1..4b6bc0bac9b9 100644
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch/arm64/include/asm/cpufeature.h
@@ -834,8 +834,7 @@ static inline bool system_supports_lpa2(void)
 
 static inline bool system_supports_poe(void)
 {
-	return IS_ENABLED(CONFIG_ARM64_POE) &&
-		alternative_has_cap_unlikely(ARM64_HAS_S1POE);
+	return alternative_has_cap_unlikely(ARM64_HAS_S1POE);
 }
 
 int do_emulate_mrs(struct pt_regs *regs, u32 sys_reg, u32 rt);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] arm64: cpufeature: add POE to cpucap_is_possible()
  2024-10-08 14:01 [PATCH v1] arm64: cpufeature: add POE to cpucap_is_possible() Joey Gouly
@ 2024-10-14 17:13 ` Will Deacon
  2024-10-16 16:30 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2024-10-14 17:13 UTC (permalink / raw)
  To: Joey Gouly; +Cc: linux-arm-kernel, catalin.marinas

On Tue, Oct 08, 2024 at 03:01:21PM +0100, Joey Gouly wrote:
> Since de66cb37ab6 ("arm64: Add cpucap_is_possible()"),
> alternative_has_cap_unlikely() includes the IS_ENABLED() check.
> 
> Add CONFIG_ARM64_POE to cpucap_is_possible() to avoid the explicit check.
> 
> Signed-off-by: Joey Gouly <joey.gouly@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> ---
> 
> Small cosmetic change I noticed when looking at some other patches.
> 
>  arch/arm64/include/asm/cpucaps.h    | 2 ++
>  arch/arm64/include/asm/cpufeature.h | 3 +--
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
> index a6e5b07b64fd..a08a1212ffbb 100644
> --- a/arch/arm64/include/asm/cpucaps.h
> +++ b/arch/arm64/include/asm/cpucaps.h
> @@ -42,6 +42,8 @@ cpucap_is_possible(const unsigned int cap)
>  		return IS_ENABLED(CONFIG_ARM64_BTI);
>  	case ARM64_HAS_TLB_RANGE:
>  		return IS_ENABLED(CONFIG_ARM64_TLB_RANGE);
> +	case ARM64_HAS_S1POE:
> +		return IS_ENABLED(CONFIG_ARM64_POE);
>  	case ARM64_UNMAP_KERNEL_AT_EL0:
>  		return IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0);
>  	case ARM64_WORKAROUND_843419:
> diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
> index 3d261cc123c1..4b6bc0bac9b9 100644
> --- a/arch/arm64/include/asm/cpufeature.h
> +++ b/arch/arm64/include/asm/cpufeature.h
> @@ -834,8 +834,7 @@ static inline bool system_supports_lpa2(void)
>  
>  static inline bool system_supports_poe(void)
>  {
> -	return IS_ENABLED(CONFIG_ARM64_POE) &&
> -		alternative_has_cap_unlikely(ARM64_HAS_S1POE);
> +	return alternative_has_cap_unlikely(ARM64_HAS_S1POE);
>  }
>  
>  int do_emulate_mrs(struct pt_regs *regs, u32 sys_reg, u32 rt);
> -- 
> 2.25.1

Acked-by: Will Deacon <will@kernel.org>

Will


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] arm64: cpufeature: add POE to cpucap_is_possible()
  2024-10-08 14:01 [PATCH v1] arm64: cpufeature: add POE to cpucap_is_possible() Joey Gouly
  2024-10-14 17:13 ` Will Deacon
@ 2024-10-16 16:30 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2024-10-16 16:30 UTC (permalink / raw)
  To: linux-arm-kernel, Joey Gouly; +Cc: Will Deacon

On Tue, 08 Oct 2024 15:01:21 +0100, Joey Gouly wrote:
> Since de66cb37ab6 ("arm64: Add cpucap_is_possible()"),
> alternative_has_cap_unlikely() includes the IS_ENABLED() check.
> 
> Add CONFIG_ARM64_POE to cpucap_is_possible() to avoid the explicit check.
> 
> 

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64: cpufeature: add POE to cpucap_is_possible()
      https://git.kernel.org/arm64/c/9c4a25140dee

-- 
Catalin



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-16 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08 14:01 [PATCH v1] arm64: cpufeature: add POE to cpucap_is_possible() Joey Gouly
2024-10-14 17:13 ` Will Deacon
2024-10-16 16:30 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox