• Fenghua Yu's avatar
    x86/cpufeatures: Enumerate user wait instructions · 6dbbf5ec
    Fenghua Yu authored
    umonitor, umwait, and tpause are a set of user wait instructions.
    
    umonitor arms address monitoring hardware using an address. The
    address range is determined by using CPUID.0x5. A store to
    an address within the specified address range triggers the
    monitoring hardware to wake up the processor waiting in umwait.
    
    umwait instructs the processor to enter an implementation-dependent
    optimized state while monitoring a range of addresses. The optimized
    state may be either a light-weight power/performance optimized state
    (C0.1 state) or an improved power/performance optimized state
    (C0.2 state).
    
    tpause instructs the processor to enter an implementation-dependent
    optimized state C0.1 or C0.2 state and wake up when time-stamp counter
    reaches specified timeout.
    
    The three instructions may be executed at any privilege level.
    
    The instructions provide power saving method while waiting in
    user space. Additionally, they can allow a sibling hyperthread to
    make faster progress while this thread is waiting. One example of an
    application usage of umwait is when waiting for input data from another
    application, such as a user level multi-threaded packet processing
    engine.
    
    Availability of the user wait instructions is indicated by the presence
    of the CPUID feature flag WAITPKG CPUID.0x07.0x0:ECX[5].
    
    Detailed information on the instructions and CPUID feature WAITPKG flag
    can be found in the latest Intel Architecture Instruction Set Extensions
    and Future Features Programming Reference and Intel 64 and IA-32
    Architectures Software Developer's Manual.
    Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Reviewed-by: default avatarAshok Raj <ashok.raj@intel.com>
    Reviewed-by: default avatarAndy Lutomirski <luto@kernel.org>
    Cc: "Borislav Petkov" <bp@alien8.de>
    Cc: "H Peter Anvin" <hpa@zytor.com>
    Cc: "Peter Zijlstra" <peterz@infradead.org>
    Cc: "Tony Luck" <tony.luck@intel.com>
    Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com>
    Link: https://lkml.kernel.org/r/1560994438-235698-2-git-send-email-fenghua.yu@intel.com
    6dbbf5ec
cpufeatures.h 24.6 KB