• H. Peter Anvin's avatar
    x86, xsave: Make xstate_enable_boot_cpu() __init, protect on CPU 0 · 1cff92d8
    H. Peter Anvin authored
    xstate_enable_boot_cpu() is, as the name implies, only used on the
    boot CPU; furthermore, it invokes alloc_bootmem(), which is __init;
    hence it needs to be tagged __init rather than __cpuinit.
    
    Furthermore, it is *not* safe in the long run to rely on CPU 0 only
    coming online during the early boot -- at some point we're going to
    support offlining (and re-onlining) the boot CPU, and at that point we
    must not call xstate_enable_boot_cpu() again.
    
    The code is a fair bit more obscure than one would like, because the
    __ref overrides aren't quite powerful enough.
    Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
    Acked-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
    Cc: Robert Richter <robert.richter@amd.com>
    LKML-Reference: <4C476236.1020302@zytor.com>
    1cff92d8
xsave.c 11.3 KB