Skip to contentSkip to conversation

x86: update_mptable need pci_routeirq

PATCH In review Yinghai Lu 3 participants 14 messages May 15, 2009 – May 18, 2009

Subsystems (2)
lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86: update_mptable need pci_routeirq

to get all device irq routing and save them

---
 arch/x86/kernel/mpparse.c |    3 +++
 1 file changed, 3 insertions(+)
arch/x86/kernel/mpparse.c +3 -0
Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================
@@ -17,6 +17,7 @@
 #include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/smp.h>
+#include <linux/pci.h>
 
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>
@@ -961,6 +962,7 @@ static int __initdata enable_update_mpta
 static int __init update_mptable_setup(char *str)
 {
 	enable_update_mptable = 1;
+	pci_routeirq = 1;
 	return 0;
 }
 early_param("update_mptable", update_mptable_setup);
@@ -973,6 +975,7 @@ static int __initdata alloc_mptable;
 static int __init parse_alloc_mptable_opt(char *p)
 {
 	enable_update_mptable = 1;
+	pci_routeirq = 1;
 	alloc_mptable = 1;
 	if (!p)
 		return 0;
author
#1 lore raw

PATCH 1/1 x86/acpi: don't call mp_config_acpi_gsi if update_mptable is not used

Len doesn't want mp code is called from acpi code.

[ Impact: less touch code flow for acpi code ]

---
 arch/x86/include/asm/mpspec.h |    1 +
 arch/x86/kernel/acpi/boot.c   |    4 +++-
 arch/x86/kernel/mpparse.c     |    2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)
arch/x86/include/asm/mpspec.h +1 -0
Index: linux-2.6/arch/x86/include/asm/mpspec.h
===================================================================
@@ -72,6 +72,7 @@ extern void mp_register_ioapic(int id, u
 extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
 				   u32 gsi);
 extern void mp_config_acpi_legacy_irqs(void);
+extern int enable_update_mptable;
 struct device;
 extern int mp_register_gsi(struct device *dev, u32 gsi, int edge_level,
 				 int active_high_low);
arch/x86/kernel/acpi/boot.c +3 -1
Index: linux-2.6/arch/x86/kernel/acpi/boot.c
===================================================================
@@ -1226,7 +1226,9 @@ int mp_register_gsi(struct device *dev,
 		       ioapic_pin);
 		return gsi;
 	}
-	mp_config_acpi_gsi(dev, gsi, trigger, polarity);
+
+	if (enable_update_mptable)
+		mp_config_acpi_gsi(dev, gsi, trigger, polarity);
 
 	set_io_apic_irq_attr(&irq_attr, ioapic, ioapic_pin,
 			     trigger == ACPI_EDGE_SENSITIVE ? 0 : 1,
arch/x86/kernel/mpparse.c +1 -1
Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================
@@ -957,7 +957,7 @@ out:
 	return 0;
 }
 
-static int __initdata enable_update_mptable;
+int enable_update_mptable;
 
 static int __init update_mptable_setup(char *str)
 {
#2 lore raw

[tip:irq/numa] x86, irq: don't call mp_config_acpi_gsi() if update_mptable is not enabled

Commit-ID:  f1bdb523880c7f6990e9e8e50b0fc972ca475e84
Gitweb:     http://git.kernel.org/tip/f1bdb523880c7f6990e9e8e50b0fc972ca475e84
Author:     Yinghai Lu <[email protected]>
AuthorDate: Fri, 15 May 2009 13:05:16 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 18 May 2009 09:33:29 +0200

x86, irq: don't call mp_config_acpi_gsi() if update_mptable is not enabled

Len expressed concern that the update_mptable feature has side-effects on the ACPI code.

Make it sure explicitly that the code only ever gets called if the (default disabled) update_mptable boot quirk option is disabled.

[ Impact: isolate the update_mptable feature from ACPI code more ]

LKML-Reference: <[email protected]>

---
 arch/x86/include/asm/mpspec.h |    9 +++++++++
 arch/x86/kernel/acpi/boot.c   |    4 +++-
 arch/x86/kernel/mpparse.c     |    2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)
arch/x86/include/asm/mpspec.h +9 -0
index c34961a..3dcbaaa 100644
@@ -87,6 +87,15 @@ static inline int acpi_probe_gsi(void)
 }
 #endif /* CONFIG_ACPI */
 
+#ifdef CONFIG_X86_MPPARSE
+extern int enable_update_mptable;
+#else
+static inline int enable_update_mptable(void)
+{
+	return 0;
+}
+#endif
+
 #define PHYSID_ARRAY_SIZE	BITS_TO_LONGS(MAX_APICS)
 
 struct physid_mask {
arch/x86/kernel/acpi/boot.c +3 -1
index 4af63df..844e5e2 100644
@@ -1226,7 +1226,9 @@ int mp_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
 		       ioapic_pin);
 		return gsi;
 	}
-	mp_config_acpi_gsi(dev, gsi, trigger, polarity);
+
+	if (enable_update_mptable)
+		mp_config_acpi_gsi(dev, gsi, trigger, polarity);
 
 	set_io_apic_irq_attr(&irq_attr, ioapic, ioapic_pin,
 			     trigger == ACPI_EDGE_SENSITIVE ? 0 : 1,
arch/x86/kernel/mpparse.c +1 -1
index e6bf9d0..651c93b 100644
@@ -957,7 +957,7 @@ out:
 	return 0;
 }
 
-static int __initdata enable_update_mptable;
+int enable_update_mptable;
 
 static int __init update_mptable_setup(char *str)
 {
#3 lore raw
In reply to Yinghai Lu
Quoted 1 line · Yinghai Lu

to get all device irq routing and save them

This changelog isn't really enough for me to understand what's going on.

Quoted 13 lines

Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================

arch/x86/kernel/mpparse.c +1 -0
@@ -17,6 +17,7 @@
 #include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/smp.h>
+#include <linux/pci.h>
 
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 965

Quoted 4 lines
arch/x86/kernel/mpparse.c +1 -0
@@ -961,6 +962,7 @@ static int __initdata enable_update_mpta
 static int __init update_mptable_setup(char *str)
 {
 	enable_update_mptable = 1;
+	pci_routeirq = 1;

I hate to see new uses of pci_routeirq. It'd be nice to remove it completely someday. But maybe it can't be helped.

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 968

Quoted 3 lines
arch/x86/kernel/mpparse.c +0 -0
 	return 0;
 }
 early_param("update_mptable", update_mptable_setup);

"update_mptable" is apparently a boot option, but it's not mentioned in Documentation/kernel-parameters.txt. Is this some sort of debug code or BIOS-writer's helper? Same with "alloc_mptable". Why do we have this stuff?

Quoted 8 lines
arch/x86/kernel/mpparse.c +1 -0
@@ -973,6 +975,7 @@ static int __initdata alloc_mptable;
 static int __init parse_alloc_mptable_opt(char *p)
 {
 	enable_update_mptable = 1;
+	pci_routeirq = 1;
 	alloc_mptable = 1;
 	if (!p)
 		return 0;
author
#4 lore raw
Quoted 27 lines · Bjorn Helgaas
Quoted 1 line · Yinghai Lu

to get all device irq routing and save them

This changelog isn't really enough for me to understand what's going on.

Quoted 13 lines

Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================

arch/x86/kernel/mpparse.c +1 -0
@@ -17,6 +17,7 @@
 #include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/smp.h>
+#include <linux/pci.h>
 
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 965

Quoted 4 lines
arch/x86/kernel/mpparse.c +1 -0
@@ -961,6 +962,7 @@ static int __initdata enable_update_mpta
 static int __init update_mptable_setup(char *str)
 {
 	enable_update_mptable = 1;
+	pci_routeirq = 1;

I hate to see new uses of pci_routeirq. It'd be nice to remove it completely someday. But maybe it can't be helped.

Quoted 9 lines

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 968

Quoted 3 lines
arch/x86/kernel/mpparse.c +0 -0
 	return 0;
 }
 early_param("update_mptable", update_mptable_setup);

"update_mptable" is apparently a boot option, but it's not mentioned in Documentation/kernel-parameters.txt. Is this some sort of debug code or BIOS-writer's helper? Same with "alloc_mptable". Why do we have this stuff?

1. kexec path: after acpi kernel and use kexec to load kerenl with mptable support only or acpi=off
2. help to BIOS engineer to understand how to set mptable and irq routing setup by chipset. esp system have several cards and there is bridge in those cards.

YH

#5 lore raw
Quoted 38 lines · Yinghai Lu
Quoted 27 lines · Bjorn Helgaas
Quoted 1 line · Yinghai Lu

to get all device irq routing and save them

This changelog isn't really enough for me to understand what's going on.

Quoted 13 lines

Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================

arch/x86/kernel/mpparse.c +1 -0
@@ -17,6 +17,7 @@
 #include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/smp.h>
+#include <linux/pci.h>
 
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 965

Quoted 4 lines
arch/x86/kernel/mpparse.c +1 -0
@@ -961,6 +962,7 @@ static int __initdata enable_update_mpta
 static int __init update_mptable_setup(char *str)
 {
 	enable_update_mptable = 1;
+	pci_routeirq = 1;

I hate to see new uses of pci_routeirq. It'd be nice to remove it completely someday. But maybe it can't be helped.

Quoted 9 lines

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 968

Quoted 3 lines
arch/x86/kernel/mpparse.c +0 -0
 	return 0;
 }
 early_param("update_mptable", update_mptable_setup);

"update_mptable" is apparently a boot option, but it's not mentioned in Documentation/kernel-parameters.txt. Is this some sort of debug code or BIOS-writer's helper? Same with "alloc_mptable". Why do we have this stuff?

Quoted 3 lines

1. kexec path: after acpi kernel and use kexec to load kerenl with mptable support only or acpi=off
2. help to BIOS engineer to understand how to set mptable and irq routing setup by chipset. esp system have several cards and there is bridge in those cards.

I was sort of hoping for a Documentation/kernel-parameters.txt patch.

Is (1) common enough to worry about? What OSes don't have ACPI support? What advantage is there to using "acpi=off"?

(2) sounds like something that should be under a config option, if it's in the mainline kernel at all.

Bjorn

author
#6 lore raw
Quoted 35 lines · Bjorn Helgaas
Quoted 34 lines · Yinghai Lu
Quoted 33 lines · Bjorn Helgaas
Quoted 1 line · Yinghai Lu

to get all device irq routing and save them

This changelog isn't really enough for me to understand what's going on.

Quoted 13 lines

Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================

arch/x86/kernel/mpparse.c +1 -0
@@ -17,6 +17,7 @@
 #include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/smp.h>
+#include <linux/pci.h>
 
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 965

Quoted 4 lines
arch/x86/kernel/mpparse.c +1 -0
@@ -961,6 +962,7 @@ static int __initdata enable_update_mpta
 static int __init update_mptable_setup(char *str)
 {
 	enable_update_mptable = 1;
+	pci_routeirq = 1;

I hate to see new uses of pci_routeirq. It'd be nice to remove it completely someday. But maybe it can't be helped.

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 968

Quoted 3 lines
arch/x86/kernel/mpparse.c +0 -0
 	return 0;
 }
 early_param("update_mptable", update_mptable_setup);

"update_mptable" is apparently a boot option, but it's not mentioned in Documentation/kernel-parameters.txt. Is this some sort of debug code or BIOS-writer's helper? Same with "alloc_mptable". Why do we have this stuff?

Quoted 5 lines
Quoted 3 lines

1. kexec path: after acpi kernel and use kexec to load kerenl with mptable support only or acpi=off
2. help to BIOS engineer to understand how to set mptable and irq routing setup by chipset. esp system have several cards and there is bridge in those cards.

I was sort of hoping for a Documentation/kernel-parameters.txt patch.

current we have half commited in mainline.
missed the calling in drivers/acpi

and we are trying to move the calling to arch/x86/kernel/acpi/boot.c hope Len will buy it.

Quoted 3 lines

Is (1) common enough to worry about? What OSes don't have ACPI support? What advantage is there to using "acpi=off"?

some other "OS" still use half ACPI tables... MADT etc. but still use mptable for irq routing.

some one want to disable acpi, because acpid is using 100%...

Quoted 3 lines

(2) sounds like something that should be under a config option, if it's in the mainline kernel at all.

sure, will make it as one CONFIG option that depends on ACPI.

Thanks

YH

#7 lore raw
Quoted 39 lines · Yinghai Lu
Quoted 30 lines · Bjorn Helgaas
Quoted 29 lines · Yinghai Lu
Quoted 28 lines · Bjorn Helgaas
Quoted 1 line · Yinghai Lu

to get all device irq routing and save them

This changelog isn't really enough for me to understand what's going on.

Quoted 13 lines

Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================

arch/x86/kernel/mpparse.c +1 -0
@@ -17,6 +17,7 @@
 #include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/smp.h>
+#include <linux/pci.h>
 
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 965

Quoted 4 lines
arch/x86/kernel/mpparse.c +1 -0
@@ -961,6 +962,7 @@ static int __initdata enable_update_mpta
 static int __init update_mptable_setup(char *str)
 {
 	enable_update_mptable = 1;
+	pci_routeirq = 1;

I hate to see new uses of pci_routeirq. It'd be nice to remove it completely someday. But maybe it can't be helped.

Quoted 3 lines
arch/x86/kernel/mpparse.c +0 -0
 	return 0;
 }
 early_param("update_mptable", update_mptable_setup);
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

"update_mptable" is apparently a boot option, but it's not mentioned in Documentation/kernel-parameters.txt. Is this some sort of debug code or BIOS-writer's helper? Same with "alloc_mptable". Why do we have this stuff?

1. kexec path: after acpi kernel and use kexec to load kerenl with mptable support only or acpi=off
2. help to BIOS engineer to understand how to set mptable and irq routing setup by chipset. esp system have several cards and there is bridge in those cards.

Quoted 6 lines

...

Quoted 2 lines

Is (1) common enough to worry about? What OSes don't have ACPI support? What advantage is there to using "acpi=off"?

...

some one want to disable acpi, because acpid is using 100%...

I'd rather fix the problem with acpid than make it easier to use "acpi=off".

Bjorn

#8 lore raw
Quoted 41 lines · Bjorn Helgaas
Quoted 40 lines · Yinghai Lu
Quoted 38 lines · Bjorn Helgaas
Quoted 37 lines · Yinghai Lu
Quoted 25 lines · Bjorn Helgaas
Quoted 1 line · Yinghai Lu

to get all device irq routing and save them

This changelog isn't really enough for me to understand what's going on.

Quoted 13 lines

Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================

arch/x86/kernel/mpparse.c +1 -0
@@ -17,6 +17,7 @@
 #include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/smp.h>
+#include <linux/pci.h>
 
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 965

Quoted 4 lines
arch/x86/kernel/mpparse.c +1 -0
@@ -961,6 +962,7 @@ static int __initdata enable_update_mpta
 static int __init update_mptable_setup(char *str)
 {
 	enable_update_mptable = 1;
+	pci_routeirq = 1;

I hate to see new uses of pci_routeirq. It'd be nice to remove it completely someday. But maybe it can't be helped.

Quoted 8 lines

arch/x86/kernel/mpparse.c static int __initdata enable_update_mpta · line 968

Quoted 3 lines
arch/x86/kernel/mpparse.c +0 -0
 	return 0;
 }
 early_param("update_mptable", update_mptable_setup);

"update_mptable" is apparently a boot option, but it's not mentioned in Documentation/kernel-parameters.txt. Is this some sort of debug code or BIOS-writer's helper? Same with "alloc_mptable". Why do we have this stuff?

1. kexec path: after acpi kernel and use kexec to load kerenl with mptable support only or acpi=off
2. help to BIOS engineer to understand how to set mptable and irq routing setup by chipset. esp system have several cards and there is bridge in those cards.

...

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Is (1) common enough to worry about? What OSes don't have ACPI support? What advantage is there to using "acpi=off"?

...

some one want to disable acpi, because acpid is using 100%...

I'd rather fix the problem with acpid than make it easier to use "acpi=off".

Well, acpi=off is frequently used. Besides of that, there's a design and future-proof-ness issue as well: having a correct mptable is good in sense of not having all our collective eggs in the ACPI basket. ACPI also has IP attached and there are vendors who are loathe to use it for one reason or another.

So as long as Yinghai is willing to maintain this path and is willing to keep it correct, and as long as we _have_ an acpi=off option in the upstream kernel it makes sense to make the kexec environment as correct and inclusive as possible.

acpid looping should of course be fixed separately. Almost all distros ship with acpi enabled so there's no shortage of bugs being reported, and there's no need to artificially make it harder for people to not use acpi if they so choose.

Ingo

author
#9 lore raw

PATCH 1/1 x86: add X86_UPDATE_MPTABLE option

In reply to Yinghai Lu

so could enable it for special purpose.
1. for acpi enabled kernel kexec kernel without acpi
2. for crossing check mptable or have correct mptable

even with this option enabled, user still need to use update_mpatble or alloc_mptable in command line

[ Impact: new config option to disable update_mptable ]

---
 arch/x86/Kconfig              |   10 ++++++++++
 arch/x86/include/asm/mpspec.h |    9 +++++++--
 arch/x86/kernel/acpi/boot.c   |    3 ++-
 arch/x86/kernel/mpparse.c     |    4 ++++
 4 files changed, 23 insertions(+), 3 deletions(-)
arch/x86/Kconfig +10 -0
Index: linux-2.6/arch/x86/Kconfig
===================================================================
@@ -292,6 +292,16 @@ config X86_MPPARSE
 	  For old smp systems that do not have proper acpi support. Newer systems
 	  (esp with 64bit cpus) with acpi support, MADT and DSDT will override it
 
+config X86_UPDATE_MPTABLE
+	bool "Enable update mptable according to acpi" if ACPI
+	default n
+	depends on X86_MPPARSE && ACPI
+	---help---
+	  some systems do not have correct mptable. with "update_mptable" or
+	  "alloc_mptable" kernel could try to update mptable according to DSDT.
+	  Then could use kexec to start second kernel (even old) without acpi
+	  support or "acpi=off"
+
 config X86_BIGSMP
 	bool "Support for big SMP systems with more than 8 CPUs"
 	depends on X86_32 && SMP
arch/x86/kernel/acpi/boot.c +2 -1
Index: linux-2.6/arch/x86/kernel/acpi/boot.c
===================================================================
@@ -1159,7 +1159,7 @@ void __init mp_config_acpi_legacy_irqs(v
 static int mp_config_acpi_gsi(struct device *dev, u32 gsi, int trigger,
 			int polarity)
 {
-#ifdef CONFIG_X86_MPPARSE
+#ifdef CONFIG_X86_UPDATE_MPTABLE
 	struct mpc_intsrc mp_irq;
 	struct pci_dev *pdev;
 	unsigned char number;
@@ -1191,6 +1191,7 @@ static int mp_config_acpi_gsi(struct dev
 
 	save_mp_irq(&mp_irq);
 #endif
+
 	return 0;
 }
 
arch/x86/kernel/mpparse.c +4 -0
Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================
@@ -797,6 +797,8 @@ void __init find_smp_config(void)
 	__find_smp_config(1);
 }
 
+#ifdef CONFIG_X86_UPDATE_MPTABLE
+
 #ifdef CONFIG_X86_IO_APIC
 static u8 __initdata irq_used[MAX_IRQ_SOURCES];
 
@@ -1086,3 +1088,5 @@ static int __init update_mp_table(void)
 }
 
 late_initcall(update_mp_table);
+
+#endif /* CONFIG_X86_UPDATE_MPTABLE */
arch/x86/include/asm/mpspec.h +7 -2
Index: linux-2.6/arch/x86/include/asm/mpspec.h
===================================================================
@@ -60,9 +60,15 @@ extern void get_smp_config(void);
 
 #ifdef CONFIG_X86_MPPARSE
 extern void find_smp_config(void);
-extern void early_reserve_e820_mpc_new(void);
 #else
 static inline void find_smp_config(void) { }
+#endif
+
+#ifdef CONFIG_X86_UPDATE_MPTABLE
+extern int enable_update_mptable;
+extern void early_reserve_e820_mpc_new(void);
+#else
+#define enable_update_mptable (0)
 static inline void early_reserve_e820_mpc_new(void) { }
 #endif
 
@@ -72,7 +78,6 @@ extern void mp_register_ioapic(int id, u
 extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
 				   u32 gsi);
 extern void mp_config_acpi_legacy_irqs(void);
-extern int enable_update_mptable;
 struct device;
 extern int mp_register_gsi(struct device *dev, u32 gsi, int edge_level,
 				 int active_high_low);
#10 lore raw

Re: [PATCH] x86: add X86_UPDATE_MPTABLE option

arch/x86/Kconfig config X86_MPPARSE · line 298

Quoted 4 lines · Yinghai Lu
arch/x86/Kconfig +4 -0
+config X86_UPDATE_MPTABLE
+	bool "Enable update mptable according to acpi" if ACPI
+	default n
+	depends on X86_MPPARSE && ACPI

Is this any use without CONFIG_KEXEC? Maybe it should depend on KEXEC as well? Or maybe we don't need a new option at all, and could just put this code under CONFIG_KEXEC directly.

arch/x86/Kconfig config X86_MPPARSE · line 303

Quoted 5 lines
arch/x86/Kconfig +5 -0
+	---help---
+	  some systems do not have correct mptable. with "update_mptable" or
+	  "alloc_mptable" kernel could try to update mptable according to DSDT.
+	  Then could use kexec to start second kernel (even old) without acpi
+	  support or "acpi=off"

Please use English conventions such as starting sentences with capital letters and capitalizing thing like "ACPI."

Bjorn

author
#11 lore raw

Re: [PATCH] x86: add X86_UPDATE_MPTABLE option

Quoted 10 lines · Bjorn Helgaas

arch/x86/Kconfig config X86_MPPARSE · line 298

Quoted 4 lines · Yinghai Lu
arch/x86/Kconfig +4 -0
+config X86_UPDATE_MPTABLE
+	bool "Enable update mptable according to acpi" if ACPI
+	default n
+	depends on X86_MPPARSE && ACPI

Is this any use without CONFIG_KEXEC? Maybe it should depend on KEXEC as well? Or maybe we don't need a new option at all, and could just put this code under CONFIG_KEXEC directly.

If ACPI is not compiled in, we don't need it that too.

Quoted 9 lines

arch/x86/Kconfig config X86_MPPARSE · line 303

Quoted 6 lines
arch/x86/Kconfig +5 -0
+	---help---
+	  some systems do not have correct mptable. with "update_mptable" or
+	  "alloc_mptable" kernel could try to update mptable according to DSDT.
+	  Then could use kexec to start second kernel (even old) without acpi
+	  support or "acpi=off"

Please use English conventions such as starting sentences with capital letters and capitalizing thing like "ACPI."

ok.

YH

author
#12 lore raw

PATCH v2 1/1 x86: add X86_UPDATE_MPTABLE option

In reply to Bjorn Helgaas

so could enable it for special purpose.
1. for acpi enabled kernel kexec kernel without acpi
2. for crossing check mptable or have correct mptable

even with this option enabled, user still need to use update_mpatble or alloc_mptable in command line

v2: update to make it depends on KEXEC according to Bjorn

[ Impact: new config option to disable update_mptable ]

Cc Bjorn Helgaas <[email protected]>
Cc Jesse Barnes <[email protected]>
Cc Len Brown <[email protected]>
---
 arch/x86/Kconfig              |   10 ++++++++++
 arch/x86/include/asm/mpspec.h |    6 +++---
 arch/x86/kernel/acpi/boot.c   |    3 ++-
 arch/x86/kernel/mpparse.c     |    4 ++++
 4 files changed, 19 insertions(+), 4 deletions(-)
arch/x86/Kconfig +10 -0
Index: linux-2.6/arch/x86/Kconfig
===================================================================
@@ -292,6 +292,16 @@ config X86_MPPARSE
 	  For old smp systems that do not have proper acpi support. Newer systems
 	  (esp with 64bit cpus) with acpi support, MADT and DSDT will override it
 
+config X86_UPDATE_MPTABLE
+	bool "Enable update mptable according to ACPI"
+	default n
+	depends on X86_MPPARSE && ACPI && KEXEC
+	---help---
+	  Some systems do not have correct mptable. With "update_mptable" or
+	  "alloc_mptable" kernel could try to update mptable according to DSDT.
+	  Then could use kexec to start second kernel (even old) without ACPI
+	  support compiled in or "acpi=off"
+
 config X86_BIGSMP
 	bool "Support for big SMP systems with more than 8 CPUs"
 	depends on X86_32 && SMP
arch/x86/kernel/acpi/boot.c +2 -1
Index: linux-2.6/arch/x86/kernel/acpi/boot.c
===================================================================
@@ -1159,7 +1159,7 @@ void __init mp_config_acpi_legacy_irqs(v
 static int mp_config_acpi_gsi(struct device *dev, u32 gsi, int trigger,
 			int polarity)
 {
-#ifdef CONFIG_X86_MPPARSE
+#ifdef CONFIG_X86_UPDATE_MPTABLE
 	struct mpc_intsrc mp_irq;
 	struct pci_dev *pdev;
 	unsigned char number;
@@ -1191,6 +1191,7 @@ static int mp_config_acpi_gsi(struct dev
 
 	save_mp_irq(&mp_irq);
 #endif
+
 	return 0;
 }
 
arch/x86/kernel/mpparse.c +4 -0
Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================
@@ -797,6 +797,8 @@ void __init find_smp_config(void)
 	__find_smp_config(1);
 }
 
+#ifdef CONFIG_X86_UPDATE_MPTABLE
+
 #ifdef CONFIG_X86_IO_APIC
 static u8 __initdata irq_used[MAX_IRQ_SOURCES];
 
@@ -1080,3 +1082,5 @@ static int __init update_mp_table(void)
 }
 
 late_initcall(update_mp_table);
+
+#endif /* CONFIG_X86_UPDATE_MPTABLE */
arch/x86/include/asm/mpspec.h +3 -3
Index: linux-2.6/arch/x86/include/asm/mpspec.h
===================================================================
@@ -60,10 +60,8 @@ extern void get_smp_config(void);
 
 #ifdef CONFIG_X86_MPPARSE
 extern void find_smp_config(void);
-extern void early_reserve_e820_mpc_new(void);
 #else
 static inline void find_smp_config(void) { }
-static inline void early_reserve_e820_mpc_new(void) { }
 #endif
 
 void __cpuinit generic_processor_info(int apicid, int version);
@@ -87,13 +85,15 @@ static inline int acpi_probe_gsi(void)
 }
 #endif /* CONFIG_ACPI */
 
-#ifdef CONFIG_X86_MPPARSE
+#ifdef CONFIG_X86_UPDATE_MPTABLE
 extern int enable_update_mptable;
+extern void early_reserve_e820_mpc_new(void);
 #else
 static inline int enable_update_mptable(void)
 {
 	return 0;
 }
+static inline void early_reserve_e820_mpc_new(void) { }
 #endif
 
 #define PHYSID_ARRAY_SIZE	BITS_TO_LONGS(MAX_APICS)
#13 lore raw

Re: [PATCH, v2] x86: add X86_UPDATE_MPTABLE option

Quoted 9 lines · Yinghai Lu

so could enable it for special purpose.
1. for acpi enabled kernel kexec kernel without acpi
2. for crossing check mptable or have correct mptable

even with this option enabled, user still need to use update_mpatble or alloc_mptable in command line

v2: update to make it depends on KEXEC according to Bjorn

Wait a minute. I did raise the possibility of a config option, but only in the context of code whose only purpose was to help debug the BIOS. And I suggested that code like that might not belong in the mainline at all.

But this code is not like that, since you apparently need it for kexec in general. I don't think you should add an additional config option just for this code. A new option would just add complexity for no benefit.

Bjorn

Quoted 110 lines

esp system have several cards and there is bridge in those cards

[ Impact: new config option to disable update_mptable ]

Cc Bjorn Helgaas <[email protected]>
Cc Jesse Barnes <[email protected]>
Cc Len Brown <[email protected]>
---
 arch/x86/Kconfig              |   10 ++++++++++
 arch/x86/include/asm/mpspec.h |    6 +++---
 arch/x86/kernel/acpi/boot.c   |    3 ++-
 arch/x86/kernel/mpparse.c     |    4 ++++
 4 files changed, 19 insertions(+), 4 deletions(-)

Index: linux-2.6/arch/x86/Kconfig
===================================================================

arch/x86/Kconfig +10 -0
@@ -292,6 +292,16 @@ config X86_MPPARSE
 	  For old smp systems that do not have proper acpi support. Newer systems
 	  (esp with 64bit cpus) with acpi support, MADT and DSDT will override it
 
+config X86_UPDATE_MPTABLE
+	bool "Enable update mptable according to ACPI"
+	default n
+	depends on X86_MPPARSE && ACPI && KEXEC
+	---help---
+	  Some systems do not have correct mptable. With "update_mptable" or
+	  "alloc_mptable" kernel could try to update mptable according to DSDT.
+	  Then could use kexec to start second kernel (even old) without ACPI
+	  support compiled in or "acpi=off"
+
 config X86_BIGSMP
 	bool "Support for big SMP systems with more than 8 CPUs"
 	depends on X86_32 && SMP

Index: linux-2.6/arch/x86/kernel/acpi/boot.c
===================================================================

arch/x86/kernel/acpi/boot.c +2 -1
@@ -1159,7 +1159,7 @@ void __init mp_config_acpi_legacy_irqs(v
 static int mp_config_acpi_gsi(struct device *dev, u32 gsi, int trigger,
 			int polarity)
 {
-#ifdef CONFIG_X86_MPPARSE
+#ifdef CONFIG_X86_UPDATE_MPTABLE
 	struct mpc_intsrc mp_irq;
 	struct pci_dev *pdev;
 	unsigned char number;
@@ -1191,6 +1191,7 @@ static int mp_config_acpi_gsi(struct dev
 
 	save_mp_irq(&mp_irq);
 #endif
+
 	return 0;
 }
 

Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================

arch/x86/kernel/mpparse.c +4 -0
@@ -797,6 +797,8 @@ void __init find_smp_config(void)
 	__find_smp_config(1);
 }
 
+#ifdef CONFIG_X86_UPDATE_MPTABLE
+
 #ifdef CONFIG_X86_IO_APIC
 static u8 __initdata irq_used[MAX_IRQ_SOURCES];
 
@@ -1080,3 +1082,5 @@ static int __init update_mp_table(void)
 }
 
 late_initcall(update_mp_table);
+
+#endif /* CONFIG_X86_UPDATE_MPTABLE */

Index: linux-2.6/arch/x86/include/asm/mpspec.h
===================================================================

arch/x86/include/asm/mpspec.h +3 -3
@@ -60,10 +60,8 @@ extern void get_smp_config(void);
 
 #ifdef CONFIG_X86_MPPARSE
 extern void find_smp_config(void);
-extern void early_reserve_e820_mpc_new(void);
 #else
 static inline void find_smp_config(void) { }
-static inline void early_reserve_e820_mpc_new(void) { }
 #endif
 
 void __cpuinit generic_processor_info(int apicid, int version);
@@ -87,13 +85,15 @@ static inline int acpi_probe_gsi(void)
 }
 #endif /* CONFIG_ACPI */
 
-#ifdef CONFIG_X86_MPPARSE
+#ifdef CONFIG_X86_UPDATE_MPTABLE
 extern int enable_update_mptable;
+extern void early_reserve_e820_mpc_new(void);
 #else
 static inline int enable_update_mptable(void)
 {
 	return 0;
 }
+static inline void early_reserve_e820_mpc_new(void) { }
 #endif
 
 #define PHYSID_ARRAY_SIZE	BITS_TO_LONGS(MAX_APICS)