Skip to contentSkip to conversation

APIC: enable workaround on AMD Fam10h CPUs

PATCH Applied Borislav Petkov 3 participants 4 messages Feb 3, 2009 – Feb 4, 2009 x86

lore
Share & tools
lore
#0 lore raw

From: Borislav Petkov <[email protected]>
Date: Tue, 3 Feb 2009 16:24:22 +0100
Subject: [PATCH] APIC: enable workaround on AMD Fam10h CPUs

Impact: fix to enable APIC for AMD Fam10h on chipsets with a missing/b0rked
ACPI MP table (MADT)

Booting a 32bit kernel on an AMD Fam10h CPU running on chipsets with missing/b0rked MP table leads to a hang pretty early in the boot process due to the APIC not being initialized. Fix that by falling back to the default APIC base address in 32bit code, as it is done in the 64bit codepath.

---
 arch/x86/kernel/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/apic.c +1 -1
index 4b6df24..115449f 100644
@@ -1436,7 +1436,7 @@ static int __init detect_init_APIC(void)
 	switch (boot_cpu_data.x86_vendor) {
 	case X86_VENDOR_AMD:
 		if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) ||
-		    (boot_cpu_data.x86 == 15))
+		    (boot_cpu_data.x86 >= 15))
 			break;
 		goto no_apic;
 	case X86_VENDOR_INTEL:
Signature · 11 lines
1.6.0.4

-- 
Regards/Gruss,
Boris.

Operating | Advanced Micro Devices GmbH
  System  | Karl-Hammerschmidt-Str. 34, 85609 Dornach b. München, Germany
 Research | Geschäftsführer: Jochen Polster, Thomas M. McCoy, Giuliano Meroni
  Center  | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
  (OSRC)  | Registergericht München, HRB Nr. 43632
reviewer Applied
#1 lore raw
Quoted 3 lines · Borislav Petkov

From: Borislav Petkov <[email protected]>
Date: Tue, 3 Feb 2009 16:24:22 +0100
Subject: [PATCH] APIC: enable workaround on AMD Fam10h CPUs

Applied to tip:x86/urgent.

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.
#2 lore raw
In reply to Borislav Petkov
Quoted 23 lines · Borislav Petkov

From: Borislav Petkov <[email protected]>
Date: Tue, 3 Feb 2009 16:24:22 +0100
Subject: [PATCH] APIC: enable workaround on AMD Fam10h CPUs

Impact: fix to enable APIC for AMD Fam10h on chipsets with a missing/b0rked
ACPI MP table (MADT)

Booting a 32bit kernel on an AMD Fam10h CPU running on chipsets with missing/b0rked MP table leads to a hang pretty early in the boot process due to the APIC not being initialized. Fix that by falling back to the default APIC base address in 32bit code, as it is done in the 64bit codepath.

---
 arch/x86/kernel/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/apic.c +0 -0
index 4b6df24..115449f 100644

arch/x86/kernel/apic.c static int __init detect_init_APIC(void) · line 1442

Quoted 8 lines
arch/x86/kernel/apic.c +1 -1
@@ -1436,7 +1436,7 @@ static int __init detect_init_APIC(void)
 	switch (boot_cpu_data.x86_vendor) {
 	case X86_VENDOR_AMD:
 		if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) ||
-		    (boot_cpu_data.x86 == 15))
+		    (boot_cpu_data.x86 >= 15))
 			break;
 		goto no_apic;
 	case X86_VENDOR_INTEL:

Hi Borislav,

Could this have anything to do with my Phenom-II problem that you've been so kind to help me with?

Thanks
Mark

#3 lore raw
Quoted 35 lines · Mark Hounschell
Quoted 23 lines · Borislav Petkov

From: Borislav Petkov <[email protected]>
Date: Tue, 3 Feb 2009 16:24:22 +0100
Subject: [PATCH] APIC: enable workaround on AMD Fam10h CPUs

Impact: fix to enable APIC for AMD Fam10h on chipsets with a missing/b0rked
ACPI MP table (MADT)

Booting a 32bit kernel on an AMD Fam10h CPU running on chipsets with missing/b0rked MP table leads to a hang pretty early in the boot process due to the APIC not being initialized. Fix that by falling back to the default APIC base address in 32bit code, as it is done in the 64bit codepath.

---
 arch/x86/kernel/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/apic.c +0 -0
index 4b6df24..115449f 100644

arch/x86/kernel/apic.c static int __init detect_init_APIC(void) · line 1442

Quoted 8 lines
arch/x86/kernel/apic.c +1 -1
@@ -1436,7 +1436,7 @@ static int __init detect_init_APIC(void)
 	switch (boot_cpu_data.x86_vendor) {
 	case X86_VENDOR_AMD:
 		if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) ||
-		    (boot_cpu_data.x86 == 15))
+		    (boot_cpu_data.x86 >= 15))
 			break;
 		goto no_apic;
 	case X86_VENDOR_INTEL:

Hi Borislav,

Quoted 6 lines

Could this have anything to do with my Phenom-II problem that you've been so kind to help me with?

Thanks
Mark

Well, we thought so originally but since a 64bit kernel fails booting on your machine too, it can't be it because this is a 32bit codepath issue.

Another question: does your machine boot a tickless kernel (CONFIG_NO_HZ enabled)?

Signature · 8 lines
Regards/Gruss,
Boris.

Operating | Advanced Micro Devices GmbH
  System  | Karl-Hammerschmidt-Str. 34, 85609 Dornach b. München, Germany
 Research | Geschäftsführer: Jochen Polster, Thomas M. McCoy, Giuliano Meroni
  Center  | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
  (OSRC)  | Registergericht München, HRB Nr. 43632