Skip to content

RFC x86: Enable a few new instructions

Fenghua Yu lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8x86/cpufeatures: Enumerate MOVDIRI instructionarch/x86/include/asm/cpufeatures.h+1 -05 replies
2/8x86/cpufeatures: Enumerate MOVDIR64B instructionarch/x86/include/asm/cpufeatures.h+1 -00 replies
3/8x86/cpufeatures: Enumerate UMONITOR, UMWAIT, and TPAUSE instructionsarch/x86/include/asm/cpufeatures.h+1 -00 replies
4/8cpuidle: Set up maximum umwait time and umwait statesarch/x86/include/asm/msr-index.h arch/x86/power/Makefile arch/x86/power/umwait.c+111 -02 replies
5/8x86/umwait.c: Add sysfs interface to show tsc_khzarch/x86/power/umwait.c+18 -12 replies
6/8x86/lib_direct_store.h: Add APIs for direct store instructionsarch/x86/include/uapi/asm/lib_direct_store.h+161 -01 reply
7/8x86/lib_user_wait.h: Add APIs for user wait instructionsarch/x86/include/uapi/asm/lib_user_wait.h+255 -04 replies
8/8selftests/x86: Self test for the APIs in lib_direct_store.h and lib_user_wait.htools/testing/selftests/x86/Makefile tools/testing/selftests/x86/directstore_umwait.c+205 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/8] x86: Enable a few new instructions

A few new instructions including direct stores (movdiri and movdir64b) and user wait (umwait, umonitor, and tpause) and IA32_MWAIT_CONTROL MSR to control umwait/umonitor/tpause behaviors will be available in Tremont and other future x86 processors.

This patch set enumerates the instructions, adds a sysfs interface for user to configure the umwait/umonitor/tpause instructions, and provides APIs for user or kernel to call the instructions.

The sysfs interface files are in /sys/devices/system/cpu/user_wait because it's hard to find existing place to host the files.

The user libraries for the instructions are in arch/x86/include/uapi/asm/. Hopefully this is a right place to keep the libraries.

Detailed information on the instructions and the MSR can be found in the latest Intel Architecture Instruction Set Extensions and Future Features Programming Reference at
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

Fenghua Yu (8):
x86/cpufeatures: Enumerate MOVDIRI instruction x86/cpufeatures: Enumerate MOVDIR64B instruction x86/cpufeatures: Enumerate UMONITOR, UMWAIT, and TPAUSE instructions
cpuidle: Set up maximum umwait time and umwait states x86/umwait.c: Add sysfs interface to show tsc_khz x86/lib_direct_store.h: Add APIs for direct store instructions x86/lib_user_wait.h: Add APIs for user wait instructions selftests/x86: Self test for the APIs in lib_direct_store.h and
lib_user_wait.h

 arch/x86/include/asm/cpufeatures.h               |   3 +
 arch/x86/include/asm/msr-index.h                 |   4 +
 arch/x86/include/uapi/asm/lib_direct_store.h     | 161 ++++++++++++++
 arch/x86/include/uapi/asm/lib_user_wait.h        | 255 +++++++++++++++++++++++
 arch/x86/power/Makefile                          |   1 +
 arch/x86/power/umwait.c                          | 123 +++++++++++
 tools/testing/selftests/x86/Makefile             |   5 +-
 tools/testing/selftests/x86/directstore_umwait.c | 202 ++++++++++++++++++
 8 files changed, 752 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/include/uapi/asm/lib_direct_store.h
 create mode 100644 arch/x86/include/uapi/asm/lib_user_wait.h
 create mode 100644 arch/x86/power/umwait.c
 create mode 100644 tools/testing/selftests/x86/directstore_umwait.c
Signature · 1 line
2.5.0