public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] Automatically enable bigsmp on big HP machines
@ 2004-08-06  0:54 Pallipadi, Venkatesh
  2004-08-06  1:01 ` Andi Kleen
  0 siblings, 1 reply; 8+ messages in thread
From: Pallipadi, Venkatesh @ 2004-08-06  0:54 UTC (permalink / raw)
  To: Andi Kleen, akpm; +Cc: linux-kernel



Instead of handling these individually for particular systems, 
can't we just switch to bigsmp whenever we see more than 8 CPU 
in the CPU enumeration and no other subarchitecture is selected by 
any dmi override.

I had some patch that does soemthing like this, a while back. If 
you are OK with the idea, I can dig out that patch and send it. 

Thanks,
Venki

>-----Original Message-----
>From: linux-kernel-owner@vger.kernel.org 
>[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Andi Kleen
>Sent: Thursday, August 05, 2004 5:39 AM
>To: akpm@osdl.org
>Cc: linux-kernel@vger.kernel.org
>Subject: [PATCH] Automatically enable bigsmp on big HP machines
>
>
>This enables apic=bigsmp automatically on some big HP machines 
>that need it. 
>This makes them boot without kernel parameters on a generic 
>arch kernel.
>
>Also it removes an unnecessary panic in the same area.
>
>-Andi
>
>diff -u linux-2.6.7/arch/i386/kernel/dmi_scan.c-HP 
>linux-2.6.7/arch/i386/kernel/dmi_scan.c
>--- linux-2.6.7/arch/i386/kernel/dmi_scan.c-HP	2004-08-05 
>14:00:29.325072566 +0200
>+++ linux-2.6.7/arch/i386/kernel/dmi_scan.c	2004-08-05 
>14:19:57.058593500 +0200
>@@ -272,6 +272,16 @@
> }  
> #endif
> 
>+static __init int hp_ht_bigsmp(struct dmi_blacklist *d) 
>+{ 
>+#ifdef CONFIG_X86_GENERICARCH
>+ 	extern int dmi_bigsmp;
>+ 	printk(KERN_NOTICE "%s detected: force use of 
>apic=bigsmp\n", d->ident);
>+ 	dmi_bigsmp = 1;
>+#endif
>+ 	return 0;
>+} 
>+
> /*
>  *	Process the DMI blacklists
>  */
>@@ -460,6 +455,17 @@
> #endif	// CONFIG_ACPI_BOOT
> 
> #ifdef	CONFIG_ACPI_PCI
>+
>+	{ hp_ht_bigsmp, "HP ProLiant DL760 G2", {
>+			MATCH(DMI_BIOS_VENDOR, "HP"),
>+			MATCH(DMI_BIOS_VERSION, "P44-"),
>+			NO_MATCH, NO_MATCH }},
>+
>+	{ hp_ht_bigsmp, "HP ProLiant DL740", {
>+			MATCH(DMI_BIOS_VENDOR, "HP"),
>+			MATCH(DMI_BIOS_VERSION, "P47-"),
>+			NO_MATCH, NO_MATCH }},
>+
> 	/*
> 	 *	Boxes that need ACPI PCI IRQ routing disabled
> 	 */
>diff -u linux-2.6.7/arch/i386/kernel/io_apic.c-HP 
>linux-2.6.7/arch/i386/kernel/io_apic.c
>--- linux-2.6.7/arch/i386/kernel/io_apic.c-HP	2004-08-05 
>14:00:29.328072077 +0200
>+++ linux-2.6.7/arch/i386/kernel/io_apic.c	2004-08-05 
>14:17:49.595383418 +0200
>@@ -1714,7 +1714,7 @@
> 		reg_00.raw = io_apic_read(apic, 0);
> 		spin_unlock_irqrestore(&ioapic_lock, flags);
> 		if (reg_00.bits.ID != mp_ioapics[apic].mpc_apicid)
>-			panic("could not set ID!\n");
>+			printk(" could not set ID!\n");
> 		else
> 			printk(" ok.\n");
> 	}
>-
>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/
>

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: [PATCH] Automatically enable bigsmp on big HP machines
@ 2004-08-06 18:02 Pallipadi, Venkatesh
  0 siblings, 0 replies; 8+ messages in thread
From: Pallipadi, Venkatesh @ 2004-08-06 18:02 UTC (permalink / raw)
  To: Andi Kleen; +Cc: akpm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 723 bytes --]


>-----Original Message-----
>From: Andi Kleen [mailto:ak@suse.de] 
>
>This won't work on big AMD boxes I think. They don't have a XAPIC.
>
>The other subarchitectures (es7000,summit) are usually 
>selected using ACPI 
>OEM tablesnow, you would need to make sure that it happens after that.
>
>Can you check that the there is really an XAPIC compatible APIC
>somewhere in the system? (e.g. by reading the version number 
>from the APIC?)
>Then I guess it would be ok.
>
>-Andi


Here is the patch that I have.
Somewhat tricky, it calls bigsmp_probe twice and default is 
no longer the last probe. But, I think this is the right way 
to identify bigsmp capable systems automatically.

Thanks,
Venki

[-- Attachment #2: bigsmp-default.patch --]
[-- Type: application/octet-stream, Size: 4434 bytes --]

--- linux-2.6.8-rc2/arch/i386/kernel/setup.c.org	2004-08-06 12:48:07.000000000 -0700
+++ linux-2.6.8-rc2/arch/i386/kernel/setup.c	2004-08-06 13:16:20.000000000 -0700
@@ -51,6 +51,12 @@
 #include "setup_arch_pre.h"
 #include <bios_ebda.h>
 
+#ifdef  CONFIG_X86_LOCAL_APIC
+#include <mach_apic.h>
+#include <mach_mpparse.h>
+#endif  /* CONFIG_X86_LOCAL_APIC */
+
+
 /* This value is set up by the early boot code to point to the value
    immediately after the boot time page tables.  It contains a *physical*
    address, and must not be in the .bss segment! */
@@ -1370,12 +1376,8 @@ void __init setup_arch(char **cmdline_p)
 	}
 #endif
 
-
 	dmi_scan_machine();
 
-#ifdef CONFIG_X86_GENERICARCH
-	generic_apic_probe(*cmdline_p);
-#endif	
 	if (efi_enabled)
 		efi_map_memmap();
 
@@ -1389,6 +1391,14 @@ void __init setup_arch(char **cmdline_p)
 		get_smp_config();
 #endif
 
+#ifdef CONFIG_X86_GENERICARCH
+	generic_apic_probe(*cmdline_p);
+#endif	
+
+#ifdef  CONFIG_X86_LOCAL_APIC
+	clustered_apic_check();
+#endif
+
 	register_memory(max_low_pfn);
 
 #ifdef CONFIG_VT
--- linux-2.6.8-rc2/arch/i386/kernel/mpparse.c.org	2004-08-06 11:05:36.000000000 -0700
+++ linux-2.6.8-rc2/arch/i386/kernel/mpparse.c	2004-08-06 13:01:18.000000000 -0700
@@ -65,6 +65,9 @@ int nr_ioapics;
 int pic_mode;
 unsigned long mp_lapic_addr;
 
+unsigned long def_to_bigsmp = 0;
+static unsigned long xapic_support = 1;
+
 /* Processor that is doing the boot up */
 unsigned int boot_cpu_physical_apicid = -1U;
 unsigned int boot_cpu_logical_apicid = -1U;
@@ -215,6 +218,14 @@ void __init MP_processor_info (struct mp
 		ver = 0x10;
 	}
 	apic_version[m->mpc_apicid] = ver;
+	if (!APIC_XAPIC(ver))
+		xapic_support = 0;
+
+	if ((num_processors > 8) && xapic_support)
+		def_to_bigsmp = 1;
+	else
+		def_to_bigsmp = 0;
+
 	bios_cpu_apicid[num_processors - 1] = m->mpc_apicid;
 }
 
@@ -481,7 +492,6 @@ static int __init smp_read_mpc(struct mp
 		}
 		++mpc_record;
 	}
-	clustered_apic_check();
 	if (!num_processors)
 		printk(KERN_ERR "SMP mptable: no processors registered!\n");
 	return num_processors;
--- linux-2.6.8-rc2/arch/i386/kernel/acpi/boot.c.org	2004-08-06 13:02:15.000000000 -0700
+++ linux-2.6.8-rc2/arch/i386/kernel/acpi/boot.c	2004-08-06 13:02:23.000000000 -0700
@@ -40,7 +40,6 @@
 #ifdef	CONFIG_X86_64
 
 static inline void  acpi_madt_oem_check(char *oem_id, char *oem_table_id) { }
-static inline void clustered_apic_check(void) { }
 static inline int ioapic_setup_disabled(void) { return 0; }
 #include <asm/proto.h>
 
@@ -766,7 +765,6 @@ acpi_process_madt(void)
 				acpi_ioapic = 1;
 
 				smp_found_config = 1;
-				clustered_apic_check();
 			}
 		}
 		if (error == -EINVAL) {
--- linux-2.6.8-rc2/include/asm-i386/mpspec.h.org	2004-08-06 11:32:26.000000000 -0700
+++ linux-2.6.8-rc2/include/asm-i386/mpspec.h	2004-08-06 11:33:08.000000000 -0700
@@ -11,6 +11,7 @@ extern int mp_bus_id_to_local [MAX_MP_BU
 extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
 extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES];
 
+extern unsigned long def_to_bigsmp;
 extern unsigned int boot_cpu_physical_apicid;
 extern int smp_found_config;
 extern void find_smp_config (void);
--- linux-2.6.8-rc2/include/asm-i386/apicdef.h.org	2004-08-06 11:14:39.000000000 -0700
+++ linux-2.6.8-rc2/include/asm-i386/apicdef.h	2004-08-06 11:19:16.000000000 -0700
@@ -16,6 +16,7 @@
 #define			GET_APIC_VERSION(x)	((x)&0xFF)
 #define			GET_APIC_MAXLVT(x)	(((x)>>16)&0xFF)
 #define			APIC_INTEGRATED(x)	((x)&0xF0)
+#define			APIC_XAPIC(x)		((x)&0x14)
 #define		APIC_TASKPRI	0x80
 #define			APIC_TPRI_MASK		0xFF
 #define		APIC_ARBPRI	0x90
--- linux-2.6.8-rc2/arch/i386/mach-generic/probe.c.org	2004-08-06 11:33:53.000000000 -0700
+++ linux-2.6.8-rc2/arch/i386/mach-generic/probe.c	2004-08-06 12:38:45.000000000 -0700
@@ -26,7 +26,8 @@ struct genapic *apic_probe[] __initdata 
 	&apic_summit,
 	&apic_bigsmp, 
 	&apic_es7000,
-	&apic_default,	/* must be last */
+	&apic_default,
+	&apic_bigsmp, 
 	NULL,
 };
 
--- linux-2.6.8-rc2/arch/i386/mach-generic/default.c.org	2004-08-06 11:34:21.000000000 -0700
+++ linux-2.6.8-rc2/arch/i386/mach-generic/default.c	2004-08-06 13:09:29.000000000 -0700
@@ -18,9 +18,14 @@
 #include <asm/mach-default/mach_ipi.h>
 #include <asm/mach-default/mach_mpparse.h>
 
-/* should be called last. */
+extern int dmi_bigsmp;
+
 static __init int probe_default(void)
 { 
+	if (def_to_bigsmp) {
+		dmi_bigsmp = 1;
+		return 0;
+	}
 	return 1;
 } 
 

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH] Automatically enable bigsmp on big HP machines
@ 2004-08-05 12:38 Andi Kleen
  2004-08-05 13:03 ` Arjan van de Ven
  0 siblings, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2004-08-05 12:38 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel


