Skip to content
  • Michael Ellerman's avatar
    powerpc/64s: Add support for software count cache flush · 9346855c
    Michael Ellerman authored
    commit ee13cb24
    
     upstream.
    
    Some CPU revisions support a mode where the count cache needs to be
    flushed by software on context switch. Additionally some revisions may
    have a hardware accelerated flush, in which case the software flush
    sequence can be shortened.
    
    If we detect the appropriate flag from firmware we patch a branch
    into _switch() which takes us to a count cache flush sequence.
    
    That sequence in turn may be patched to return early if we detect that
    the CPU supports accelerating the flush sequence in hardware.
    
    Add debugfs support for reporting the state of the flush, as well as
    runtime disabling it.
    
    And modify the spectre_v2 sysfs file to report the state of the
    software flush.
    
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    9346855c