Skip to contentSkip to conversation

arm64/cpufeature: Unexport set_cpu_feature()

PATCH Applied Mark Brown 4 participants 6 messages Jun 15, 2022 – Jun 16, 2022 arm64

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 arm64/cpufeature: Unexport set_cpu_feature()

We currently export set_cpu_feature() to modules but there are no in tree users that can be built as modules and it is hard to see cases where it would make sense for there to be any such users. Remove the export to avoid anyone else having to worry about why it is there and ensure that any users that do get added get a bit more visiblity.

---
 arch/arm64/kernel/cpufeature.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm64/kernel/cpufeature.c +0 -1
index 79fac13ab2ef..8d88433de81d 100644
@@ -3101,7 +3101,6 @@ void cpu_set_feature(unsigned int num)
 	WARN_ON(num >= MAX_CPU_FEATURES);
 	elf_hwcap |= BIT(num);
 }
-EXPORT_SYMBOL_GPL(cpu_set_feature);
 
 bool cpu_have_feature(unsigned int num)
 {
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Mark Brown

We currently export set_cpu_feature() to modules but there are no in tree users that can be built as modules and it is hard to see cases where it would make sense for there to be any such users. Remove the export to avoid anyone else having to worry about why it is there and ensure that any users that do get added get a bit more visiblity.

Also, it doesn't sound safe to expose this to the modules anyways.

Quoted 9 lines
---
  arch/arm64/kernel/cpufeature.c | 1 -
  1 file changed, 1 deletion(-)
arch/arm64/kernel/cpufeature.c +0 -0
index 79fac13ab2ef..8d88433de81d 100644

arch/arm64/kernel/cpufeature.c void cpu_set_feature(unsigned int num) · line 3106

Quoted 7 lines
arch/arm64/kernel/cpufeature.c +0 -1
@@ -3101,7 +3101,6 @@ void cpu_set_feature(unsigned int num)
  	WARN_ON(num >= MAX_CPU_FEATURES);
  	elf_hwcap |= BIT(num);
  }
-EXPORT_SYMBOL_GPL(cpu_set_feature);
 
  bool cpu_have_feature(unsigned int num)
  {

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author
#2 lore raw
Quoted 9 lines · Suzuki K Poulose
Quoted 5 lines · Mark Brown

We currently export set_cpu_feature() to modules but there are no in tree users that can be built as modules and it is hard to see cases where it would make sense for there to be any such users. Remove the export to avoid anyone else having to worry about why it is there and ensure that any users that do get added get a bit more visiblity.

Also, it doesn't sound safe to expose this to the modules anyways.

Indeed, when I said worry I really meant it.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

reviewer Reviewed-by on v1 1/1
#3 lore raw
In reply to Mark Brown
Quoted 7 lines · Mark Brown

We currently export set_cpu_feature() to modules but there are no in tree users that can be built as modules and it is hard to see cases where it would make sense for there to be any such users. Remove the export to avoid anyone else having to worry about why it is there and ensure that any users that do get added get a bit more visiblity.

Looking through the git history, the exposed was added in commit:

aec0bff757c93748 ("arm64: HWCAP: encapsulate elf_hwcap")

... but even then there didn't appear to be any in-tree modular user, and the commit message didn't explain why.

Otherwise, this definitely seems like something we shouldn't be exporting, so FWIW:

Mark.

Quoted 24 lines
---
 arch/arm64/kernel/cpufeature.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm64/kernel/cpufeature.c +0 -1
index 79fac13ab2ef..8d88433de81d 100644
@@ -3101,7 +3101,6 @@ void cpu_set_feature(unsigned int num)
 	WARN_ON(num >= MAX_CPU_FEATURES);
 	elf_hwcap |= BIT(num);
 }
-EXPORT_SYMBOL_GPL(cpu_set_feature);
 
 bool cpu_have_feature(unsigned int num)
 {
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author
#4 lore raw
Quoted 6 lines · Mark Rutland

Looking through the git history, the exposed was added in commit:

aec0bff757c93748 ("arm64: HWCAP: encapsulate elf_hwcap")

... but even then there didn't appear to be any in-tree modular user, and the commit message didn't explain why.

Prior to that commit the function was a static inline in the header and the variable it manipulated was exported, presumably for the read side which is more sensible, so it looks like it was just preserving the status quo without really thinking about it.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer Applied
#5 lore raw
In reply to Mark Brown
Quoted 8 lines · Mark Brown

We currently export set_cpu_feature() to modules but there are no in tree users that can be built as modules and it is hard to see cases where it would make sense for there to be any such users. Remove the export to avoid anyone else having to worry about why it is there and ensure that any users that do get added get a bit more visiblity.

[...]

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

[1/1] arm64/cpufeature: Unexport set_cpu_feature()

      https://git.kernel.org/arm64/c/3f77a1d0570e
Signature · 7 lines
Catalin


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel