• Borislav Petkov's avatar
    x86/microcode: Rip out the subsys interface gunk · b6f86689
    Borislav Petkov authored
    This is a left-over from the old days when CPU hotplug wasn't as robust
    as it is now. Currently, microcode gets loaded early on the CPU init
    path and there's no need to attempt to load it again, which that subsys
    interface callback is doing.
    
    The only other thing that the subsys interface init path was doing is
    adding the
    
      /sys/devices/system/cpu/cpu*/microcode/
    
    hierarchy.
    
    So add a function which gets called on each CPU after all the necessary
    driver setup has happened. Use schedule_on_each_cpu() which can block
    because the sysfs creating code does kmem_cache_zalloc() which can block
    too and the initial version of this where it did that setup in an IPI
    handler of on_each_cpu() can cause a deadlock of the sort:
    
      lock(fs_reclaim);
      <Interrupt>
        lock(fs_reclaim);
    
    as the IPI handler runs in IRQ context.
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Reviewed-by: default avatarAshok Raj <ashok.raj@intel.com>
    Link: https://lore.kernel.org/r/20221028142638.28498-2-bp@alien8.de
    b6f86689
core.c 16.4 KB