Commit eac8e15e authored by omni's avatar omni Committed by Natanael Copa
Browse files

main/linux-lts: backport export mmu_feature_keys as non-GPL

This is needed for ZFS 2.1.5 on PowerPC, background:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009242
parent 4bf5dd70
...@@ -7,7 +7,7 @@ case $pkgver in ...@@ -7,7 +7,7 @@ case $pkgver in
*.*.*) _kernver=${pkgver%.*};; *.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;; *.*) _kernver=$pkgver;;
esac esac
pkgrel=0 pkgrel=1
pkgdesc="Linux lts kernel" pkgdesc="Linux lts kernel"
url="https://www.kernel.org" url="https://www.kernel.org"
depends="initramfs-generator" depends="initramfs-generator"
...@@ -20,6 +20,7 @@ install= ...@@ -20,6 +20,7 @@ install=
source="https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$_kernver.tar.xz source="https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$_kernver.tar.xz
0001-powerpc-config-defang-gcc-check-for-stack-protector-.patch 0001-powerpc-config-defang-gcc-check-for-stack-protector-.patch
vmlinux-zstd.patch vmlinux-zstd.patch
ppc-export_mmu_feature_keys_as_non-GPL.patch
lts.aarch64.config lts.aarch64.config
lts.armv7.config lts.armv7.config
...@@ -305,4 +306,5 @@ a6021519a9c71ae86199b87f458f3814d67c03cc005301d48d4a9f44280627fad4a70138ee4e0c42 ...@@ -305,4 +306,5 @@ a6021519a9c71ae86199b87f458f3814d67c03cc005301d48d4a9f44280627fad4a70138ee4e0c42
c0ddfee06f958192653d840ca14fd60d5d3d88311b1335d691fc4d4c5a7575c5771351a0ec5e3d34544c76c34e4ee8731cc45fa18da77909924f0b9b6ef75d87 virt.x86.config c0ddfee06f958192653d840ca14fd60d5d3d88311b1335d691fc4d4c5a7575c5771351a0ec5e3d34544c76c34e4ee8731cc45fa18da77909924f0b9b6ef75d87 virt.x86.config
fd5dea1a2ada211e1cf673553a0e2df3af7ffc4ae35b316b0d009145bcddf984cfd98c2b1e91de08c10a3442e32ff470d1285ef5d291068fb319160bb9552cf1 virt.x86_64.config fd5dea1a2ada211e1cf673553a0e2df3af7ffc4ae35b316b0d009145bcddf984cfd98c2b1e91de08c10a3442e32ff470d1285ef5d291068fb319160bb9552cf1 virt.x86_64.config
08ede2bc8363a24a6f843021fee93ebe46d2bc01d2bf732fa140bbd5aa99130f00ea021b2b86a49a021a48368fe4d2e848604c7d86a801d268df83c02a183cab patch-5.15.49.xz 08ede2bc8363a24a6f843021fee93ebe46d2bc01d2bf732fa140bbd5aa99130f00ea021b2b86a49a021a48368fe4d2e848604c7d86a801d268df83c02a183cab patch-5.15.49.xz
bb374cecb32f32f2fe669ed00abbbe35a91ddcda469801a5cc4a4941605aa1768cd872a54906acf77d627ee7addd21b0565f73495a49e34c5bce3865deb4b45a ppc-export_mmu_feature_keys_as_non-GPL.patch
" "
From d9e5c3e9e75162f845880535957b7fd0b4637d23 Mon Sep 17 00:00:00 2001
From: Kevin Hao <haokexin@gmail.com>
Date: Tue, 29 Mar 2022 16:57:09 +0800
Subject: [PATCH] powerpc: Export mmu_feature_keys[] as non-GPL
When the mmu_feature_keys[] was introduced in the commit c12e6f24d413
("powerpc: Add option to use jump label for mmu_has_feature()"),
it is unlikely that it would be used either directly or indirectly in
the out of tree modules. So we exported it as GPL only.
But with the evolution of the codes, especially the PPC_KUAP support, it
may be indirectly referenced by some primitive macro or inline functions
such as get_user() or __copy_from_user_inatomic(), this will make it
impossible to build many non GPL modules (such as ZFS) on ppc
architecture. Fix this by exposing the mmu_feature_keys[] to the non-GPL
modules too.
Fixes: 7613f5a66bec ("powerpc/64s/kuap: Use mmu_has_feature()")
Reported-by: Nathaniel Filardo <nwfilardo@gmail.com>
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220329085709.4132729-1-haokexin@gmail.com
---
arch/powerpc/kernel/cputable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 7bd6546b9fde..f9b3def5b254 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -2119,7 +2119,7 @@ void __init cpu_feature_keys_init(void)
struct static_key_true mmu_feature_keys[NUM_MMU_FTR_KEYS] = {
[0 ... NUM_MMU_FTR_KEYS - 1] = STATIC_KEY_TRUE_INIT
};
-EXPORT_SYMBOL_GPL(mmu_feature_keys);
+EXPORT_SYMBOL(mmu_feature_keys);
void __init mmu_feature_keys_init(void)
{
--
2.36.1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment