• Milton Miller's avatar
    powerpc/iseries: Cleanup and fix secondary startup · 7c827337
    Milton Miller authored
    9cb82f2f (Make iSeries spin on
    __secondary_hold_spinloop, like pSeries) added a load of current_set
    but this load was repeated later and we don't even have the paca yet.
    It also checked __secondary_hold_spinloop with a 32 bit compare instead
    of a 64 bit compare.
    
    b6f6b98a (Don't spin on sync instruction
    at boot time) missed the copy of the startup code in iseries.
    
    1426d5a3 (Dynamically allocate pacas)
    doesn't allow for pacas to be less than lppacas and recalculated the paca
    location from the cpu id in r0 every time through the secondary loop.
    
    Various revisions over time made the comments on conditional branches
    confusing with respect to being a hold loop or forward progress
    
    Mostly in-order description of the changes:
    
    Replicate the few lines of code saved by the ugly scoped ifdef CONFIG_SMP
    in the secondary loop between yielding on UP and marking time with the
    hypervisor on SMP.  Always compile the iseries_secondary_yield loop and
    use it if the cpu id is above nr_cpu_ids.  Change all forward progress
    paths to be forward branches to the next numerical label.  Assign a
    label to all loops.  Move all sync instructions from the loops to the
    forward progress path.  Wait to load current_set until paca is set to go.
    Move the iseries_secondary_smp_loop label to cover the whole spin loop.
    Add HMT_MEDIUM when we make forward progress.
    Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    7c827337
exception.S 8.65 KB