This enables apic=bigsmp automatically on some big HP machines that need it. 
This makes them boot without kernel parameters on a generic arch kernel.

Also it removes an unnecessary panic in the same area.

-Andi

diff -u linux-2.6.7/arch/i386/kernel/dmi_scan.c-HP linux-2.6.7/arch/i386/kernel/dmi_scan.c
--- linux-2.6.7/arch/i386/kernel/dmi_scan.c-HP	2004-08-05 14:00:29.325072566 +0200
+++ linux-2.6.7/arch/i386/kernel/dmi_scan.c	2004-08-05 14:19:57.058593500 +0200
@@ -272,6 +272,16 @@
 }  
 #endif
 
+static __init int hp_ht_bigsmp(struct dmi_blacklist *d) 
+{ 
+#ifdef CONFIG_X86_GENERICARCH
+ 	extern int dmi_bigsmp;
+ 	printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
+ 	dmi_bigsmp = 1;
+#endif
+ 	return 0;
+} 
+
 /*
  *	Process the DMI blacklists
  */
@@ -460,6 +455,17 @@
 #endif	// CONFIG_ACPI_BOOT
 
 #ifdef	CONFIG_ACPI_PCI
+
+	{ hp_ht_bigsmp, "HP ProLiant DL760 G2", {
+			MATCH(DMI_BIOS_VENDOR, "HP"),
+			MATCH(DMI_BIOS_VERSION, "P44-"),
+			NO_MATCH, NO_MATCH }},
+
+	{ hp_ht_bigsmp, "HP ProLiant DL740", {
+			MATCH(DMI_BIOS_VENDOR, "HP"),
+			MATCH(DMI_BIOS_VERSION, "P47-"),
+			NO_MATCH, NO_MATCH }},
+
 	/*
 	 *	Boxes that need ACPI PCI IRQ routing disabled
 	 */
diff -u linux-2.6.7/arch/i386/kernel/io_apic.c-HP linux-2.6.7/arch/i386/kernel/io_apic.c
--- linux-2.6.7/arch/i386/kernel/io_apic.c-HP	2004-08-05 14:00:29.328072077 +0200
+++ linux-2.6.7/arch/i386/kernel/io_apic.c	2004-08-05 14:17:49.595383418 +0200
@@ -1714,7 +1714,7 @@
 		reg_00.raw = io_apic_read(apic, 0);
 		spin_unlock_irqrestore(&ioapic_lock, flags);
 		if (reg_00.bits.ID != mp_ioapics[apic].mpc_apicid)
-			panic("could not set ID!\n");
+			printk(" could not set ID!\n");
 		else
 			printk(" ok.\n");
 	}

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-08-06 18:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-06  0:54 [PATCH] Automatically enable bigsmp on big HP machines Pallipadi, Venkatesh
2004-08-06  1:01 ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2004-08-06 18:02 Pallipadi, Venkatesh
2004-08-05 12:38 Andi Kleen
2004-08-05 13:03 ` Arjan van de Ven
2004-08-05 13:34   ` Andi Kleen
2004-08-05 14:14     ` Arjan van de Ven
2004-08-05 14:19       ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox