All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: update_mptable need pci_routeirq
@ 2009-05-15 19:51 Yinghai Lu
  2009-05-15 19:53 ` [PATCH] x86/acpi: don't call mp_config_acpi_gsi if update_mptable is not used Yinghai Lu
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Yinghai Lu @ 2009-05-15 19:51 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes
  Cc: linux-kernel, linux-pci


to get all device irq routing and save them

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/kernel/mpparse.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/mpparse.c
+++ 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;

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

* [PATCH] x86/acpi: don't call mp_config_acpi_gsi if update_mptable is not used
  2009-05-15 19:51 [PATCH] x86: update_mptable need pci_routeirq Yinghai Lu
@ 2009-05-15 19:53 ` Yinghai Lu
  2009-05-18  7:40   ` [tip:irq/numa] x86, irq: don't call mp_config_acpi_gsi() if update_mptable is not enabled tip-bot for Yinghai Lu
  2009-05-15 21:07 ` [PATCH] x86: update_mptable need pci_routeirq Bjorn Helgaas
  2009-05-16 16:44 ` [PATCH] x86: add X86_UPDATE_MPTABLE option Yinghai Lu
  2 siblings, 1 reply; 14+ messages in thread
From: Yinghai Lu @ 2009-05-15 19:53 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes, Len Brown
  Cc: linux-kernel, linux-pci, ACPI Devel Maling List



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

[ Impact: less touch code flow for acpi code ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 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(-)

Index: linux-2.6/arch/x86/include/asm/mpspec.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/mpspec.h
+++ 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);
Index: linux-2.6/arch/x86/kernel/acpi/boot.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/acpi/boot.c
+++ 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,
Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/mpparse.c
+++ 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)
 {

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

* Re: [PATCH] x86: update_mptable need pci_routeirq
  2009-05-15 19:51 [PATCH] x86: update_mptable need pci_routeirq Yinghai Lu
  2009-05-15 19:53 ` [PATCH] x86/acpi: don't call mp_config_acpi_gsi if update_mptable is not used Yinghai Lu
@ 2009-05-15 21:07 ` Bjorn Helgaas
  2009-05-15 21:13   ` Yinghai Lu
  2009-05-16 16:44 ` [PATCH] x86: add X86_UPDATE_MPTABLE option Yinghai Lu
  2 siblings, 1 reply; 14+ messages in thread
From: Bjorn Helgaas @ 2009-05-15 21:07 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes,
	linux-kernel, linux-pci

On Friday 15 May 2009 01:51:56 pm Yinghai Lu wrote:
> to get all device irq routing and save them

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

> Index: linux-2.6/arch/x86/kernel/mpparse.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/mpparse.c
> +++ 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;

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.

>  	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?

> @@ -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;


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

* Re: [PATCH] x86: update_mptable need pci_routeirq
  2009-05-15 21:07 ` [PATCH] x86: update_mptable need pci_routeirq Bjorn Helgaas
@ 2009-05-15 21:13   ` Yinghai Lu
  2009-05-15 21:52     ` Bjorn Helgaas
  0 siblings, 1 reply; 14+ messages in thread
From: Yinghai Lu @ 2009-05-15 21:13 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes,
	linux-kernel, linux-pci

Bjorn Helgaas wrote:
> On Friday 15 May 2009 01:51:56 pm Yinghai Lu wrote:
>> to get all device irq routing and save them
> 
> This changelog isn't really enough for me to understand
> what's going on.
> 
>> Index: linux-2.6/arch/x86/kernel/mpparse.c
>> ===================================================================
>> --- linux-2.6.orig/arch/x86/kernel/mpparse.c
>> +++ 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;
> 
> 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.
> 
>>  	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

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

* Re: [PATCH] x86: update_mptable need pci_routeirq
  2009-05-15 21:13   ` Yinghai Lu
@ 2009-05-15 21:52     ` Bjorn Helgaas
  2009-05-15 22:03       ` Yinghai Lu
  0 siblings, 1 reply; 14+ messages in thread
From: Bjorn Helgaas @ 2009-05-15 21:52 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes,
	linux-kernel, linux-pci

On Friday 15 May 2009 03:13:20 pm Yinghai Lu wrote:
> Bjorn Helgaas wrote:
> > On Friday 15 May 2009 01:51:56 pm Yinghai Lu wrote:
> >> to get all device irq routing and save them
> > 
> > This changelog isn't really enough for me to understand
> > what's going on.
> > 
> >> Index: linux-2.6/arch/x86/kernel/mpparse.c
> >> ===================================================================
> >> --- linux-2.6.orig/arch/x86/kernel/mpparse.c
> >> +++ 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;
> > 
> > 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.
> > 
> >>  	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.

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


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

* Re: [PATCH] x86: update_mptable need pci_routeirq
  2009-05-15 21:52     ` Bjorn Helgaas
@ 2009-05-15 22:03       ` Yinghai Lu
  2009-05-15 22:08         ` Bjorn Helgaas
  0 siblings, 1 reply; 14+ messages in thread
From: Yinghai Lu @ 2009-05-15 22:03 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes,
	linux-kernel, linux-pci

Bjorn Helgaas wrote:
> On Friday 15 May 2009 03:13:20 pm Yinghai Lu wrote:
>> Bjorn Helgaas wrote:
>>> On Friday 15 May 2009 01:51:56 pm Yinghai Lu wrote:
>>>> to get all device irq routing and save them
>>> This changelog isn't really enough for me to understand
>>> what's going on.
>>>
>>>> Index: linux-2.6/arch/x86/kernel/mpparse.c
>>>> ===================================================================
>>>> --- linux-2.6.orig/arch/x86/kernel/mpparse.c
>>>> +++ 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;
>>> 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.
>>>
>>>>  	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.
> 
> 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.


> 
> 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%...

> 
> (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

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

* Re: [PATCH] x86: update_mptable need pci_routeirq
  2009-05-15 22:03       ` Yinghai Lu
@ 2009-05-15 22:08         ` Bjorn Helgaas
  2009-05-16 10:25           ` Ingo Molnar
  0 siblings, 1 reply; 14+ messages in thread
From: Bjorn Helgaas @ 2009-05-15 22:08 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes,
	linux-kernel, linux-pci

On Friday 15 May 2009 04:03:49 pm Yinghai Lu wrote:
> Bjorn Helgaas wrote:
> > On Friday 15 May 2009 03:13:20 pm Yinghai Lu wrote:
> >> Bjorn Helgaas wrote:
> >>> On Friday 15 May 2009 01:51:56 pm Yinghai Lu wrote:
> >>>> to get all device irq routing and save them
> >>> This changelog isn't really enough for me to understand
> >>> what's going on.
> >>>
> >>>> Index: linux-2.6/arch/x86/kernel/mpparse.c
> >>>> ===================================================================
> >>>> --- linux-2.6.orig/arch/x86/kernel/mpparse.c
> >>>> +++ 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;
> >>> 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.
> >>>
> >>>>  	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.
> ...
> > 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

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

* Re: [PATCH] x86: update_mptable need pci_routeirq
  2009-05-15 22:08         ` Bjorn Helgaas
@ 2009-05-16 10:25           ` Ingo Molnar
  0 siblings, 0 replies; 14+ messages in thread
From: Ingo Molnar @ 2009-05-16 10:25 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Yinghai Lu, Thomas Gleixner, H. Peter Anvin, Jesse Barnes,
	linux-kernel, linux-pci


* Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:

> On Friday 15 May 2009 04:03:49 pm Yinghai Lu wrote:
> > Bjorn Helgaas wrote:
> > > On Friday 15 May 2009 03:13:20 pm Yinghai Lu wrote:
> > >> Bjorn Helgaas wrote:
> > >>> On Friday 15 May 2009 01:51:56 pm Yinghai Lu wrote:
> > >>>> to get all device irq routing and save them
> > >>> This changelog isn't really enough for me to understand
> > >>> what's going on.
> > >>>
> > >>>> Index: linux-2.6/arch/x86/kernel/mpparse.c
> > >>>> ===================================================================
> > >>>> --- linux-2.6.orig/arch/x86/kernel/mpparse.c
> > >>>> +++ 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;
> > >>> 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.
> > >>>
> > >>>>  	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.
> > ...
> > > 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

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

* [PATCH] x86: add X86_UPDATE_MPTABLE option
  2009-05-15 19:51 [PATCH] x86: update_mptable need pci_routeirq Yinghai Lu
  2009-05-15 19:53 ` [PATCH] x86/acpi: don't call mp_config_acpi_gsi if update_mptable is not used Yinghai Lu
  2009-05-15 21:07 ` [PATCH] x86: update_mptable need pci_routeirq Bjorn Helgaas
@ 2009-05-16 16:44 ` Yinghai Lu
  2009-05-18 15:41   ` Bjorn Helgaas
  2 siblings, 1 reply; 14+ messages in thread
From: Yinghai Lu @ 2009-05-16 16:44 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes
  Cc: linux-kernel, linux-pci


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 ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 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(-)

Index: linux-2.6/arch/x86/Kconfig
===================================================================
--- linux-2.6.orig/arch/x86/Kconfig
+++ 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
Index: linux-2.6/arch/x86/kernel/acpi/boot.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/acpi/boot.c
+++ 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;
 }
 
Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/mpparse.c
+++ 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 */
Index: linux-2.6/arch/x86/include/asm/mpspec.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/mpspec.h
+++ 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);

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

* [tip:irq/numa] x86, irq: don't call mp_config_acpi_gsi() if update_mptable is not enabled
  2009-05-15 19:53 ` [PATCH] x86/acpi: don't call mp_config_acpi_gsi if update_mptable is not used Yinghai Lu
@ 2009-05-18  7:40   ` tip-bot for Yinghai Lu
  0 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Yinghai Lu @ 2009-05-18  7:40 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, lenb, yinghai, tglx, mingo

Commit-ID:  f1bdb523880c7f6990e9e8e50b0fc972ca475e84
Gitweb:     http://git.kernel.org/tip/f1bdb523880c7f6990e9e8e50b0fc972ca475e84
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Fri, 15 May 2009 13:05:16 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
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 ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Len Brown <lenb@kernel.org>
LKML-Reference: <4A0DC832.5090200@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 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(-)

diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index c34961a..3dcbaaa 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -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 {
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 4af63df..844e5e2 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -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,
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index e6bf9d0..651c93b 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/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)
 {

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

* Re: [PATCH] x86: add X86_UPDATE_MPTABLE option
  2009-05-16 16:44 ` [PATCH] x86: add X86_UPDATE_MPTABLE option Yinghai Lu
@ 2009-05-18 15:41   ` Bjorn Helgaas
  2009-05-18 17:39     ` Yinghai Lu
  2009-05-18 17:59     ` [PATCH, v2] " Yinghai Lu
  0 siblings, 2 replies; 14+ messages in thread
From: Bjorn Helgaas @ 2009-05-18 15:41 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes,
	linux-kernel, linux-pci

On Saturday 16 May 2009 10:44:59 am Yinghai Lu wrote:

> +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.

> +	---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

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

* Re: [PATCH] x86: add X86_UPDATE_MPTABLE option
  2009-05-18 15:41   ` Bjorn Helgaas
@ 2009-05-18 17:39     ` Yinghai Lu
  2009-05-18 17:59     ` [PATCH, v2] " Yinghai Lu
  1 sibling, 0 replies; 14+ messages in thread
From: Yinghai Lu @ 2009-05-18 17:39 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes,
	linux-kernel, linux-pci

Bjorn Helgaas wrote:
> On Saturday 16 May 2009 10:44:59 am Yinghai Lu wrote:
> 
>> +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.

> 
>> +	---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

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

* [PATCH, v2] x86: add X86_UPDATE_MPTABLE option
  2009-05-18 15:41   ` Bjorn Helgaas
  2009-05-18 17:39     ` Yinghai Lu
@ 2009-05-18 17:59     ` Yinghai Lu
  2009-05-18 20:58       ` Bjorn Helgaas
  1 sibling, 1 reply; 14+ messages in thread
From: Yinghai Lu @ 2009-05-18 17:59 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes,
	linux-kernel, linux-pci, Len Brown


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 ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Len Brown <lenb@kernel.org>

---
 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
===================================================================
--- linux-2.6.orig/arch/x86/Kconfig
+++ 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
Index: linux-2.6/arch/x86/kernel/acpi/boot.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/acpi/boot.c
+++ 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;
 }
 
Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/mpparse.c
+++ 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 */
Index: linux-2.6/arch/x86/include/asm/mpspec.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/mpspec.h
+++ 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)

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

* Re: [PATCH, v2] x86: add X86_UPDATE_MPTABLE option
  2009-05-18 17:59     ` [PATCH, v2] " Yinghai Lu
@ 2009-05-18 20:58       ` Bjorn Helgaas
  0 siblings, 0 replies; 14+ messages in thread
From: Bjorn Helgaas @ 2009-05-18 20:58 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jesse Barnes,
	linux-kernel, linux-pci, Len Brown

On Monday 18 May 2009 11:59:57 am Yinghai Lu wrote:
> 
> 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

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

> [ Impact: new config option to disable update_mptable ]
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> Cc: Len Brown <lenb@kernel.org>
> 
> ---
>  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
> ===================================================================
> --- linux-2.6.orig/arch/x86/Kconfig
> +++ 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
> Index: linux-2.6/arch/x86/kernel/acpi/boot.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/acpi/boot.c
> +++ 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;
>  }
>  
> Index: linux-2.6/arch/x86/kernel/mpparse.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/mpparse.c
> +++ 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 */
> Index: linux-2.6/arch/x86/include/asm/mpspec.h
> ===================================================================
> --- linux-2.6.orig/arch/x86/include/asm/mpspec.h
> +++ 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)
> 



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

end of thread, other threads:[~2009-05-18 20:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-15 19:51 [PATCH] x86: update_mptable need pci_routeirq Yinghai Lu
2009-05-15 19:53 ` [PATCH] x86/acpi: don't call mp_config_acpi_gsi if update_mptable is not used Yinghai Lu
2009-05-18  7:40   ` [tip:irq/numa] x86, irq: don't call mp_config_acpi_gsi() if update_mptable is not enabled tip-bot for Yinghai Lu
2009-05-15 21:07 ` [PATCH] x86: update_mptable need pci_routeirq Bjorn Helgaas
2009-05-15 21:13   ` Yinghai Lu
2009-05-15 21:52     ` Bjorn Helgaas
2009-05-15 22:03       ` Yinghai Lu
2009-05-15 22:08         ` Bjorn Helgaas
2009-05-16 10:25           ` Ingo Molnar
2009-05-16 16:44 ` [PATCH] x86: add X86_UPDATE_MPTABLE option Yinghai Lu
2009-05-18 15:41   ` Bjorn Helgaas
2009-05-18 17:39     ` Yinghai Lu
2009-05-18 17:59     ` [PATCH, v2] " Yinghai Lu
2009-05-18 20:58       ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.