Bug 1966245

Summary: CONFIG_PPC_QUEUED_SPINLOCKS breaks non GPL kernel module builds on ppc64le
Product: [Fedora] Fedora Reporter: Marc Dionne <marc.c.dionne>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 34CC: acaringi, adscvr, airlied, alciregi, bskeggs, hdegoede, jarodwilson, jeremy, jforbes, jglisse, jonathan, josef, kernel-maint, lgoncalv, linville, masami256, mchehab, ptalbert, steved
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: kernel-5.13.8-200.fc34 kernel-5.13.8-100.fc33 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-09 00:59:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marc Dionne 2021-05-31 17:55:33 UTC
1. Please describe the problem:

5.12 kernels on ppc64le now have CONFIG_PPC_QUEUED_SPINLOCKS enabled.  When building external modules that are not GPL, any use of spin locks ends up referencing "shared_processor", which is exported as GPL only.

This causes builds to fail with an error like:

ERROR: modpost: GPL-incompatible module XXX.ko uses GPL-only symbol 'shared_processor'

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 module on Fedora ppc64le.

2. What is the Version-Release number of the kernel:

kernel-5.12.7-300.fc34.ppc64le, and corresponding kernel-devel.

3. Did it work previously in Fedora? If so, what kernel version did the issue
   *first* appear?  Old kernels are available for download at
   https://koji.fedoraproject.org/koji/packageinfo?packageID=8 :

Yes.  The option was first enabled in 5.12 kernels.  There was no issue using spin locks from non GPL module code in Fedora packaged 5.11 kernels.

4. Can you reproduce this issue? If so, please provide the steps to reproduce
   the issue below:

This can be reproduced by building a non GPL module with a 5.12 kernel.

One example is this issue for zfs on Linux: https://github.com/openzfs/zfs/issues/11172

5. Does this problem occur with the latest Rawhide kernel? To install the
   Rawhide kernel, run ``sudo dnf install fedora-repos-rawhide`` followed by
   ``sudo dnf update --enablerepo=rawhide kernel``:

Not tested, but I don't see that this option has a different value there.

6. Are you running any modules that not shipped with directly Fedora's kernel?:

Not material to this problem, as the problem occurs while building the external modules, regardless of whether one is loaded or not.

7. Please attach the kernel logs. You can get the complete kernel log
   for a boot with ``journalctl --no-hostname -k > dmesg.txt``. If the
   issue occurred on a previous boot, use the journalctl ``-b`` flag.

Comment 1 Justin M. Forbes 2021-05-31 19:02:39 UTC
This is certainly going to be an issue to take up with upstream, there is nothing specific to Fedora's packaging in this regard. It cannot be simply turned off anymore, with 5.12 it is hidden behind CONFIG_EXPERT. Upstream expects it to be on. I did actually experiment with flipping expert and trying to sync up our configs with those options just last week. It exposed roughly 200 new config options that aren't able to be set without expert enabled, and left us with over 1000 places that the config had changed unexpectedly, meaning to fix all of that would be hours of work that no one in particularly interested in doing.

https://lore.kernel.org/linuxppc-dev/20210118123451.1452206-1-npiggin@gmail.com/ is the change that forced it on.

Comment 2 IBM Bug Proxy 2021-07-29 06:10:41 UTC
------- Comment From srikar.dronamraju.com 2021-07-29 02:08 EDT-------
Posted a patch which reads "Subject: [PATCH] powerpc/pseries: Fix regression while building external modules"

https://lore.kernel.org/linuxppc-dev/20210729060449.292780-1-srikar@linux.vnet.ibm.com/t/#u

Comment 3 IBM Bug Proxy 2021-08-02 04:50:24 UTC
------- Comment From srikar.dronamraju.com 2021-08-02 00:45 EDT-------
(In reply to comment #5)
> Posted a patch which reads "Subject: [PATCH] powerpc/pseries: Fix regression
> while building external modules"
>
> https://lore.kernel.org/linuxppc-dev/20210729060449.292780-1-srikar@linux.
> vnet.ibm.com/t/#u

Now this patch has been accepted in the mainline kernel.
Upstream commit is
https://git.kernel.org/powerpc/c/333cf507465fbebb3727f5b53e77538467df312a

Comment 4 Justin M. Forbes 2021-08-02 12:31:28 UTC
This patch has been pulled into the 5.13 series for stable Fedora releases and will appear in updates starting with 5.13.8.  Thank you.

Comment 5 Fedora Update System 2021-08-05 12:01:51 UTC
FEDORA-2021-4d4d3866ca has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-4d4d3866ca

Comment 6 Fedora Update System 2021-08-05 12:01:53 UTC
FEDORA-2021-54ee631709 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-54ee631709

Comment 7 Marc Dionne 2021-08-05 17:31:02 UTC
Thanks all, I verified that our external module builds and works fine with kernel-5.13.8-200.fc34.ppc64le

Marc

Comment 8 Fedora Update System 2021-08-07 01:35:17 UTC
FEDORA-2021-54ee631709 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-54ee631709`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-54ee631709

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2021-08-07 14:10:49 UTC
FEDORA-2021-4d4d3866ca has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-4d4d3866ca`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-4d4d3866ca

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2021-08-09 00:59:51 UTC
FEDORA-2021-4d4d3866ca has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2021-08-10 01:05:57 UTC
FEDORA-2021-54ee631709 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.