Skip to content

RFC x86/alternative: Add ALTERNATIVE_3

Borislav Petkov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86/alternatives: Add macro commentsarch/x86/include/asm/alternative.h+9 -70 replies
2/4x86/alternatives: Print containing functionarch/x86/kernel/alternative.c+2 -20 replies
3/4x86/alternatives: Add an ALTERNATIVE_3() macroarch/x86/include/asm/alternative.h+23 -00 replies
4/4x86/TSC: Use RDTSCParch/x86/include/asm/msr.h+14 -217 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/4] x86/alternative: Add ALTERNATIVE_3

From: Borislav Petkov <[email protected]>

Hi,

here's a patchset which adds an ALTERNATIVE_3() macro so that we can finally do RDTSCP in rdtsc_ordered() but also not break all the possible qemu CPU models out there like some old pentium which doesn't have even MFENCE. Which is the reason for the three-insn alternative macro, btw.

The stuff works here on all machines I've tested it on but since we're too close to the merge window, I'll hold on to it for another round and let it soak slowly into 2019. Thus the RFC tag. In the meantime, it'll collect your comments and ideas.

:-)

Thanks!

Borislav Petkov (4):
x86/alternatives: Add macro comments
x86/alternatives: Print containing function
x86/alternatives: Add an ALTERNATIVE_3() macro
x86/TSC: Use RDTSCP

 arch/x86/include/asm/alternative.h | 39 ++++++++++++++++++++++++------
 arch/x86/include/asm/msr.h         | 16 ++++++++++--
 arch/x86/kernel/alternative.c      |  4 +--
 3 files changed, 48 insertions(+), 11 deletions(-)
Signature · 1 line
2.19.1