linux-stable/arch/powerpc/platforms
Srikar Dronamraju c14cee5bc4 powerpc/pseries: Fix regression while building external modules
commit 333cf50746 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-04 12:46:45 +02:00
..
4xx powerpc/4xx: Don't unmap NULL mbase 2020-05-28 23:24:36 +10:00
8xx powerpc/8xx: Fix early debug when SMC1 is relocated 2020-12-30 11:54:16 +01:00
40x powerpc: Remove IBM405 Erratum #77 2020-05-28 23:24:36 +10:00
44x powerpc: Move flush_instruction_cache() prototype in asm/cacheflush.h 2020-09-02 11:00:21 +10:00
52xx powerpc/52xx: Fix an invalid ASM expression ('addi' used instead of 'add') 2021-05-14 09:50:42 +02:00
82xx powerpc/82xx: Blacklist pq2_restart() for kprobe 2020-06-02 20:59:09 +10:00
83xx powerpc: Use simple i2c probe function 2020-09-02 11:00:20 +10:00
85xx powerpc/smp: Move ppc_md.cpu_die() to smp_ops.cpu_offline_self() 2020-09-18 19:59:43 +10:00
86xx mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
512x powerpc/512x: Use dma_request_chan() instead dma_request_slave_channel() 2020-01-06 16:25:29 +11:00
amigaone powerpc/32: drop unused ISA_DMA_THRESHOLD 2020-04-01 14:30:50 +11:00
cell powerpc/preempt: Don't touch the idle task's preempt_count during hotplug 2021-07-14 16:56:55 +02:00
chrp mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
embedded6xx powerpc: Drop _nmask_and_or_msr() 2020-09-02 11:00:20 +10:00
maple mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
pasemi powerpc: use for_each_child_of_node() macro 2020-07-29 22:30:33 +10:00
powermac powerpc/powermac: Fix low_sleep_handler with CONFIG_VMAP_STACK 2020-12-30 11:53:43 +01:00
powernv powerpc/powernv/vas: Release reference to tgid during window close 2021-07-19 09:44:56 +02:00
ps3 powerpc/ps3: Add dma_mask to ps3_dma_region 2021-07-20 16:05:42 +02:00
pseries powerpc/pseries: Fix regression while building external modules 2021-08-04 12:46:45 +02:00
fsl_uli1575.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
Kconfig powerpc: Remove CONFIG_PPC601_SYNC_FIX 2020-10-08 21:17:13 +11:00
Kconfig.cputype powerpc/powermac: Fix low_sleep_handler with CONFIG_VMAP_STACK 2020-12-30 11:53:43 +01:00
Makefile