Skip to content

Commit 59c3e06

Browse files
committed
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>
1 parent 5cd6b1a commit 59c3e06

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

arch/x86/kvm/ioapic.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include <kvm/iodev.h>
77
#include "irq.h"
88

9+
#ifdef CONFIG_KVM_IOAPIC
10+
911
struct kvm;
1012
struct kvm_vcpu;
1113

@@ -99,11 +101,6 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
99101
void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin,
100102
bool mask);
101103

102-
static inline int ioapic_in_kernel(struct kvm *kvm)
103-
{
104-
return irqchip_full(kvm);
105-
}
106-
107104
void kvm_rtc_eoi_tracking_restore_one(struct kvm_vcpu *vcpu);
108105
void kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu, int vector,
109106
int trigger_mode);
@@ -116,6 +113,13 @@ void kvm_get_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state);
116113
void kvm_set_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state);
117114
void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu,
118115
ulong *ioapic_handled_vectors);
116+
#endif /* CONFIG_KVM_IOAPIC */
117+
118+
static inline int ioapic_in_kernel(struct kvm *kvm)
119+
{
120+
return irqchip_full(kvm);
121+
}
122+
119123
void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu,
120124
ulong *ioapic_handled_vectors);
121125
void kvm_scan_ioapic_irq(struct kvm_vcpu *vcpu, u32 dest_id, u16 dest_mode,

arch/x86/kvm/lapic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,10 +1376,12 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
13761376

13771377
result = 1;
13781378

1379+
#ifdef CONFIG_KVM_IOAPIC
13791380
if (rtc_status) {
13801381
__set_bit(vcpu->vcpu_id, rtc_status->map);
13811382
rtc_status->vectors[vcpu->vcpu_id] = vector;
13821383
}
1384+
#endif
13831385

13841386
if (apic_test_vector(vector, apic->regs + APIC_TMR) != !!trig_mode) {
13851387
if (trig_mode)

0 commit comments

Comments
 (0)