Message ID | 20220530105946.232371-1-dimitri.ledkov@canonical.com |
---|---|
State | New |
Headers | show |
Series | [SRU,IMPISH,JAMMY,KINETIC] powerpc: Export mmu_feature_keys[] as non-GPL | expand |
Acked-by: Cengiz Can <cengiz.can@canonical.com> On Mon, 2022-05-30 at 11:59 +0100, Dimitri John Ledkov wrote: > From: Kevin Hao <haokexin@gmail.com> > > BugLink: https://bugs.launchpad.net/bugs/1976248 > > 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 > (backported from commit d9e5c3e9e75162f845880535957b7fd0b4637d23 upstream) > Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.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.32.0 > >
On Mon, May 30, 2022 at 11:59:46AM +0100, Dimitri John Ledkov wrote: > From: Kevin Hao <haokexin@gmail.com> > > BugLink: https://bugs.launchpad.net/bugs/1976248 > > 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 > (backported from commit d9e5c3e9e75162f845880535957b7fd0b4637d23 upstream) > Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com>
On 30.05.22 12:59, Dimitri John Ledkov wrote: > From: Kevin Hao <haokexin@gmail.com> > > BugLink: https://bugs.launchpad.net/bugs/1976248 > > 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 > (backported from commit d9e5c3e9e75162f845880535957b7fd0b4637d23 upstream) > Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.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) > { Applied to jammy,impish:linux/master-next. Thanks. -Stefan
On 30.05.22 12:59, Dimitri John Ledkov wrote: > From: Kevin Hao <haokexin@gmail.com> > > BugLink: https://bugs.launchpad.net/bugs/1976248 > > 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 > (backported from commit d9e5c3e9e75162f845880535957b7fd0b4637d23 upstream) > Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com> > --- This was already upstream in v5.19 and so not required to be applied for Kinetic. -Stefan > 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) > {
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) {