Skip to contentSkip to conversation

x86: Use x2apic physical mode based on FADT setting

PATCH Superseded Greg Pearson 2 participants 2 messages Apr 24, 2012 x86

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Use x2apic physical mode based on FADT setting

Provide systems that do not support x2apic cluster mode a mechanism to select x2apic physical mode using the FADT FORCE_APIC_PHYSICAL_DESTINATION_MODE bit.

---
 arch/x86/kernel/apic/x2apic_phys.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
arch/x86/kernel/apic/x2apic_phys.c +12 -0
index 8a778db..c372926 100644
@@ -6,6 +6,10 @@
 #include <linux/init.h>
 #include <linux/dmar.h>
 
+#ifdef CONFIG_ACPI
+#include <linux/acpi.h>
+#endif
+
 #include <asm/smp.h>
 #include <asm/x2apic.h>
 
@@ -24,6 +28,14 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
 	if (x2apic_phys)
 		return x2apic_enabled();
+#ifdef CONFIG_ACPI
+	else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
+		(acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) &&
+		x2apic_enabled()) {
+		printk(KERN_DEBUG "System requires x2apic physical mode\n");
+		return 1;
+	}
+#endif
 	else
 		return 0;
 }
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 14 lines · Greg Pearson

Provide systems that do not support x2apic cluster mode a mechanism to select x2apic physical mode using the FADT FORCE_APIC_PHYSICAL_DESTINATION_MODE bit.

---
 arch/x86/kernel/apic/x2apic_phys.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
arch/x86/kernel/apic/x2apic_phys.c +0 -0
index 8a778db..c372926 100644

arch/x86/kernel/apic/x2apic_phys.c line 11

Quoted 6 lines
arch/x86/kernel/apic/x2apic_phys.c +3 -0
@@ -6,6 +6,10 @@
 #include <linux/init.h>
 #include <linux/dmar.h>
 
+#ifdef CONFIG_ACPI
+#include <linux/acpi.h>
+#endif

dmar.h already includes acpi.h

Quoted 6 lines
arch/x86/kernel/apic/x2apic_phys.c +1 -0
+
 #include <asm/smp.h>
 #include <asm/x2apic.h>
 
@@ -24,6 +28,14 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {

arch/x86/kernel/apic/x2apic_phys.c static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) · line 38

Quoted 10 lines
arch/x86/kernel/apic/x2apic_phys.c +8 -0
 	if (x2apic_phys)
 		return x2apic_enabled();
+#ifdef CONFIG_ACPI
+	else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
+		(acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) &&
+		x2apic_enabled()) {
+		printk(KERN_DEBUG "System requires x2apic physical mode\n");
+		return 1;
+	}
+#endif

x2apic is already dependent on irq-remapping which depends on ACPI. So I think you can do away with those ifdef CONFIG_ACPI.

Also, which system requires this? If you can include the information in the changelog that will be great.

thanks,
suresh