Skip to content

Commit 333cf50

Browse files
srikardmpe
authored andcommitted
powerpc/pseries: Fix regression while building external modules
With commit c9f3401 ("powerpc: Always enable queued spinlocks for 64s, disable for others") CONFIG_PPC_QUEUED_SPINLOCKS is always enabled on ppc64le, external modules that use spinlock APIs are failing. ERROR: modpost: GPL-incompatible module XXX.ko uses GPL-only symbol 'shared_processor' Before the above commit, modules were able to build without any issues. Also this problem is not seen on other architectures. This problem can be workaround if CONFIG_UNINLINE_SPIN_UNLOCK is enabled in the config. However CONFIG_UNINLINE_SPIN_UNLOCK is not enabled by default and only enabled in certain conditions like CONFIG_DEBUG_SPINLOCKS is set in the kernel config. #include <linux/module.h> spinlock_t spLock; static int __init spinlock_test_init(void) { spin_lock_init(&spLock); spin_lock(&spLock); spin_unlock(&spLock); return 0; } static void __exit spinlock_test_exit(void) { printk("spinlock_test unloaded\n"); } module_init(spinlock_test_init); module_exit(spinlock_test_exit); MODULE_DESCRIPTION ("spinlock_test"); MODULE_LICENSE ("non-GPL"); MODULE_AUTHOR ("Srikar Dronamraju"); Given that spin locks are one of the basic facilities for module code, this effectively makes it impossible to build/load almost any non GPL modules on ppc64le. This was first reported at openzfs/zfs#11172 Currently shared_processor is exported as GPL only symbol. Fix this for parity with other architectures by exposing shared_processor to non-GPL modules too. Fixes: 14c73bd ("powerpc/vcpu: Assume dedicated processors as non-preempt") Cc: [email protected] # v5.5+ Reported-by: [email protected] Signed-off-by: Srikar Dronamraju <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e1ab9a7 commit 333cf50

File tree

1 file changed

+1
-1
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+1
-1
lines changed

arch/powerpc/platforms/pseries/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
#include "../../../../drivers/pci/pci.h"
7878

7979
DEFINE_STATIC_KEY_FALSE(shared_processor);
80-
EXPORT_SYMBOL_GPL(shared_processor);
80+
EXPORT_SYMBOL(shared_processor);
8181

8282
int CMO_PrPSP = -1;
8383
int CMO_SecPSP = -1;

0 commit comments

Comments
 (0)