public inbox for virtualization@lists.linux-foundation.org
 help / color / mirror / Atom feed
* [PATCH v6 00/12] x86: major paravirt cleanup
@ 2021-03-09 13:48 Juergen Gross via Virtualization
  2021-03-09 13:48 ` [PATCH v6 02/12] x86/paravirt: switch time pvops functions to use static_call() Juergen Gross via Virtualization
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Juergen Gross via Virtualization @ 2021-03-09 13:48 UTC (permalink / raw)
  To: xen-devel, linux-kernel, x86, virtualization, linux-arm-kernel,
	linux-hyperv, kvm, clang-built-linux
  Cc: Wanpeng Li, Peter Zijlstra, Catalin Marinas, H. Peter Anvin,
	Will Deacon, Ard Biesheuvel, Wei Liu, Stefano Stabellini,
	Stephen Hemminger, Joerg Roedel, Russell King, VMware, Inc.,
	Ingo Molnar, Haiyang Zhang, Steven Rostedt, Nathan Chancellor,
	Jason Baron, Borislav Petkov, Andy Lutomirski, Josh Poimboeuf,
	Thomas Gleixner, Jim Mattson, Juergen Gross, Boris Ostrovsky,
	Sean Christopherson, Nick Desaulniers, Paolo Bonzini

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 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 (12):
  static_call: move struct static_call_key definition to
    static_call_types.h
  x86/paravirt: switch time pvops functions to use static_call()
  x86/alternative: drop feature parameter from ALTINSTR_REPLACEMENT()
  x86/alternative: support not-feature
  x86/alternative: support ALTERNATIVE_TERNARY
  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               |   4 +-
 arch/x86/entry/entry_64.S               |   2 +-
 arch/x86/include/asm/alternative-asm.h  |   7 +
 arch/x86/include/asm/alternative.h      |  23 ++-
 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/paravirt.h         | 169 +++++++++----------
 arch/x86/include/asm/paravirt_types.h   | 210 +++++++++---------------
 arch/x86/kernel/Makefile                |   3 +-
 arch/x86/kernel/alternative.c           |  51 +++++-
 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              |  78 +++------
 arch/x86/kernel/paravirt_patch.c        |  99 -----------
 arch/x86/kernel/tsc.c                   |   2 +-
 arch/x86/xen/enlighten_pv.c             |   4 +-
 arch/x86/xen/time.c                     |  26 +--
 drivers/xen/time.c                      |   3 +-
 include/linux/static_call.h             |  18 --
 include/linux/static_call_types.h       |  18 ++
 tools/include/linux/static_call_types.h |  18 ++
 30 files changed, 348 insertions(+), 474 deletions(-)
 delete mode 100644 arch/x86/kernel/paravirt_patch.c

-- 
2.26.2

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-03-11 13:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-09 13:48 [PATCH v6 00/12] x86: major paravirt cleanup Juergen Gross via Virtualization
2021-03-09 13:48 ` [PATCH v6 02/12] x86/paravirt: switch time pvops functions to use static_call() Juergen Gross via Virtualization
2021-03-09 18:57   ` Borislav Petkov
2021-03-10  7:51     ` Jürgen Groß via Virtualization
2021-03-10 14:13       ` Borislav Petkov
2021-03-09 13:48 ` [PATCH v6 06/12] x86: add new features for paravirt patching Juergen Gross via Virtualization
2021-03-09 13:48 ` [PATCH v6 07/12] x86/paravirt: remove no longer needed 32-bit pvops cruft Juergen Gross via Virtualization
2021-03-09 13:48 ` [PATCH v6 08/12] x86/paravirt: simplify paravirt macros Juergen Gross via Virtualization
2021-03-09 13:48 ` [PATCH v6 09/12] x86/paravirt: switch iret pvops to ALTERNATIVE Juergen Gross via Virtualization
2021-03-09 13:48 ` [PATCH v6 10/12] x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEs Juergen Gross via Virtualization
2021-03-09 13:48 ` [PATCH v6 11/12] x86/paravirt: switch functions with custom code to ALTERNATIVE Juergen Gross via Virtualization
2021-03-09 13:48 ` [PATCH v6 12/12] x86/paravirt: have only one paravirt patch function Juergen Gross via Virtualization
2021-03-11 12:50 ` [PATCH v6 00/12] x86: major paravirt cleanup Borislav Petkov
2021-03-11 12:51   ` Borislav Petkov
2021-03-11 13:09     ` Jürgen Groß via Virtualization

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox