Commit ba801640 authored by Thomas Gleixner's avatar Thomas Gleixner

x86/vector: Compile SMP only code conditionally

No point in compiling this for UP.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarJuergen Gross <jgross@suse.com>
Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
Acked-by: default avatarJuergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Alok Kataria <akataria@vmware.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Rui Zhang <rui.zhang@intel.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Len Brown <lenb@kernel.org>
Link: https://lkml.kernel.org/r/20170913213155.603191841@linutronix.de
parent baab1e84
...@@ -450,6 +450,7 @@ int __init arch_early_irq_init(void) ...@@ -450,6 +450,7 @@ int __init arch_early_irq_init(void)
return arch_early_ioapic_init(); return arch_early_ioapic_init();
} }
#ifdef CONFIG_SMP
/* Temporary hack to keep things working */ /* Temporary hack to keep things working */
static void vector_update_shutdown_irqs(void) static void vector_update_shutdown_irqs(void)
{ {
...@@ -517,6 +518,25 @@ void lapic_offline(void) ...@@ -517,6 +518,25 @@ void lapic_offline(void)
unlock_vector_lock(); unlock_vector_lock();
} }
static int apic_set_affinity(struct irq_data *irqd,
const struct cpumask *dest, bool force)
{
int err;
if (!IS_ENABLED(CONFIG_SMP))
return -EPERM;
if (!cpumask_intersects(dest, cpu_online_mask))
return -EINVAL;
err = assign_irq_vector(irqd, dest);
return err ? err : IRQ_SET_MASK_OK;
}
#else
# define apic_set_affinity NULL
#endif
static int apic_retrigger_irq(struct irq_data *irqd) static int apic_retrigger_irq(struct irq_data *irqd)
{ {
struct apic_chip_data *apicd = apic_chip_data(irqd); struct apic_chip_data *apicd = apic_chip_data(irqd);
...@@ -536,21 +556,6 @@ void apic_ack_edge(struct irq_data *irqd) ...@@ -536,21 +556,6 @@ void apic_ack_edge(struct irq_data *irqd)
ack_APIC_irq(); ack_APIC_irq();
} }
static int apic_set_affinity(struct irq_data *irqd,
const struct cpumask *dest, bool force)
{
int err;
if (!IS_ENABLED(CONFIG_SMP))
return -EPERM;
if (!cpumask_intersects(dest, cpu_online_mask))
return -EINVAL;
err = assign_irq_vector(irqd, dest);
return err ? err : IRQ_SET_MASK_OK;
}
static struct irq_chip lapic_controller = { static struct irq_chip lapic_controller = {
.name = "APIC", .name = "APIC",
.irq_ack = apic_ack_edge, .irq_ack = apic_ack_edge,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment