From 2ef11a540ff692e1ea97e7af81644b0993863c1d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 2 Aug 2021 13:48:24 +0200 Subject: [PATCH] 4.19-stable patches added patches: powerpc-pseries-fix-regression-while-building-external-modules.patch revert-perf-map-fix-dso-nsinfo-refcounting.patch --- ...sion-while-building-external-modules.patch | 77 +++++++++++++++++++ ...-perf-map-fix-dso-nsinfo-refcounting.patch | 39 ++++++++++ queue-4.19/series | 2 + 3 files changed, 118 insertions(+) create mode 100644 queue-4.19/powerpc-pseries-fix-regression-while-building-external-modules.patch create mode 100644 queue-4.19/revert-perf-map-fix-dso-nsinfo-refcounting.patch diff --git a/queue-4.19/powerpc-pseries-fix-regression-while-building-external-modules.patch b/queue-4.19/powerpc-pseries-fix-regression-while-building-external-modules.patch new file mode 100644 index 00000000000..88ce1d80f24 --- /dev/null +++ b/queue-4.19/powerpc-pseries-fix-regression-while-building-external-modules.patch @@ -0,0 +1,77 @@ +From 333cf507465fbebb3727f5b53e77538467df312a Mon Sep 17 00:00:00 2001 +From: Srikar Dronamraju +Date: Thu, 29 Jul 2021 11:34:49 +0530 +Subject: powerpc/pseries: Fix regression while building external modules + +From: Srikar Dronamraju + +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 + 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 +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20210729060449.292780-1-srikar@linux.vnet.ibm.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/platforms/pseries/setup.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/powerpc/platforms/pseries/setup.c ++++ b/arch/powerpc/platforms/pseries/setup.c +@@ -76,7 +76,7 @@ + #include "../../../../drivers/pci/pci.h" + + DEFINE_STATIC_KEY_FALSE(shared_processor); +-EXPORT_SYMBOL_GPL(shared_processor); ++EXPORT_SYMBOL(shared_processor); + + int CMO_PrPSP = -1; + int CMO_SecPSP = -1; diff --git a/queue-4.19/revert-perf-map-fix-dso-nsinfo-refcounting.patch b/queue-4.19/revert-perf-map-fix-dso-nsinfo-refcounting.patch new file mode 100644 index 00000000000..3d6d1502052 --- /dev/null +++ b/queue-4.19/revert-perf-map-fix-dso-nsinfo-refcounting.patch @@ -0,0 +1,39 @@ +From 9bac1bd6e6d36459087a728a968e79e37ebcea1a Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Fri, 30 Jul 2021 18:26:22 -0300 +Subject: Revert "perf map: Fix dso->nsinfo refcounting" + +From: Arnaldo Carvalho de Melo + +commit 9bac1bd6e6d36459087a728a968e79e37ebcea1a upstream. + +This makes 'perf top' abort in some cases, and the right fix will +involve surgery that is too much to do at this stage, so revert for now +and fix it in the next merge window. + +This reverts commit 2d6b74baa7147251c30a46c4996e8cc224aa2dc5. + +Cc: Riccardo Mancini +Cc: Ian Rogers +Cc: Jiri Olsa +Cc: Krister Johansen +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Peter Zijlstra +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/map.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/tools/perf/util/map.c ++++ b/tools/perf/util/map.c +@@ -209,8 +209,6 @@ struct map *map__new(struct machine *mac + if (!(prot & PROT_EXEC)) + dso__set_loaded(dso); + } +- +- nsinfo__put(dso->nsinfo); + dso->nsinfo = nsi; + dso__put(dso); + } diff --git a/queue-4.19/series b/queue-4.19/series index 36e8936d735..8cc202ec9e2 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -25,3 +25,5 @@ sctp-fix-return-value-check-in-__sctp_rcv_asconf_loo.patch tulip-windbond-840-fix-missing-pci_disable_device-in.patch sis900-fix-missing-pci_disable_device-in-probe-and-r.patch can-hi311x-fix-a-signedness-bug-in-hi3110_cmd.patch +powerpc-pseries-fix-regression-while-building-external-modules.patch +revert-perf-map-fix-dso-nsinfo-refcounting.patch -- 2.47.3