Skip to content

paravirt: cleanup and reorg

Juergen Gross kvm linux-arm-kernel linux-hyperv linux-riscv linuxppc-dev lkml loongarch virtualization xen-devel 5 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest21 patches 3 repliesApplied 3/21
  2. v421 patches 4 repliesSuperseded 2 of 21 applied
  3. v321 patches 11 repliesSuperseded 2 of 21 applied
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v221 patches2 repliesSuperseded 2 of 21 applied
v114 patches2 repliesSuperseded 2 of 14 applied

Changes in v5 from the cover letter

- fixed another build issue
- rebase

Patches in v5 Applied · 3/21

#Subject and filesSizeRepliesApplied
1/21x86/paravirt: Remove not needed includes of paravirt.harch/x86/entry/entry_64.S arch/x86/entry/vsyscall/vsyscall_64.c arch/x86/hyperv/hv_spinlock.c +13 more+0 -221 reply
2/21x86/paravirt: Remove some unneeded struct declarationsarch/x86/include/asm/paravirt.h arch/x86/include/asm/paravirt_types.h+0 -100 replies
3/21x86/paravirt: Remove PARAVIRT_DEBUG config optionarch/x86/Kconfig arch/x86/include/asm/paravirt.h arch/x86/include/asm/paravirt_types.h+0 -160 replies
4/21x86/paravirt: Move thunk macros to paravirt_types.harch/x86/include/asm/paravirt.h arch/x86/include/asm/paravirt_types.h+68 -680 replies
5/21paravirt: Remove asm/paravirt_api_clock.harch/arm/include/asm/paravirt_api_clock.h arch/arm64/include/asm/paravirt_api_clock.h arch/loongarch/include/asm/paravirt_api_clock.h +4 more+0 -80 repliesApplied
6/21sched: Move clock related paravirt code to kernel/schedarch/Kconfig arch/arm/include/asm/paravirt.h arch/arm/kernel/paravirt.c +17 more+47 -400 repliesApplied
7/21arm/paravirt: Use common code for paravirt_steal_clock()arch/arm/Kconfig arch/arm/include/asm/paravirt.h arch/arm/kernel/Makefile +2 more+3 -390 replies
8/21arm64/paravirt: Use common code for paravirt_steal_clock()arch/arm64/Kconfig arch/arm64/include/asm/paravirt.h arch/arm64/kernel/paravirt.c+1 -170 replies
9/21loongarch/paravirt: Use common code for paravirt_steal_clock()arch/loongarch/Kconfig arch/loongarch/include/asm/paravirt.h arch/loongarch/kernel/paravirt.c+1 -170 replies
10/21riscv/paravirt: Use common code for paravirt_steal_clock()arch/riscv/Kconfig arch/riscv/include/asm/paravirt.h arch/riscv/kernel/paravirt.c+1 -170 repliesApplied
11/21x86/paravirt: Use common code for paravirt_steal_clock()arch/x86/Kconfig arch/x86/include/asm/paravirt.h arch/x86/kernel/paravirt.c +2 more+2 -160 replies
12/21x86/paravirt: Move paravirt_sched_clock() related code into tsc.carch/x86/include/asm/paravirt.h arch/x86/include/asm/timer.h arch/x86/kernel/kvmclock.c +4 more+14 -201 reply
13/21x86/paravirt: Introduce new paravirt-base.h headerarch/x86/include/asm/paravirt-base.h arch/x86/include/asm/paravirt.h arch/x86/include/asm/paravirt_types.h +1 more+34 -240 replies
14/21x86/paravirt: Move pv_native_*() prototypes to paravirt.carch/x86/include/asm/paravirt_types.h arch/x86/kernel/paravirt.c+5 -70 replies
15/21x86/xen: Drop xen_irq_opsarch/x86/xen/irq.c tools/objtool/check.c+7 -140 replies
16/21x86/xen: Drop xen_cpu_opsarch/x86/xen/enlighten_pv.c tools/objtool/check.c+33 -500 replies
17/21x86/xen: Drop xen_mmu_opsarch/x86/xen/mmu_pv.c tools/objtool/check.c+38 -630 replies
18/21objtool: Allow multiple pv_ops arraystools/objtool/arch/x86/decode.c tools/objtool/check.c tools/objtool/include/objtool/check.h+65 -180 replies
19/21x86/paravirt: Allow pv-calls outside paravirt.harch/x86/include/asm/paravirt.h+0 -160 replies
20/21x86/paravirt: Specify pv_ops array in paravirt macrosarch/x86/include/asm/paravirt.h arch/x86/include/asm/paravirt_types.h+153 -1530 replies
21/21x86/pvlocks: Move paravirt spinlock functions into own headerarch/x86/hyperv/hv_spinlock.c arch/x86/include/asm/paravirt-base.h arch/x86/include/asm/paravirt-spinlock.h +9 more+198 -2001 reply

