Skip to content

x86/delay: Introduce TPAUSE instruction

Kyung Min Park lkml 4 versions – Applied

Status from this message: The following commit has been merged into the x86/timers branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 0 repliesApplied
  2. v33 patches 4 repliesSuperseded
  3. v22 patches 10 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches5 repliesSuperseded

ChangeLog from the cover letter · 17 lines

- Change from v3 to v4:
1. Add binutils version to support tpause as suggested by Peter Zijlstra.
2. Use arch/x86/Kconfig.assembler to set up a CONFIG_AS_TPAUSE suggested by Tony Luck.
3. Fix build issue for make ARCH=i386.

- Change from v2 to v3:
1. Add Thomas' cleanup patch to this patchset.
2. Implement use_tpause_delay() to use TPAUSE.
3. Call use_tpause_delay() during x86_late_time_init().
4. Use APIs lower_32_bits(), upper_32_bits() as suggested by Joe Perch.
5. Change __tpause() argument integer type from unsigned int to u32.

- Change from v1 to v2:
1. Change function/variable names as suggested by Thomas Gleixner i.e. a. Change to delay_halt_fn/delay_halt_mwaitx/delay_halt_tpause from wait_func/mwaitx/tpause.
b. Change variable name loops to cycles.
c. Change back to the original name delay_fn from delay_platform.
2. Organize comments to use full width.
3. Add __ro_after_init for the function pointer delay_halt_fn.
4. Change patch titles as suggested by Thomas Gleixner.

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/3x86/delay: Preparatory code cleanuparch/x86/include/asm/delay.h arch/x86/include/asm/mwait.h arch/x86/lib/delay.c+27 -230 replies
2/3x86/delay: Refactor delay_mwaitx() for TPAUSE supportarch/x86/lib/delay.c+30 -180 replies
3/3x86/delay: Introduce TPAUSE delayarch/x86/Kconfig.assembler arch/x86/include/asm/delay.h arch/x86/include/asm/mwait.h +2 more+57 -00 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchTony Luck
1/3
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] x86/delay: Introduce TPAUSE instruction

Intel processors that support the WAITPKG feature implement the TPAUSE instruction that suspends execution in a lower power state until the TSC (Time Stamp Counter) exceeds a certain value.

Update the udelay() function to use TPAUSE on systems where it is available. Note that we hard code the deeper (C0.2) sleep state because exit latency is small compared to the "microseconds" that usleep() will delay.

ChangeLog:
- Change from v3 to v4:
1. Add binutils version to support tpause as suggested by Peter Zijlstra.
2. Use arch/x86/Kconfig.assembler to set up a CONFIG_AS_TPAUSE suggested by Tony Luck.
3. Fix build issue for make ARCH=i386.

- Change from v2 to v3:
1. Add Thomas' cleanup patch to this patchset.
2. Implement use_tpause_delay() to use TPAUSE.
3. Call use_tpause_delay() during x86_late_time_init().
4. Use APIs lower_32_bits(), upper_32_bits() as suggested by Joe Perch.
5. Change __tpause() argument integer type from unsigned int to u32.

- Change from v1 to v2:
1. Change function/variable names as suggested by Thomas Gleixner i.e. a. Change to delay_halt_fn/delay_halt_mwaitx/delay_halt_tpause from wait_func/mwaitx/tpause.
b. Change variable name loops to cycles.
c. Change back to the original name delay_fn from delay_platform.
2. Organize comments to use full width.
3. Add __ro_after_init for the function pointer delay_halt_fn.
4. Change patch titles as suggested by Thomas Gleixner.

Kyung Min Park (2):
x86/delay: Refactor delay_mwaitx() for TPAUSE support x86/delay: Introduce TPAUSE delay

Thomas Gleixner (1):
x86/delay: Preparatory code cleanup

 arch/x86/Kconfig.assembler   |   4 ++
 arch/x86/include/asm/delay.h |   4 +-
 arch/x86/include/asm/mwait.h |  24 ++++++++-
 arch/x86/kernel/time.c       |   3 ++
 arch/x86/lib/delay.c         | 114 +++++++++++++++++++++++++++++--------------
 5 files changed, 111 insertions(+), 38 deletions(-)
Signature · 1 line
2.7.4