Skip to content

KVM: Export KVM-internal symbols for sub-modules only

Sean Christopherson kvm linux-s390 linuxppc-dev lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 4 repliesIn review
  2. v16 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Omit the x86 patch, for now.
- Drop "GPL" from KVM's macro to match EXPORT_SYMBOL_FOR_MODULES. [Vlastimil]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: s390/vfio-ap: Use kvm_is_gpa_in_memslot() instead of open coded equivalentarch/s390/include/asm/kvm_host.h arch/s390/kvm/priv.c drivers/s390/crypto/vfio_ap_ops.c+11 -11 reply
2/5KVM: Export KVM-internal symbols for sub-modules onlyarch/powerpc/include/asm/kvm_types.h arch/x86/include/asm/kvm_types.h include/linux/kvm_types.h +3 more+110 -742 replies
3/5KVM: x86: Move kvm_intr_is_single_vcpu() to lapic.carch/x86/include/asm/kvm_host.h arch/x86/kvm/irq.c arch/x86/kvm/lapic.c +1 more+33 -350 replies
4/5KVM: x86: Drop pointless exports of kvm_arch_xxx() hooksarch/x86/kvm/x86.c+0 -30 replies
5/5KVM: x86: Export KVM-internal symbols for sub-modules onlyarch/x86/kvm/cpuid.c arch/x86/kvm/hyperv.c arch/x86/kvm/irq.c +8 more+171 -1712 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchAnthony KrowiakChristian Borntraeger
1/5A-b R-b
2/5
3/5
4/5
5/5

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

Read the v2 thread

Cover letter [PATCH v2 0/5] KVM: Export KVM-internal symbols for sub-modules only

Use the newfangled EXPORT_SYMBOL_FOR_MODULES() along with some macro shenanigans to export KVM-internal symbols if and only if KVM has one or more sub-modules, and only for those sub-modules, e.g. x86's kvm-amd.ko and/or kvm-intel.ko.

Patch 5 gives KVM x86 the full treatment. If anyone wants to tackle PPC, it should be doable to restrict KVM PPC's exports as well.

Based on kvm-x86. My plan is to take this through the KVM x86 tree as there's an annoying conflict with an in-flight patch, and except for the vfio-ap change that's been acked, PPC is the only other architecture that's at all affected, and KVM PPC is maintained separately.

v2:
- Omit the x86 patch, for now.
- Drop "GPL" from KVM's macro to match EXPORT_SYMBOL_FOR_MODULES. [Vlastimil]

v1: https://lkml.kernel.org/r/20250729174238.593070-1-seanjc%40google.com

Sean Christopherson (5):
KVM: s390/vfio-ap: Use kvm_is_gpa_in_memslot() instead of open coded
equivalent
KVM: Export KVM-internal symbols for sub-modules only
KVM: x86: Move kvm_intr_is_single_vcpu() to lapic.c
KVM: x86: Drop pointless exports of kvm_arch_xxx() hooks
KVM: x86: Export KVM-internal symbols for sub-modules only

 arch/powerpc/include/asm/kvm_types.h |  15 ++
 arch/s390/include/asm/kvm_host.h     |   2 +
 arch/s390/kvm/priv.c                 |   8 +
 arch/x86/include/asm/kvm_host.h      |   3 -
 arch/x86/include/asm/kvm_types.h     |  10 ++
 arch/x86/kvm/cpuid.c                 |  10 +-
 arch/x86/kvm/hyperv.c                |   4 +-
 arch/x86/kvm/irq.c                   |  34 +----
 arch/x86/kvm/kvm_onhyperv.c          |   6 +-
 arch/x86/kvm/lapic.c                 |  71 ++++++---
 arch/x86/kvm/lapic.h                 |   4 +-
 arch/x86/kvm/mmu/mmu.c               |  36 ++---
 arch/x86/kvm/mmu/spte.c              |  10 +-
 arch/x86/kvm/mmu/tdp_mmu.c           |   2 +-
 arch/x86/kvm/pmu.c                   |  10 +-
 arch/x86/kvm/smm.c                   |   2 +-
 arch/x86/kvm/x86.c                   | 219 +++++++++++++--------------
 drivers/s390/crypto/vfio_ap_ops.c    |   2 +-
 include/linux/kvm_types.h            |  25 ++-
 virt/kvm/eventfd.c                   |   2 +-
 virt/kvm/guest_memfd.c               |   4 +-
 virt/kvm/kvm_main.c                  | 128 ++++++++--------
 22 files changed, 324 insertions(+), 283 deletions(-)
 create mode 100644 arch/powerpc/include/asm/kvm_types.h

base-commit: c8fbf7ceb2ae3f64b0c377c8c21f6df577a13eb4

Signature · 1 line
2.51.0.470.ga7dc726c21-goog