powerpc/kup: Mark the kuap/keup function non __init
PATCH 1/1 powerpc/kup: Mark the kuap/keup function non __init
Kernel call these functions on cpu online and hence they should not be marked __init.
Signed-off-by Aneesh Kumar K.V <[email protected]>
--- arch/powerpc/mm/book3s32/mmu.c | 4 ++-- arch/powerpc/mm/book3s64/pkeys.c | 4 ++-- arch/powerpc/mm/init-common.c | 2 +- arch/powerpc/mm/nohash/8xx.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)
arch/powerpc/mm/book3s32/mmu.c +2 -2
@@ -449,7 +449,7 @@ void __init print_system_hash_info(void) }#ifdef CONFIG_PPC_KUEP -void __init setup_kuep (bool disabled) +void setup_kuep (bool disabled) {pr_info ("Activating Kernel Userspace Execution Prevention\n" );
@@ -459,7 +459,7 @@ void __init setup_kuep(bool disabled)#endif #ifdef CONFIG_PPC_KUAP -void __init setup_kuap (bool disabled) +void setup_kuap (bool disabled) {pr_info ("Activating Kernel Userspace Access Protection\n" );
arch/powerpc/mm/book3s64/pkeys.c +2 -2
@@ -251,7 +251,7 @@ void __init pkey_early_init_devtree(void) }#ifdef CONFIG_PPC_KUEP -void __init setup_kuep (bool disabled) +void setup_kuep (bool disabled) {if (disabled)return ;
@@ -277,7 +277,7 @@ void __init setup_kuep(bool disabled)#endif #ifdef CONFIG_PPC_KUAP -void __init setup_kuap (bool disabled) +void setup_kuap (bool disabled) {if (disabled)return ;
arch/powerpc/mm/init-common.c +1 -1
@@ -47,7 +47,7 @@ static int __init parse_nosmap(char *p) }early_param ("nosmap" , parse_nosmap); -void __ref setup_kup (void ) +void setup_kup (void ) {setup_kuep (disable_kuep);setup_kuap (disable_kuap);
arch/powerpc/mm/nohash/8xx.c +2 -2
@@ -245,7 +245,7 @@ void set_context(unsigned long id, pgd_t *pgd) }#ifdef CONFIG_PPC_KUEP -void __init setup_kuep (bool disabled) +void setup_kuep (bool disabled) {if (disabled)return ;
@@ -257,7 +257,7 @@ void __init setup_kuep(bool disabled)#endif #ifdef CONFIG_PPC_KUAP -void __init setup_kuap (bool disabled) +void setup_kuap (bool disabled) {pr_info ("Activating Kernel Userspace Access Protection\n" );
Signature · 1 line
2.28.0
Le 14/12/2020 à 08:13, Aneesh Kumar K.V a écrit :
Quoted 2 lines
Kernel call these functions on cpu online and hence they should not be marked
__init.
This is PPC64 only.
Christophe
Quoted 89 lines
Signed-off-by Aneesh Kumar K.V <[email protected]>--- arch/powerpc/mm/book3s32/mmu.c | 4 ++-- arch/powerpc/mm/book3s64/pkeys.c | 4 ++-- arch/powerpc/mm/init-common.c | 2 +- arch/powerpc/mm/nohash/8xx.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)arch/powerpc/mm/book3s32/mmu.c +2
-2@@ -449,7 +449,7 @@ void __init print_system_hash_info(void) }#ifdef CONFIG_PPC_KUEP -void __init setup_kuep (bool disabled) +void setup_kuep (bool disabled) {pr_info ("Activating Kernel Userspace Execution Prevention\n" );@@ -459,7 +459,7 @@ void __init setup_kuep(bool disabled)#endif #ifdef CONFIG_PPC_KUAP -void __init setup_kuap (bool disabled) +void setup_kuap (bool disabled) {pr_info ("Activating Kernel Userspace Access Protection\n" );arch/powerpc/mm/book3s64/pkeys.c +2
-2@@ -251,7 +251,7 @@ void __init pkey_early_init_devtree(void) }#ifdef CONFIG_PPC_KUEP -void __init setup_kuep (bool disabled) +void setup_kuep (bool disabled) {if (disabled)return ;@@ -277,7 +277,7 @@ void __init setup_kuep(bool disabled)#endif #ifdef CONFIG_PPC_KUAP -void __init setup_kuap (bool disabled) +void setup_kuap (bool disabled) {if (disabled)return ;arch/powerpc/mm/init-common.c +1
-1@@ -47,7 +47,7 @@ static int __init parse_nosmap(char *p) }early_param ("nosmap" , parse_nosmap); -void __ref setup_kup (void ) +void setup_kup (void ) {setup_kuep (disable_kuep);setup_kuap (disable_kuap);arch/powerpc/mm/nohash/8xx.c +2
-2@@ -245,7 +245,7 @@ void set_context(unsigned long id, pgd_t *pgd) }#ifdef CONFIG_PPC_KUEP -void __init setup_kuep (bool disabled) +void setup_kuep (bool disabled) {if (disabled)return ;@@ -257,7 +257,7 @@ void __init setup_kuep(bool disabled)#endif #ifdef CONFIG_PPC_KUAP -void __init setup_kuap (bool disabled) +void setup_kuap (bool disabled) {pr_info ("Activating Kernel Userspace Access Protection\n" );