Skip to content

improve alternative instruction code and optimize get_cycles_sync

Joerg Roedel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4i386: extend alternative instructions frameworkarch/i386/kernel/alternative.c include/asm-i386/alternative.h+53 -80 replies
2/4x86_64: changes to x86_64 architecture for alternative instruction improvementsarch/x86_64/lib/clear_page.S arch/x86_64/lib/copy_page.S arch/x86_64/lib/copy_user.S +3 more+55 -20 replies
3/4i386: add the X86_FEATURE_SYNC_RDTSC flagarch/i386/kernel/cpu/amd.c arch/i386/kernel/cpu/intel.c include/asm-i386/cpufeature.h+7 -10 replies
4/4optimize and simplify get_cycles_sync()include/asm-i386/cpufeature.h include/asm-i386/tsc.h+10 -148 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/4 TRY#3] improve alternative instruction code and optimize get_cycles_sync

This series of patches extend the alternative instructions framework on i386 and x86_64 architectures to support two alternative instruction replacements. This code is used together with the introduction of the X86_FEATURE_SYNC_RDTSC flag on i386 to simplify and optimize the get_cycles_sync() function. The optimization changes this function to use RDTSCP instead of CPUID;RDTSC if this instruction is available. Don't use CPUID there is really important if the kernel runs as a KVM guest, because this instruction is intercepted and causes an expensive VMEXIT.

Changes to the previous submit:
* rebased to current linus git tree
* replaced RDTSCP usage in get_cycles_sync with the opcode to make it compile with older binutils

Signature · 3 lines
Joerg Roedel
Operating System Research Center
AMD Saxony LLC & Co. KG