android_kernel_motorola_sm6225/arch
Srikar Dronamraju 91bbeacf5a powerpc/pseries: Fix regression while building external modules
commit 333cf507465fbebb3727f5b53e77538467df312a upstream.

With commit c9f3401313a5 ("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 https://github.com/openzfs/zfs/issues/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: 14c73bd344da ("powerpc/vcpu: Assume dedicated processors as non-preempt")
Cc: stable@vger.kernel.org # v5.5+
Reported-by: marc.c.dionne@gmail.com
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210729060449.292780-1-srikar@linux.vnet.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-04 12:23:47 +02:00
..
alpha
arc ARCv2: save ABI registers across signal handling 2021-06-30 08:48:24 -04:00
arm ARM: dts: versatile: Fix up interrupt controller node names 2021-07-31 08:22:38 +02:00
arm64 arm64: dts: ls208xa: remove bus-num from dspi node 2021-07-28 11:13:43 +02:00
c6x
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-23 15:00:58 +01:00
hexagon hexagon: use common DISCARDS macro 2021-07-20 16:16:13 +02:00
ia64 ia64: mca_drv: fix incorrect array size calculation 2021-07-20 16:15:46 +02:00
m68k
microblaze
mips Revert "MIPS: add PMD table accounting into MIPS'pmd_alloc_one" 2021-07-28 11:13:49 +02:00
nds32 nds32: fix up stack guard gap 2021-07-28 11:13:51 +02:00
nios2
openrisc openrisc: Define memory barrier mb 2021-06-03 08:38:10 +02:00
parisc parisc: avoid a warning on u8 cast for cmpxchg on u8 pointers 2021-04-14 08:22:33 +02:00
powerpc powerpc/pseries: Fix regression while building external modules 2021-08-04 12:23:47 +02:00
riscv riscv: Workaround mcount name prior to clang-13 2021-05-22 10:59:49 +02:00
s390 s390/ftrace: fix ftrace_update_ftrace_func implementation 2021-07-28 11:13:49 +02:00
sh sh: dma: fix kconfig dependency for G2_DMA 2021-01-27 11:05:42 +01:00
sparc sparc64: Fix opcode filtering in handling of no fault loads 2021-03-30 14:36:58 +02:00
um um: fix error return code in winch_tramp() 2021-07-20 16:16:13 +02:00
unicore32
x86 x86/kvm: fix vcpu-id indexed array sizes 2021-08-04 12:23:44 +02:00
xtensa
.gitignore
Kconfig