Skip to content

KVM: PPC: Book3S: Modules cleanup and unification

Fabiano Rosas kvm-ppc linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: PPC: Book3S HV: Check return value of kvmppc_radix_initarch/powerpc/kvm/book3s_hv.c+4 -10 replies
2/5KVM: PPC: Book3S HV: Delay setting of kvm opsarch/powerpc/kvm/book3s_hv.c+7 -50 replies
3/5KVM: PPC: Book3S HV: Free allocated memory if module init failsarch/powerpc/kvm/book3s_hv.c+11 -40 replies
4/5KVM: PPC: Book3S: Unify kvm-hv and kvm-pr modulesarch/powerpc/configs/powernv_defconfig arch/powerpc/configs/ppc64_defconfig arch/powerpc/configs/pseries_defconfig +7 more+105 -740 replies
5/5KVM: PPC: Book3S: Stop exporting non-builtin symbolsarch/powerpc/kvm/book3s.c arch/powerpc/kvm/book3s_64_mmu_radix.c arch/powerpc/kvm/book3s_64_vio.c +5 more+0 -470 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/5] KVM: PPC: Book3S: Modules cleanup and unification

This series merges our three kvm modules kvm.ko, kvm-hv.ko and kvm-pr.ko into one kvm.ko module.

The main reason for this is to deal with the issue that kvm.ko can be loaded on its own without any of the other modules present. This can happen if one or both of the modules fail to init or if the user loads kvm.ko only.

With only kvm.ko loaded, the userspace can call any of the KVM ioctls which will fail more or less gracefully depending on what kind of verification we do in powerpc.c.

Instead of adding a check to every entry point or finding a hack to link the modules so that when one fails (hv/pr), the other (kvm) exits, I think it is cleaner to just make them all a single module.

The two KVM implementations are already selected by Kconfig options, so the only thing that changes is that they are now in the same module. I also kept kvm-hv and kvm-pr as aliases to kvm, so that people don't get too surprised with the change.

There is a possible issue with the larger module size for kernel builds that should support both HV-only and PR-only environments, but PR is usually not used in production so I'm not sure if that is a real issue.

Patches 1,2,3 are standalone cleanups.
Patches 4,5 are the unification work.

Fabiano Rosas (5):
KVM: PPC: Book3S HV: Check return value of kvmppc_radix_init
KVM: PPC: Book3S HV: Delay setting of kvm ops
KVM: PPC: Book3S HV: Free allocated memory if module init fails
KVM: PPC: Book3S: Unify kvm-hv and kvm-pr modules
KVM: PPC: Book3S: Stop exporting non-builtin symbols

 arch/powerpc/configs/powernv_defconfig |  2 +-
 arch/powerpc/configs/ppc64_defconfig   |  2 +-
 arch/powerpc/configs/pseries_defconfig |  2 +-
 arch/powerpc/kvm/Kconfig               | 72 ++++++++++++--------------
 arch/powerpc/kvm/Makefile              | 11 ++--
 arch/powerpc/kvm/book3s.c              | 61 ++++++++++++++--------
 arch/powerpc/kvm/book3s.h              | 19 +++++++
 arch/powerpc/kvm/book3s_64_mmu_radix.c |  3 --
 arch/powerpc/kvm/book3s_64_vio.c       |  3 --
 arch/powerpc/kvm/book3s_hv.c           | 38 ++++++++------
 arch/powerpc/kvm/book3s_pr.c           | 13 -----
 arch/powerpc/kvm/book3s_rtas.c         |  1 -
 arch/powerpc/kvm/book3s_xics.c         |  4 --
 arch/powerpc/kvm/book3s_xive.c         |  6 ---
 arch/powerpc/kvm/emulate.c             |  1 -
 arch/powerpc/kvm/powerpc.c             | 14 -----
 kernel/irq/irqdesc.c                   |  2 +-
 17 files changed, 125 insertions(+), 129 deletions(-)
Signature · 1 line
2.29.2