• Nicholas Piggin's avatar
    powerpc/64s/exception: optimise system_reset for idle, clean up non-idle case · 0e10be2b
    Nicholas Piggin authored
    The idle wake up code in the system reset interrupt is not very
    optimal. There are two requirements: perform idle wake up quickly;
    and save everything including CFAR for non-idle interrupts, with
    no performance requirement.
    
    The problem with placing the idle test in the middle of the handler
    and using the normal handler code to save CFAR, is that it's quite
    costly (e.g., mfcfar is serialising, speculative workarounds get
    applied, SRR1 has to be reloaded, etc). It also prevents the standard
    interrupt handler boilerplate being used.
    
    This pain can be avoided by using a dedicated idle interrupt handler
    at the start of the interrupt handler, which restores all registers
    back to the way they were in case it was not an idle wake up. CFAR
    is preserved without saving it before the non-idle case by making that
    the fall-through, and idle is a taken branch.
    
    Performance seems to be in the noise, but possibly around 0.5% faster,
    the executed instructions certainly look better. The bigger benefit is
    being able to drop in standard interrupt handlers after the idle code,
    which helps with subsequent cleanup and consolidation.
    Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
    [mpe: Fixup BE by using DOTSYM for idle_return_gpr_loss call]
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    0e10be2b
exceptions-64s.S 71 KB