Remove POWER10_CPU dependency and move PPC_MODULE_FEATURE_P10.
Subsystems (3)
PATCH 1/1 Remove POWER10_CPU dependency and move PPC_MODULE_FEATURE_P10.
Remove Power10 dependency in Kconfig and detect Power10 feature at runtime. Move PPC_MODULE_FEATURE_P10 definition to be in arch/powerpc/include/asm/cpufeature.h.
--- arch/powerpc/crypto/Kconfig | 2 +- arch/powerpc/crypto/aes-gcm-p10-glue.c | 1 - arch/powerpc/include/asm/cpufeature.h | 1 + 3 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/crypto/Kconfig +1 -1
@@ -96,7 +96,7 @@ config CRYPTO_AES_PPC_SPE config CRYPTO_AES_GCM_P10 tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)" - depends on PPC64 && POWER10_CPU && CPU_LITTLE_ENDIAN + depends on PPC64 && CPU_LITTLE_ENDIAN select CRYPTO_LIB_AES select CRYPTO_ALGAPI select CRYPTO_AEAD
arch/powerpc/crypto/aes-gcm-p10-glue.c +0 -1
@@ -22,7 +22,6 @@#include <linux/module.h> #include <linux/types.h> -#define PPC_MODULE_FEATURE_P10 (32 + ilog2(PPC_FEATURE2_ARCH_3_1))#define PPC_ALIGN 16#define GCM_IV_SIZE 12
arch/powerpc/include/asm/cpufeature.h +1 -0
@@ -22,6 +22,7 @@*/ #define PPC_MODULE_FEATURE_VEC_CRYPTO (32 + ilog2(PPC_FEATURE2_VEC_CRYPTO)) +#define PPC_MODULE_FEATURE_P10 (32 + ilog2(PPC_FEATURE2_ARCH_3_1))#define cpu_feature (x) (x)
Signature · 1 line
2.31.1
Michael Ellerman
reviewerQuoted 3 lines · Danny Tsen
Remove Power10 dependency in
Kconfigand detect Power10 feature at runtime. MovePPC_MODULE_FEATURE_P10definition to be inarch/powerpc/include/asm/cpufeature.h.
This should be two patches, one for the Kconfig change and one moving the feature flag.
Also don't you need a cpu feature check in p10_init()? Otherwise the driver can be loaded on non-P10 CPUs, either by being built-in, or manually.
cheers
Quoted 46 lines
Signed-off-by Danny Tsen <[email protected]>--- arch/powerpc/crypto/Kconfig | 2 +- arch/powerpc/crypto/aes-gcm-p10-glue.c | 1 - arch/powerpc/include/asm/cpufeature.h | 1 + 3 files changed, 2 insertions(+), 2 deletions(-)arch/powerpc/crypto/Kconfig +1
-1@@ -96,7 +96,7 @@ config CRYPTO_AES_PPC_SPE config CRYPTO_AES_GCM_P10 tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)" - depends on PPC64 && POWER10_CPU && CPU_LITTLE_ENDIAN + depends on PPC64 && CPU_LITTLE_ENDIAN select CRYPTO_LIB_AES select CRYPTO_ALGAPI select CRYPTO_AEADarch/powerpc/crypto/aes-gcm-p10-glue.c +0
-1@@ -22,7 +22,6 @@#include <linux/module.h> #include <linux/types.h> -#define PPC_MODULE_FEATURE_P10 (32 + ilog2(PPC_FEATURE2_ARCH_3_1))#define PPC_ALIGN 16#define GCM_IV_SIZE 12arch/powerpc/include/asm/cpufeature.h +1
-0@@ -22,6 +22,7 @@*/ #define PPC_MODULE_FEATURE_VEC_CRYPTO (32 + ilog2(PPC_FEATURE2_VEC_CRYPTO)) +#define PPC_MODULE_FEATURE_P10 (32 + ilog2(PPC_FEATURE2_ARCH_3_1))#define cpu_feature (x) (x)Signature · 1 line
2.31.1
Hi Michael,
If I do separate patch for moving PPC_MODULE_FEATURE_P10, this will break the build since it is currently defined in aes-gcm-p10-glue.c. And the p10 will be detected when loading the module in module_cpu_feature_match(PPC_MODULE_FEATURE_P10, p10_init); so it won't load if it's not P10.
Thanks.
-Danny
Quoted 59 lines · Michael Ellerman
Quoted 3 lines · Danny Tsen
Remove Power10 dependency in
Kconfigand detect Power10 feature at runtime. MovePPC_MODULE_FEATURE_P10definition to be inarch/powerpc/include/asm/cpufeature.h.This should be two patches, one for the
Kconfigchange and one moving the feature flag.Also don't you need a cpu feature check in
p10_init()? Otherwise the driver can be loaded on non-P10 CPUs, either by being built-in, or manually.cheers
Quoted 46 lines
Signed-off-by Danny Tsen <[email protected]>--- arch/powerpc/crypto/Kconfig | 2 +- arch/powerpc/crypto/aes-gcm-p10-glue.c | 1 - arch/powerpc/include/asm/cpufeature.h | 1 + 3 files changed, 2 insertions(+), 2 deletions(-)arch/powerpc/crypto/Kconfig +1
-1@@ -96,7 +96,7 @@ config CRYPTO_AES_PPC_SPE config CRYPTO_AES_GCM_P10 tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)" - depends on PPC64 && POWER10_CPU && CPU_LITTLE_ENDIAN + depends on PPC64 && CPU_LITTLE_ENDIAN select CRYPTO_LIB_AES select CRYPTO_ALGAPI select CRYPTO_AEADarch/powerpc/crypto/aes-gcm-p10-glue.c +0
-1@@ -22,7 +22,6 @@#include <linux/module.h> #include <linux/types.h> -#define PPC_MODULE_FEATURE_P10 (32 + ilog2(PPC_FEATURE2_ARCH_3_1))#define PPC_ALIGN 16#define GCM_IV_SIZE 12arch/powerpc/include/asm/cpufeature.h +1
-0@@ -22,6 +22,7 @@*/ #define PPC_MODULE_FEATURE_VEC_CRYPTO (32 + ilog2(PPC_FEATURE2_VEC_CRYPTO)) +#define PPC_MODULE_FEATURE_P10 (32 + ilog2(PPC_FEATURE2_ARCH_3_1))#define cpu_feature (x) (x)Signature · 1 line
2.31.1
Quoted 15 lines · Danny Tsen
Hi Michael,
If I do separate patch for moving
PPC_MODULE_FEATURE_P10, this will break the build since it is currently defined in aes-gcm-p10-glue.c. And the p10 will be detected when loading the module inmodule_cpu_feature_match(PPC_MODULE_FEATURE_P10, p10_init); so it won't load if it's not P10.Thanks.
-Danny
Quoted 6 lines · Michael Ellerman
Quoted 3 lines · Danny Tsen
Remove Power10 dependency in
Kconfigand detect Power10 feature at runtime. MovePPC_MODULE_FEATURE_P10definition to be inarch/powerpc/include/asm/cpufeature.h.This should be two patches, one for the
Kconfigchange and one moving the feature flag.
I think I misunderstood. I can do two patches one for Kconfig change and one moving the feature flag. I'll fix it.
Thanks.
-Danny
Quoted 48 lines
Quoted 48 lines
Also don't you need a cpu feature check in
p10_init()? Otherwise the driver can be loaded on non-P10 CPUs, either by being built-in, or manually.cheers
Quoted 41 lines
Signed-off-by Danny Tsen <[email protected]>---
arch/powerpc/crypto/Kconfig | 2 +-
arch/powerpc/crypto/aes-gcm-p10-glue.c| 1 -
arch/powerpc/include/asm/cpufeature.h | 1 +3 files changed, 2 insertions(+), 2 deletions(-)arch/powerpc/crypto/Kconfig +0
-0@@ -96,7 +96,7 @@ config CRYPTO_AES_PPC_SPEconfig
CRYPTO_AES_GCM_P10
tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)" - depends on PPC64 &&POWER10_CPU&&CPU_LITTLE_ENDIAN
+ depends on PPC64 &&CPU_LITTLE_ENDIAN
selectCRYPTO_LIB_AES
selectCRYPTO_ALGAPI
selectCRYPTO_AEADarch/powerpc/crypto/aes-gcm-p10-glue.c +0
-0@@ -22,7 +22,6 @@ #include <linux/module.h> #include <linux/types.h> -#define PPC_MODULE_FEATURE_P10 (32 + ilog2(PPC_FEATURE2_ARCH_3_1)) #define PPC_ALIGN 16 #define GCM_IV_SIZE 12diff --git
a/arch/powerpc/include/asm/cpufeature.hb/arch/powerpc/include/asm/cpufeature.hindexf6f790a90367..2dcc66225e7f100644arch/powerpc/include/asm/cpufeature.h +1
-0@@ -22,6 +22,7 @@*/ #define PPC_MODULE_FEATURE_VEC_CRYPTO (32 + ilog2(PPC_FEATURE2_VEC_CRYPTO)) +#define PPC_MODULE_FEATURE_P10 (32 + ilog2(PPC_FEATURE2_ARCH_3_1)) #define cpu_feature(x) (x)--
2.31.1