• Thomas Gleixner's avatar
    x86/microcode: Add per CPU control field · ba3aeb97
    Thomas Gleixner authored
    Add a per CPU control field to ucode_ctrl and define constants for it
    which are going to be used to control the loading state machine.
    
    In theory this could be a global control field, but a global control does
    not cover the following case:
    
     15 primary CPUs load microcode successfully
      1 primary CPU fails and returns with an error code
    
    With global control the sibling of the failed CPU would either try again or
    the whole operation would be aborted with the consequence that the 15
    siblings do not invoke the apply path and end up with inconsistent software
    state. The result in dmesg would be inconsistent too.
    
    There are two additional fields added and initialized:
    
    ctrl_cpu and secondaries. ctrl_cpu is the CPU number of the primary thread
    for now, but with the upcoming uniform loading at package or system scope
    this will be one CPU per package or just one CPU. Secondaries hands the
    control CPU a CPU mask which will be required to release the secondary CPUs
    out of the wait loop.
    
    Preparatory change for implementing a properly split control flow for
    primary and secondary CPUs.
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
    Link: https://lore.kernel.org/r/20231002115903.319959519@linutronix.de
    ba3aeb97
core.c 14.2 KB