Skip to content

x86: major paravirt cleanup

Juergen Gross kvm linux-arm-kernel linux-hyperv lkml virtualization xen-devel 8 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest14 patches 0 repliesApplied
  2. v612 patches 14 repliesApplied
  3. v512 patches 6 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v4 posting 2/215 patches2 repliesApplied
v4 posting 1/215 patches0 repliesSuperseded
v315 patches11 repliesSuperseded
v212 patches41 repliesApplied
v14 patches7 repliesSuperseded

Changes in v7 from the cover letter

- dropped patch 3, as already applied on tip tree
- new patch 3 (patches 1 and 7 have been added to V6 late)
- addressed comments by Boris

Patches in v7 Applied

#Subject and filesSizeRepliesApplied
1/14x86/alternative: merge include filesarch/x86/entry/entry_32.S arch/x86/entry/vdso/vdso32/system_call.S arch/x86/include/asm/alternative-asm.h +11 more+120 -1320 replies
2/14static_call: move struct static_call_key definition to static_call_types.hinclude/linux/static_call.h include/linux/static_call_types.h tools/include/linux/static_call_types.h+36 -180 replies
3/14static_call: add function to query current functioninclude/linux/static_call.h+8 -00 replies
4/14x86/paravirt: switch time pvops functions to use static_call()arch/arm/include/asm/paravirt.h arch/arm/kernel/paravirt.c arch/arm64/include/asm/paravirt.h +12 more+71 -570 replies
5/14x86/alternative: support not-featurearch/x86/include/asm/alternative.h arch/x86/kernel/alternative.c+18 -50 replies
6/14x86/alternative: support ALTERNATIVE_TERNARYarch/x86/include/asm/alternative.h+11 -00 replies
7/14x86/alternative: don't open code ALTERNATIVE_TERNARY() in _static_cpu_has()arch/x86/include/asm/cpufeature.h+9 -320 replies
8/14x86: add new features for paravirt patchingarch/x86/include/asm/cpufeatures.h arch/x86/include/asm/paravirt.h arch/x86/kernel/alternative.c +1 more+49 -20 replies
9/14x86/paravirt: remove no longer needed 32-bit pvops cruftarch/x86/entry/entry_32.S arch/x86/include/asm/irqflags.h arch/x86/include/asm/paravirt.h +2 more+35 -1230 replies
10/14x86/paravirt: simplify paravirt macrosarch/x86/include/asm/paravirt_types.h+12 -290 replies
11/14x86/paravirt: switch iret pvops to ALTERNATIVEarch/x86/include/asm/paravirt.h arch/x86/include/asm/paravirt_types.h arch/x86/kernel/asm-offsets.c +2 more+7 -380 replies
12/14x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEsarch/x86/include/asm/paravirt_types.h+48 -10 replies
13/14x86/paravirt: switch functions with custom code to ALTERNATIVEarch/x86/entry/entry_64.S arch/x86/include/asm/irqflags.h arch/x86/include/asm/paravirt.h +3 more+58 -1570 replies
14/14x86/paravirt: have only one paravirt patch functionarch/x86/include/asm/paravirt_types.h arch/x86/kernel/Makefile arch/x86/kernel/alternative.c +3 more+5 -510 replies

Reviews trailers per patch

10 of 14 patches have a Reviewed-by or Acked-by.

PatchPeter Zijlstra (Intel)
1/14
2/14A-b
3/14
4/14A-b
5/14
6/14A-b
7/14
8/14A-b
9/14A-b
10/14A-b
11/14A-b
12/14A-b
13/14A-b
14/14A-b

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

Read the v7 thread

Cover letter [PATCH v7 00/14] x86: major paravirt cleanup

This is a major cleanup of the paravirt infrastructure aiming at eliminating all custom code patching via paravirt patching.

This is achieved by using ALTERNATIVE instead, leading to the ability to give objtool access to the patched in instructions.

In order to remove most of the 32-bit special handling from pvops the time related operations are switched to use static_call() instead.

At the end of this series all paravirt patching has to do is to replace indirect calls with direct ones. In a further step this could be switched to static_call(), too.

Changes in V7:
- dropped patch 3, as already applied on tip tree
- new patch 3 (patches 1 and 7 have been added to V6 late)
- addressed comments by Boris

Changes in V6:
- switched back to "not" bit in feature value for "not feature"
- other minor comments addressed

