[PATCH][2.5-AC] Forced enable/disable local APIC

Zwane Mwaikambo (zwane@holomorphy.com)
Tue, 5 Nov 2002 21:39:51 -0500 (EST)


The DMI stuff should be fine too.

Index: linux-2.5.45-ac1/arch/i386/kernel/apic.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.45-ac1/arch/i386/kernel/apic.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 apic.c
--- linux-2.5.45-ac1/arch/i386/kernel/apic.c 5 Nov 2002 04:47:02 -0000 1.1.1.1
+++ linux-2.5.45-ac1/arch/i386/kernel/apic.c 6 Nov 2002 00:19:38 -0000
@@ -609,11 +609,27 @@

#endif /* CONFIG_PM */

+int enable_local_apic_flag __initdata = 0; /* 0=probe, 1=force, 2=disable e.g. DMI */
+
+static int __init nolapic_setup(char *str)
+{
+ enable_local_apic_flag = 2;
+ return 1;
+}
+
+static int __init lapic_setup(char *str)
+{
+ enable_local_apic_flag = 1;
+ return 1;
+}
+
+__setup("nolapic", nolapic_setup);
+__setup("lapic", lapic_setup);
+
/*
* Detect and enable local APICs on non-SMP boards.
* Original code written by Keir Fraser.
*/
-int dont_enable_local_apic __initdata = 0;

static int __init detect_init_APIC (void)
{
@@ -621,11 +637,14 @@
extern void get_cpu_vendor(struct cpuinfo_x86*);

/* Disabled by DMI scan or kernel option? */
- if (dont_enable_local_apic)
+ if (enable_local_apic_flag == 2)
return -1;

/* Workaround for us being called before identify_cpu(). */
get_cpu_vendor(&boot_cpu_data);
+
+ if (enable_local_apic_flag == 1)
+ goto force_apic;

switch (boot_cpu_data.x86_vendor) {
case X86_VENDOR_AMD:
@@ -642,6 +661,7 @@
goto no_apic;
}

+force_apic:
if (!cpu_has_apic) {
/*
* Some BIOSes disable the local APIC in the
Index: linux-2.5.45-ac1/arch/i386/kernel/dmi_scan.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.45-ac1/arch/i386/kernel/dmi_scan.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 dmi_scan.c
--- linux-2.5.45-ac1/arch/i386/kernel/dmi_scan.c 5 Nov 2002 04:47:02 -0000 1.1.1.1
+++ linux-2.5.45-ac1/arch/i386/kernel/dmi_scan.c 6 Nov 2002 00:22:02 -0000
@@ -314,9 +314,9 @@
static int __init local_apic_kills_bios(struct dmi_blacklist *d)
{
#ifdef CONFIG_X86_LOCAL_APIC
- extern int dont_enable_local_apic;
- if (!dont_enable_local_apic) {
- dont_enable_local_apic = 1;
+ extern int enable_local_apic_flag;
+ if (!enable_local_apic_flag) {
+ enable_local_apic_flag = 2;
printk(KERN_WARNING "%s with broken BIOS detected. "
"Refusing to enable the local APIC.\n",
d->ident);
@@ -333,9 +333,9 @@
static int __init apm_kills_local_apic(struct dmi_blacklist *d)
{
#ifdef CONFIG_X86_LOCAL_APIC
- extern int dont_enable_local_apic;
- if (apm_info.bios.version && !dont_enable_local_apic) {
- dont_enable_local_apic = 1;
+ extern int enable_local_apic_flag;
+ if (apm_info.bios.version && !enable_local_apic_flag) {
+ enable_local_apic_flag = 2;
printk(KERN_WARNING "%s with broken BIOS detected. "
"Refusing to enable the local APIC.\n",
d->ident);

-- 
function.linuxpower.ca

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/