Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7167d08e authored by Henrik Kretzschmar's avatar Henrik Kretzschmar Committed by Ingo Molnar
Browse files

x86: Rework arch_disable_smp_support() for x86



Currently arch_disable_smp_support() on x86 disables only the
support for the IOAPIC and is also compiled in if SMP-support is
not.

Therefore this function is renamed to disable_ioapic_support(),
which meets its purpose and is only compiled in the kernel
when IOAPIC support is also.

A new arch_disable_smp_support() is created in smpboot.c,
which calls disable_ioapic_support() and gets only compiled
in the kernel when SMP support is also.

Signed-off-by: default avatarHenrik Kretzschmar <henne@nachtwindheim.de>
LKML-Reference: <1298385487-4708-3-git-send-email-henne@nachtwindheim.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b6a1432d
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -175,6 +175,8 @@ extern void __init pre_init_apic_IRQ0(void);


extern void mp_save_irq(struct mpc_intsrc *m);
extern void mp_save_irq(struct mpc_intsrc *m);


extern void disable_ioapic_support(void);

#else  /* !CONFIG_X86_IO_APIC */
#else  /* !CONFIG_X86_IO_APIC */


#define io_apic_assign_pci_irqs 0
#define io_apic_assign_pci_irqs 0
@@ -189,6 +191,7 @@ struct io_apic_irq_attr;
static inline int io_apic_set_pci_routing(struct device *dev, int irq,
static inline int io_apic_set_pci_routing(struct device *dev, int irq,
		 struct io_apic_irq_attr *irq_attr) { return 0; }
		 struct io_apic_irq_attr *irq_attr) { return 0; }
static inline void mp_save_irq(struct mpc_intsrc *m) { };
static inline void mp_save_irq(struct mpc_intsrc *m) { };
static inline void disable_ioapic_support(void) { }
#endif
#endif


#endif /* _ASM_X86_IO_APIC_H */
#endif /* _ASM_X86_IO_APIC_H */
+2 −1
Original line number Original line Diff line number Diff line
@@ -43,6 +43,7 @@
#include <asm/i8259.h>
#include <asm/i8259.h>
#include <asm/proto.h>
#include <asm/proto.h>
#include <asm/apic.h>
#include <asm/apic.h>
#include <asm/io_apic.h>
#include <asm/desc.h>
#include <asm/desc.h>
#include <asm/hpet.h>
#include <asm/hpet.h>
#include <asm/idle.h>
#include <asm/idle.h>
@@ -1209,7 +1210,7 @@ void __cpuinit setup_local_APIC(void)
		rdtscll(tsc);
		rdtscll(tsc);


	if (disable_apic) {
	if (disable_apic) {
		arch_disable_smp_support();
		disable_ioapic_support();
		return;
		return;
	}
	}


+5 −2
Original line number Original line Diff line number Diff line
@@ -108,7 +108,10 @@ DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES);


int skip_ioapic_setup;
int skip_ioapic_setup;


void arch_disable_smp_support(void)
/**
 * disable_ioapic_support() - disables ioapic support at runtime
 */
void disable_ioapic_support(void)
{
{
#ifdef CONFIG_PCI
#ifdef CONFIG_PCI
	noioapicquirk = 1;
	noioapicquirk = 1;
@@ -120,7 +123,7 @@ void arch_disable_smp_support(void)
static int __init parse_noapic(char *str)
static int __init parse_noapic(char *str)
{
{
	/* disable IO-APIC */
	/* disable IO-APIC */
	arch_disable_smp_support();
	disable_ioapic_support();
	return 0;
	return 0;
}
}
early_param("noapic", parse_noapic);
early_param("noapic", parse_noapic);
+10 −1
Original line number Original line Diff line number Diff line
@@ -64,6 +64,7 @@
#include <asm/mtrr.h>
#include <asm/mtrr.h>
#include <asm/mwait.h>
#include <asm/mwait.h>
#include <asm/apic.h>
#include <asm/apic.h>
#include <asm/io_apic.h>
#include <asm/setup.h>
#include <asm/setup.h>
#include <asm/uv/uv.h>
#include <asm/uv/uv.h>
#include <linux/mc146818rtc.h>
#include <linux/mc146818rtc.h>
@@ -945,6 +946,14 @@ int __cpuinit native_cpu_up(unsigned int cpu)
	return 0;
	return 0;
}
}


/**
 * arch_disable_smp_support() - disables SMP support for x86 at runtime
 */
void arch_disable_smp_support(void)
{
	disable_ioapic_support();
}

/*
/*
 * Fall back to non SMP mode after errors.
 * Fall back to non SMP mode after errors.
 *
 *
@@ -1045,7 +1054,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
				"(tell your hw vendor)\n");
				"(tell your hw vendor)\n");
		}
		}
		smpboot_clear_io_apic();
		smpboot_clear_io_apic();
		arch_disable_smp_support();
		disable_ioapic_support();
		return -1;
		return -1;
	}
	}