Reviews trailers per patch

16 of 21 patches have a Reviewed-by or Acked-by.

PatchPeter Zijlstra (Intel)Shrikanth HegdeBibo MaoAndrew JonesBoris OstrovskyWei Liu (Microsoft)
1/21A-b A-b
2/21A-b
3/21A-b
4/21A-b
5/21A-b R-b
6/21A-b
7/21A-b
8/21A-b
9/21A-b R-b
10/21A-b R-b
11/21A-b
12/21A-b A-b
13/21
14/21
15/21R-b
16/21R-b
17/21R-b
18/21
19/21
20/21
21/21A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v5 thread

Cover letter [PATCH v5 00/21] paravirt: cleanup and reorg

Some cleanups and reorg of paravirt code and headers:

- The first 2 patches should be not controversial at all, as they remove just some no longer needed #include and struct forward declarations.

- The 3rd patch is removing CONFIG_PARAVIRT_DEBUG, which IMO has no real value, as it just changes a crash to a BUG() (the stack trace will basically be the same). As the maintainer of the main paravirt user (Xen) I have never seen this crash/BUG() to happen.

- The 4th patch is just a movement of code.

- I don't know for what reason asm/paravirt_api_clock.h was added, as all archs supporting it do it exactly in the same way. Patch 5 is removing it.

- Patches 6-14 are streamlining the paravirt clock interfaces by using a common implementation across architectures where possible and by moving the related code into common sched code, as this is where it should live.

- Patches 15-20 are more like RFC material preparing the paravirt infrastructure to support multiple pv_ops function arrays. As a prerequisite for that it makes life in objtool much easier with dropping the Xen static initializers of the pv_ops sub- structures, which is done in patches 15-17.
Patches 18-20 are doing the real preparations for multiple pv_ops arrays and using those arrays in multiple headers.

- Patch 21 is an example how the new scheme can look like using the PV-spinlocks.

Changes in V2:
- new patches 13-18 and 20
- complete rework of patch 21

Changes in V3:
- fixed 2 issues detected by kernel test robot

Changes in V4:
- fixed one build issue

Changes in V5:
- fixed another build issue
- rebase

