summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2025-12-06 03:43:10 +0300
committerSean Christopherson <seanjc@google.com>2026-01-12 20:31:41 +0300
commit59c3e0603d8614e0f5e17089182ca596cf3fc552 (patch)
treee6df471d04fc4e79b1194d3a9e4b242573fdb378
parent5cd6b1a6eebd564104897ca87be2812d8feafad4 (diff)
downloadlinux-59c3e0603d8614e0f5e17089182ca596cf3fc552.tar.xz
KVM: x86: Bury ioapic.h definitions behind CONFIG_KVM_IOAPIC
Now that almost everything in ioapic.h is used only by code guarded by CONFIG_KVM_IOAPIC=y, bury (almost) the entire thing behind the Kconfig. Link: https://patch.msgid.link/20251206004311.479939-9-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
-rw-r--r--arch/x86/kvm/ioapic.h14
-rw-r--r--arch/x86/kvm/lapic.c2
2 files changed, 11 insertions, 5 deletions
diff --git a/arch/x86/kvm/ioapic.h b/arch/x86/kvm/ioapic.h
index 868ed593a5c9..3dadae093690 100644
--- a/arch/x86/kvm/ioapic.h
+++ b/arch/x86/kvm/ioapic.h
@@ -6,6 +6,8 @@
#include <kvm/iodev.h>
#include "irq.h"
+#ifdef CONFIG_KVM_IOAPIC
+
struct kvm;
struct kvm_vcpu;
@@ -99,11 +101,6 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin,
bool mask);
-static inline int ioapic_in_kernel(struct kvm *kvm)
-{
- return irqchip_full(kvm);
-}
-
void kvm_rtc_eoi_tracking_restore_one(struct kvm_vcpu *vcpu);
void kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu, int vector,
int trigger_mode);
@@ -116,6 +113,13 @@ void kvm_get_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state);
void kvm_set_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state);
void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu,
ulong *ioapic_handled_vectors);
+#endif /* CONFIG_KVM_IOAPIC */
+
+static inline int ioapic_in_kernel(struct kvm *kvm)
+{
+ return irqchip_full(kvm);
+}
+
void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu,
ulong *ioapic_handled_vectors);
void kvm_scan_ioapic_irq(struct kvm_vcpu *vcpu, u32 dest_id, u16 dest_mode,
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 0a44765aba12..78c39341b2a5 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1376,10 +1376,12 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
result = 1;
+#ifdef CONFIG_KVM_IOAPIC
if (rtc_status) {
__set_bit(vcpu->vcpu_id, rtc_status->map);
rtc_status->vectors[vcpu->vcpu_id] = vector;
}
+#endif
if (apic_test_vector(vector, apic->regs + APIC_TMR) != !!trig_mode) {
if (trig_mode)