linux-stable/arch/powerpc/platforms
Srikar Dronamraju 333cf50746 powerpc/pseries: Fix regression while building external modules
With commit c9f3401313 ("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: 14c73bd344 ("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
2021-07-29 22:34:58 +10:00
..
4xx powerpc/4xx: Don't unmap NULL mbase 2020-05-28 23:24:36 +10:00
8xx powerpc: bad_page_fault get registers from regs 2021-02-09 00:02:09 +11:00
40x powerpc: Remove IBM405 Erratum #77 2020-05-28 23:24:36 +10:00
44x powerpc/44x: fix spelling mistake in Kconfig "varients" -> "variants" 2021-04-23 01:38:04 +10:00
52xx powerpc/52xx: Add fallthrough in mpc52xx_wdt_ioctl() 2021-06-15 17:12:05 +10:00
82xx powerpc/82xx/*: Move PHB discovery 2021-02-09 00:02:06 +11:00
83xx powerpc/83xx: Fix build error when CONFIG_PCI=n 2021-02-11 23:28:51 +11:00
85xx powerpc/85xx: Fix declaration made after definition 2020-11-19 14:50:13 +11:00
86xx powerpc: Don't use 'struct ppc_inst' to reference instruction location 2021-06-17 00:09:00 +10:00
512x powerpc/512x: Move PHB discovery 2021-02-09 00:02:05 +11:00
amigaone powerpc/amigaone: Make amigaone_discover_phbs() static 2021-02-11 23:28:51 +11:00
book3s powerpc/vas: Move update_csb/dump_crb to common book3s platform 2021-06-20 21:58:56 +10:00
cell powerpc/preempt: Don't touch the idle task's preempt_count during hotplug 2021-07-08 23:38:10 +10:00
chrp powerpc/chrp: Make hydra_init() static 2021-03-24 14:09:29 +11:00
embedded6xx powerpc updates for 5.14 2021-07-02 12:54:34 -07:00
maple powerpc/pci: fix warning comparing pointer to 0 2021-03-29 13:22:13 +11:00
microwatt powerpc/microwatt: Add support for hardware random number generator 2021-06-21 21:16:32 +10:00
pasemi powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
powermac powerpc/smp: Fix fall-through warning for Clang 2021-07-14 11:10:40 -05:00
powernv powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
ps3 powerpc updates for 5.14 2021-07-02 12:54:34 -07:00
pseries powerpc/pseries: Fix regression while building external modules 2021-07-29 22:34:58 +10:00
fsl_uli1575.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
Kconfig powerpc/64s: Make prom_init require RELOCATABLE 2021-06-25 14:47:19 +10:00
Kconfig.cputype powerpc/mm: enable HAVE_MOVE_PMD support 2021-07-08 11:48:23 -07:00
Makefile powerpc: Add Microwatt platform 2021-06-21 21:15:26 +10:00