From: Sean Christopherson <seanjc@google.com>
To: Madhavan Srinivasan <maddy@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Tony Krowiak <akrowiak@linux.ibm.com>,
Halil Pasic <pasic@linux.ibm.com>,
Jason Herne <jjherne@linux.ibm.com>,
Harald Freudenberger <freude@linux.ibm.com>,
Holger Dengler <dengler@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/5] KVM: Export KVM-internal symbols for sub-modules only
Date: Thu, 18 Sep 2025 17:32:58 -0700 [thread overview]
Message-ID: <20250919003303.1355064-1-seanjc@google.com> (raw)
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
--
2.51.0.470.ga7dc726c21-goog
next reply other threads:[~2025-09-19 0:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 0:32 Sean Christopherson [this message]
2025-09-19 0:32 ` [PATCH v2 1/5] KVM: s390/vfio-ap: Use kvm_is_gpa_in_memslot() instead of open coded equivalent Sean Christopherson
2025-09-19 6:31 ` Christian Borntraeger
2025-09-19 0:33 ` [PATCH v2 2/5] KVM: Export KVM-internal symbols for sub-modules only Sean Christopherson
2025-09-23 1:27 ` Nathan Chancellor
2025-09-23 13:40 ` Sean Christopherson
2025-09-19 0:33 ` [PATCH v2 3/5] KVM: x86: Move kvm_intr_is_single_vcpu() to lapic.c Sean Christopherson
2025-09-19 0:33 ` [PATCH v2 4/5] KVM: x86: Drop pointless exports of kvm_arch_xxx() hooks Sean Christopherson
2025-09-19 0:33 ` [PATCH v2 5/5] KVM: x86: Export KVM-internal symbols for sub-modules only Sean Christopherson
2025-10-24 12:38 ` [PATCH] KVM: Re-export kvm_enable_virtualization() and kvm_disable_virtualization() as normal (global) exports rather than only to KVM's vendor modules Ramshankar Venkataraman
2025-10-24 15:25 ` Christoph Hellwig
2025-09-27 6:02 ` [PATCH v2 0/5] KVM: Export KVM-internal symbols for sub-modules only Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250919003303.1355064-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=akrowiak@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=dengler@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=freude@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=jjherne@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=vkuznets@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox