]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86: properly gate clearing of PKU feature
authorJan Beulich <jbeulich@suse.com>
Thu, 29 Aug 2019 13:10:07 +0000 (15:10 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 29 Aug 2019 13:10:07 +0000 (15:10 +0200)
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>
xen/arch/x86/cpu/common.c

index a074176c004d9ad90c0672e06a3cea0a0a8210f1..8de4a44c1a04f3fc9e57c34c7ed91e5dd907c65b 100644 (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);
 
        /*