x86: properly gate clearing of PKU feature

setup_clear_cpu_cap() is __init and hence may not be called post-boot.
Note that opt_pku nevertheless is not getting __initdata added - see
e.g. commit 43fa95ae6a ("mm: make opt_bootscrub non-init").

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2019-08-29 15:10:07 +02:00
1 parent ee91a49a44
commit 41c7700a00
1 file changed
+1 -1
+1 -1
View File
@@ -463,7 +463,7 @@ void identify_cpu(struct cpuinfo_x86 *c)
this_cpu->c_init(c);
if ( !opt_pku )
if (c == &boot_cpu_data && !opt_pku)
setup_clear_cpu_cap(X86_FEATURE_PKU);
/*
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.