android_kernel_motorola_sm6225/arch/powerpc
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
..
boot powerpc/boot: Fixup device-tree on little endian 2021-07-20 16:16:10 +02:00
configs vgacon: remove software scrollback support 2020-09-17 13:45:29 +02:00
crypto powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
include powerpc/ps3: Add dma_mask to ps3_dma_region 2021-07-20 16:16:09 +02:00
kernel powerpc: Offline CPU in stop_this_cpu() 2021-07-20 16:15:57 +02:00
kvm KVM: PPC: Book3S: Fix H_RTAS rets buffer overflow 2021-07-28 11:13:49 +02:00
lib powerpc/64s: Fix crashes when toggling entry flush barrier 2021-05-22 10:59:45 +02:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm powerpc/64s: Fix pte update for kernel memory on radix 2021-05-22 10:59:35 +02:00
net powerpc/bpf: Fix tail call implementation 2019-12-05 09:19:39 +01:00
oprofile treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
perf powerpc/perf: Fix PMU constraint check for EBB events 2021-05-22 10:59:35 +02:00
platforms powerpc/pseries: Fix regression while building external modules 2021-08-04 12:23:47 +02:00
purgatory powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
sysdev powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe() 2021-01-06 14:45:01 +01:00
tools powerpc/tools: Don't quote $objdump in scripts 2020-01-04 19:12:42 +01:00
xmon powerpc/xmon: Change printk() to pr_cont() 2020-12-30 11:26:12 +01:00
Kconfig powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration 2021-05-22 10:59:35 +02:00
Kconfig.debug powerpc: iommu: fix build when neither PCI or IBMVIO is set 2021-05-22 10:59:35 +02:00
Makefile powerpc: Drop -me200 addition to build flags 2020-12-30 11:25:38 +01:00
Makefile.postlink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00