Juergen Gross (21):
x86/paravirt: Remove not needed includes of paravirt.h x86/paravirt: Remove some unneeded struct declarations x86/paravirt: Remove PARAVIRT_DEBUG config option x86/paravirt: Move thunk macros to paravirt_types.h
paravirt: Remove asm/paravirt_api_clock.h
sched: Move clock related paravirt code to kernel/sched arm/paravirt: Use common code for paravirt_steal_clock() arm64/paravirt: Use common code for paravirt_steal_clock() loongarch/paravirt: Use common code for paravirt_steal_clock() riscv/paravirt: Use common code for paravirt_steal_clock() x86/paravirt: Use common code for paravirt_steal_clock() x86/paravirt: Move paravirt_sched_clock() related code into tsc.c x86/paravirt: Introduce new paravirt-base.h header x86/paravirt: Move pv_native_*() prototypes to paravirt.c x86/xen: Drop xen_irq_ops
x86/xen: Drop xen_cpu_ops
x86/xen: Drop xen_mmu_ops
objtool: Allow multiple pv_ops arrays
x86/paravirt: Allow pv-calls outside paravirt.h x86/paravirt: Specify pv_ops array in paravirt macros x86/pvlocks: Move paravirt spinlock functions into own header

 arch/Kconfig                                  |   3 +
 arch/arm/Kconfig                              |   1 +
 arch/arm/include/asm/paravirt.h               |  22 --
 arch/arm/include/asm/paravirt_api_clock.h     |   1 -
 arch/arm/kernel/Makefile                      |   1 -
 arch/arm/kernel/paravirt.c                    |  23 --
 arch/arm64/Kconfig                            |   1 +
 arch/arm64/include/asm/paravirt.h             |  14 -
 arch/arm64/include/asm/paravirt_api_clock.h   |   1 -
 arch/arm64/kernel/paravirt.c                  |  11 +-
 arch/loongarch/Kconfig                        |   1 +
 arch/loongarch/include/asm/paravirt.h         |  13 -
 .../include/asm/paravirt_api_clock.h          |   1 -
 arch/loongarch/kernel/paravirt.c              |  10 +-
 arch/powerpc/include/asm/paravirt.h           |   3 -
 arch/powerpc/include/asm/paravirt_api_clock.h |   2 -
 arch/powerpc/platforms/pseries/setup.c        |   4 +-
 arch/riscv/Kconfig                            |   1 +
 arch/riscv/include/asm/paravirt.h             |  14 -
 arch/riscv/include/asm/paravirt_api_clock.h   |   1 -
 arch/riscv/kernel/paravirt.c                  |  11 +-
 arch/x86/Kconfig                              |   8 +-
 arch/x86/entry/entry_64.S                     |   1 -
 arch/x86/entry/vsyscall/vsyscall_64.c         |   1 -
 arch/x86/hyperv/hv_spinlock.c                 |  11 +-
 arch/x86/include/asm/apic.h                   |   4 -
 arch/x86/include/asm/highmem.h                |   1 -
 arch/x86/include/asm/mshyperv.h               |   1 -
 arch/x86/include/asm/paravirt-base.h          |  35 ++
 arch/x86/include/asm/paravirt-spinlock.h      | 145 ++++++++
 arch/x86/include/asm/paravirt.h               | 331 +++++-------------
 arch/x86/include/asm/paravirt_api_clock.h     |   1 -
 arch/x86/include/asm/paravirt_types.h         | 269 +++++++-------
 arch/x86/include/asm/pgtable_32.h             |   1 -
 arch/x86/include/asm/ptrace.h                 |   2 +-
 arch/x86/include/asm/qspinlock.h              |  87 +----
 arch/x86/include/asm/spinlock.h               |   1 -
 arch/x86/include/asm/timer.h                  |   1 +
 arch/x86/include/asm/tlbflush.h               |   4 -
 arch/x86/kernel/Makefile                      |   2 +-
 arch/x86/kernel/apm_32.c                      |   1 -
 arch/x86/kernel/callthunks.c                  |   1 -
 arch/x86/kernel/cpu/bugs.c                    |   1 -
 arch/x86/kernel/cpu/vmware.c                  |   1 +
 arch/x86/kernel/kvm.c                         |  13 +-
 arch/x86/kernel/kvmclock.c                    |   1 +
 arch/x86/kernel/paravirt-spinlocks.c          |  26 +-
 arch/x86/kernel/paravirt.c                    |  42 +--
 arch/x86/kernel/tsc.c                         |  10 +-
 arch/x86/kernel/vsmp_64.c                     |   1 -
 arch/x86/lib/cache-smp.c                      |   1 -
 arch/x86/mm/init.c                            |   1 -
 arch/x86/xen/enlighten_pv.c                   |  82 ++---
 arch/x86/xen/irq.c                            |  20 +-
 arch/x86/xen/mmu_pv.c                         | 100 ++----
 arch/x86/xen/spinlock.c                       |  11 +-
 arch/x86/xen/time.c                           |   2 +
 drivers/clocksource/hyperv_timer.c            |   2 +
 drivers/xen/time.c                            |   2 +-
 include/linux/sched/cputime.h                 |  18 +
 kernel/sched/core.c                           |   5 +
 kernel/sched/cputime.c                        |  13 +
 kernel/sched/sched.h                          |   3 +-
 tools/objtool/arch/x86/decode.c               |   8 +-
 tools/objtool/check.c                         |  78 ++++-
 tools/objtool/include/objtool/check.h         |   1 +
 66 files changed, 662 insertions(+), 827 deletions(-)
 delete mode 100644 arch/arm/include/asm/paravirt.h
 delete mode 100644 arch/arm/include/asm/paravirt_api_clock.h
 delete mode 100644 arch/arm/kernel/paravirt.c
 delete mode 100644 arch/arm64/include/asm/paravirt_api_clock.h
 delete mode 100644 arch/loongarch/include/asm/paravirt_api_clock.h
 delete mode 100644 arch/powerpc/include/asm/paravirt_api_clock.h
 delete mode 100644 arch/riscv/include/asm/paravirt_api_clock.h
 create mode 100644 arch/x86/include/asm/paravirt-base.h
 create mode 100644 arch/x86/include/asm/paravirt-spinlock.h
 delete mode 100644 arch/x86/include/asm/paravirt_api_clock.h
Signature · 1 line
2.51.0