Changes in V5:
- patches 1-5 of V4 dropped, as already applied
- new patches 1+3
- fixed patch 2
- split V4 patch 8 into patches 4+5
- use flag byte instead of negative feature bit for "not feature"

Changes in V4:
- fixed several build failures
- removed objtool patch, as objtool patches are in tip now
- added patch 1 for making usage of static_call easier
- even more cleanup

Changes in V3:
- added patches 7 and 12
- addressed all comments

Changes in V2:
- added patches 5-12

Juergen Gross (14):
x86/alternative: merge include files
static_call: move struct static_call_key definition to
static_call_types.h
static_call: add function to query current function x86/paravirt: switch time pvops functions to use static_call() x86/alternative: support not-feature x86/alternative: support ALTERNATIVE_TERNARY x86/alternative: don't open code ALTERNATIVE_TERNARY() in

    _static_cpu_has()

x86: add new features for paravirt patching x86/paravirt: remove no longer needed 32-bit pvops cruft x86/paravirt: simplify paravirt macros
x86/paravirt: switch iret pvops to ALTERNATIVE x86/paravirt: add new macros PVOP_ALT* supporting pvops in
ALTERNATIVEs
x86/paravirt: switch functions with custom code to ALTERNATIVE x86/paravirt: have only one paravirt patch function

 arch/arm/include/asm/paravirt.h          |  14 +-
 arch/arm/kernel/paravirt.c               |   9 +-
 arch/arm64/include/asm/paravirt.h        |  14 +-
 arch/arm64/kernel/paravirt.c             |  13 +-
 arch/x86/Kconfig                         |   1 +
 arch/x86/entry/entry_32.S                |   6 +-
 arch/x86/entry/entry_64.S                |   2 +-
 arch/x86/entry/vdso/vdso32/system_call.S |   2 +-
 arch/x86/include/asm/alternative-asm.h   | 114 ------------
 arch/x86/include/asm/alternative.h       | 126 +++++++++++++-
 arch/x86/include/asm/cpufeature.h        |  41 +----
 arch/x86/include/asm/cpufeatures.h       |   2 +
 arch/x86/include/asm/irqflags.h          |   7 +-
 arch/x86/include/asm/mshyperv.h          |   2 +-
 arch/x86/include/asm/nospec-branch.h     |   1 -
 arch/x86/include/asm/paravirt.h          | 167 ++++++++----------
 arch/x86/include/asm/paravirt_types.h    | 210 +++++++++--------------
 arch/x86/include/asm/smap.h              |   5 +-
 arch/x86/kernel/Makefile                 |   3 +-
 arch/x86/kernel/alternative.c            |  52 +++++-
 arch/x86/kernel/asm-offsets.c            |   7 -
 arch/x86/kernel/cpu/vmware.c             |   5 +-
 arch/x86/kernel/kvm.c                    |   2 +-
 arch/x86/kernel/kvmclock.c               |   2 +-
 arch/x86/kernel/paravirt-spinlocks.c     |   9 +
 arch/x86/kernel/paravirt.c               |  75 ++------
 arch/x86/kernel/paravirt_patch.c         |  99 -----------
 arch/x86/kernel/tsc.c                    |   3 +-
 arch/x86/lib/atomic64_386_32.S           |   2 +-
 arch/x86/lib/atomic64_cx8_32.S           |   2 +-
 arch/x86/lib/copy_page_64.S              |   2 +-
 arch/x86/lib/copy_user_64.S              |   2 +-
 arch/x86/lib/memcpy_64.S                 |   2 +-
 arch/x86/lib/memmove_64.S                |   2 +-
 arch/x86/lib/memset_64.S                 |   2 +-
 arch/x86/lib/retpoline.S                 |   2 +-
 arch/x86/xen/enlighten_pv.c              |   4 +-
 arch/x86/xen/time.c                      |  26 +--
 drivers/xen/time.c                       |   3 +-
 include/linux/static_call.h              |  26 +--
 include/linux/static_call_types.h        |  18 ++
 tools/include/linux/static_call_types.h  |  18 ++
 42 files changed, 473 insertions(+), 631 deletions(-)
 delete mode 100644 arch/x86/include/asm/alternative-asm.h
 delete mode 100644 arch/x86/kernel/paravirt_patch.c
Signature · 6 lines
2.26.2

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization