• Julien Thierry's avatar
    arm64: use WFE for long delays · 7b77452e
    Julien Thierry authored
    The current delay implementation uses the yield instruction, which is a
    hint that it is beneficial to schedule another thread. As this is a hint,
    it may be implemented as a NOP, causing all delays to be busy loops. This
    is the case for many existing CPUs.
    
    Taking advantage of the generic timer sending periodic events to all
    cores, we can use WFE during delays to reduce power consumption. This is
    beneficial only for delays longer than the period of the timer event
    stream.
    
    If timer event stream is not enabled, delays will behave as yield/busy
    loops.
    Signed-off-by: default avatarJulien Thierry <julien.thierry@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    7b77452e
arm_arch_timer.h 2.95 KB