linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: add PCI IDs to k8topology_64.c
@ 2008-01-28 20:11 Joachim Deguara
  2008-01-28 20:54 ` Ingo Molnar
  2008-01-29  3:48 ` Andi Kleen
  0 siblings, 2 replies; 12+ messages in thread
From: Joachim Deguara @ 2008-01-28 20:11 UTC (permalink / raw)
  To: tglx, mingo, hpa; +Cc: linux-kernel, Andi Kleen, yinghai.lu, Dean Roe

Quick history, this is a harmless patch that got dropped by Andi as a mixup to 
dropping another patch of mine that was made obsolete by Yinghai.
http://thread.gmane.org/gmane.linux.kernel/559581

-Joachim

--

    x86: add PCI IDs to k8topology_64.c
    
    This just adds the PCI IDs of AMD's family 10h and 11h CPU's northbridges 
to
    k8topology discovery.
    
    Signed-off-by: Joachim Deguara <joachim.deguara@amd.com>
    Signed-off-by: Andi Kleen <ak@suse.de>
    Acked-by: Yinghai Lu <yinghai.lu@sun.com>

diff --git a/arch/x86/mm/k8topology_64.c b/arch/x86/mm/k8topology_64.c
index a96006f..b123ea3 100644
--- a/arch/x86/mm/k8topology_64.c
+++ b/arch/x86/mm/k8topology_64.c
@@ -28,11 +28,15 @@ static __init int find_northbridge(void)
 		u32 header;
 		
 		header = read_pci_config(0, num, 0, 0x00);  
-		if (header != (PCI_VENDOR_ID_AMD | (0x1100<<16)))
+		if (header != (PCI_VENDOR_ID_AMD | (0x1100<<16)) &&
+			header != (PCI_VENDOR_ID_AMD | (0x1200<<16)) &&
+			header != (PCI_VENDOR_ID_AMD | (0x1300<<16)))
 			continue; 	
 
 		header = read_pci_config(0, num, 1, 0x00); 
-		if (header != (PCI_VENDOR_ID_AMD | (0x1101<<16)))
+		if (header != (PCI_VENDOR_ID_AMD | (0x1101<<16)) &&
+			header != (PCI_VENDOR_ID_AMD | (0x1201<<16)) &&
+			header != (PCI_VENDOR_ID_AMD | (0x1301<<16)))
 			continue;	
 		return num; 
 	} 



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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c
  2008-01-28 20:11 [PATCH] x86: add PCI IDs to k8topology_64.c Joachim Deguara
@ 2008-01-28 20:54 ` Ingo Molnar
  2008-01-28 21:49   ` Yinghai Lu
  2008-01-29  3:48 ` Andi Kleen
  1 sibling, 1 reply; 12+ messages in thread
From: Ingo Molnar @ 2008-01-28 20:54 UTC (permalink / raw)
  To: Joachim Deguara
  Cc: tglx, mingo, hpa, linux-kernel, Andi Kleen, yinghai.lu, Dean Roe


* Joachim Deguara <joachim.deguara@amd.com> wrote:

>     x86: add PCI IDs to k8topology_64.c
>     
>     This just adds the PCI IDs of AMD's family 10h and 11h CPU's 
>  northbridges to k8topology discovery.

thanks Joachim, applied.

	Ingo

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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c
  2008-01-28 20:54 ` Ingo Molnar
@ 2008-01-28 21:49   ` Yinghai Lu
  0 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2008-01-28 21:49 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Joachim Deguara, tglx, mingo, hpa, linux-kernel, Andi Kleen, Dean Roe

On Monday 28 January 2008 12:54:41 pm Ingo Molnar wrote:
> 
> * Joachim Deguara <joachim.deguara@amd.com> wrote:
> 
> >     x86: add PCI IDs to k8topology_64.c
> >     
> >     This just adds the PCI IDs of AMD's family 10h and 11h CPU's 
> >  northbridges to k8topology discovery.
> 
> thanks Joachim, applied.

thanks.

I used it with my local patches for supporting family 10h with acpi=off pci=nomsi for a while.

YH

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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c
  2008-01-28 20:11 [PATCH] x86: add PCI IDs to k8topology_64.c Joachim Deguara
  2008-01-28 20:54 ` Ingo Molnar
@ 2008-01-29  3:48 ` Andi Kleen
  2008-01-29  4:12   ` Yinghai Lu
  1 sibling, 1 reply; 12+ messages in thread
From: Andi Kleen @ 2008-01-29  3:48 UTC (permalink / raw)
  To: Joachim Deguara; +Cc: tglx, mingo, hpa, linux-kernel, yinghai.lu, Dean Roe

"Joachim Deguara" <joachim.deguara@amd.com> writes:

> Quick history, this is a harmless patch that got dropped by Andi as a mixup to 

It's not harmless.

> dropping another patch of mine that was made obsolete by Yinghai.
> http://thread.gmane.org/gmane.linux.kernel/559581

No that's not the correct history. The correct history is that 
I intentionally rejected this patch because the old k8topology
hack should really not be used anymore on modern machines (especially
not on Quad Cores). SRAT is the far better way to handle this problem
because it has a proper abstraction.

The problem with k8topology.c is that it needs to know very low level
information (like HT node numbers etc.) the kernel should not really
need to know and which are difficult to handle generally without
motherboard specific knowledge. 

k8topology.c mostly guesses, which was never a good way to handle this. 
Also in in the various "node has no memory" cases it needs quite
hackish fallback heuristics which will be always fragile. Then there
are some ugly interactions with quad cores. And some other issues

I still think the patch a bad idea because adapting this file all
the time is a long term maintenance issue. I can say that as 
the original author :-) It was just a quick hack long ago
to get NUMA going early. But now it far outlived its usefulness
and adapting it to modern machines is the wrong direction. 

Best is to phase k8topology out.

-Andi



>
> -Joachim
>
> --
>
>     x86: add PCI IDs to k8topology_64.c
>     
>     This just adds the PCI IDs of AMD's family 10h and 11h CPU's northbridges 
> to
>     k8topology discovery.
>     
>     Signed-off-by: Joachim Deguara <joachim.deguara@amd.com>
>     Signed-off-by: Andi Kleen <ak@suse.de>
>     Acked-by: Yinghai Lu <yinghai.lu@sun.com>
>
> diff --git a/arch/x86/mm/k8topology_64.c b/arch/x86/mm/k8topology_64.c
> index a96006f..b123ea3 100644
> --- a/arch/x86/mm/k8topology_64.c
> +++ b/arch/x86/mm/k8topology_64.c
> @@ -28,11 +28,15 @@ static __init int find_northbridge(void)
>  		u32 header;
>  		
>  		header = read_pci_config(0, num, 0, 0x00);  
> -		if (header != (PCI_VENDOR_ID_AMD | (0x1100<<16)))
> +		if (header != (PCI_VENDOR_ID_AMD | (0x1100<<16)) &&
> +			header != (PCI_VENDOR_ID_AMD | (0x1200<<16)) &&
> +			header != (PCI_VENDOR_ID_AMD | (0x1300<<16)))
>  			continue; 	
>  
>  		header = read_pci_config(0, num, 1, 0x00); 
> -		if (header != (PCI_VENDOR_ID_AMD | (0x1101<<16)))
> +		if (header != (PCI_VENDOR_ID_AMD | (0x1101<<16)) &&
> +			header != (PCI_VENDOR_ID_AMD | (0x1201<<16)) &&
> +			header != (PCI_VENDOR_ID_AMD | (0x1301<<16)))
>  			continue;	
>  		return num; 
>  	} 

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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c
  2008-01-29  3:48 ` Andi Kleen
@ 2008-01-29  4:12   ` Yinghai Lu
  2008-01-29  4:56     ` Andi Kleen
  0 siblings, 1 reply; 12+ messages in thread
From: Yinghai Lu @ 2008-01-29  4:12 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Joachim Deguara, tglx, mingo, hpa, linux-kernel, Dean Roe

On Monday 28 January 2008 07:48:06 pm Andi Kleen wrote:
> "Joachim Deguara" <joachim.deguara@amd.com> writes:
> 
> > Quick history, this is a harmless patch that got dropped by Andi as a mixup to 
> 
> It's not harmless.
> 
> > dropping another patch of mine that was made obsolete by Yinghai.
> > http://thread.gmane.org/gmane.linux.kernel/559581
> 
> No that's not the correct history. The correct history is that 
> I intentionally rejected this patch because the old k8topology
> hack should really not be used anymore on modern machines (especially
> not on Quad Cores). SRAT is the far better way to handle this problem
> because it has a proper abstraction.
> 
> The problem with k8topology.c is that it needs to know very low level
> information (like HT node numbers etc.) the kernel should not really
> need to know and which are difficult to handle generally without
> motherboard specific knowledge. 
> 
> k8topology.c mostly guesses, which was never a good way to handle this. 
> Also in in the various "node has no memory" cases it needs quite
> hackish fallback heuristics which will be always fragile. Then there
> are some ugly interactions with quad cores. And some other issues
> 
> I still think the patch a bad idea because adapting this file all
> the time is a long term maintenance issue. I can say that as 
> the original author :-) It was just a quick hack long ago
> to get NUMA going early. But now it far outlived its usefulness
> and adapting it to modern machines is the wrong direction. 
> 
> Best is to phase k8topology out.

then with acpi=off, we can not use numa any more.

also there are some users are using LinuxBIOS or other firmware that doesn't have  or like ACPI support. but they still need numa.
for them ACPI doesn't help.

YH


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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c
  2008-01-29  4:12   ` Yinghai Lu
@ 2008-01-29  4:56     ` Andi Kleen
  2008-01-29  6:03       ` H. Peter Anvin
  2008-01-29  8:09       ` [PATCH] x86: add PCI IDs to k8topology_64.c II Andi Kleen
  0 siblings, 2 replies; 12+ messages in thread
From: Andi Kleen @ 2008-01-29  4:56 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Andi Kleen, Joachim Deguara, tglx, mingo, hpa, linux-kernel, Dean Roe

> also there are some users are using LinuxBIOS or other firmware that doesn't have  or like ACPI support. but they still need numa.
> for them ACPI doesn't help.

We've had this discussion before. The right way even if you don't 
want to do full ACPI is to do just the minimal static boot tables
and a SRAT. These are quite simple tables and should be easy to set up.
SRAT is essentially just a two dimensional table with node distances.

-Andi

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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c
  2008-01-29  4:56     ` Andi Kleen
@ 2008-01-29  6:03       ` H. Peter Anvin
  2008-01-29  8:09       ` [PATCH] x86: add PCI IDs to k8topology_64.c II Andi Kleen
  1 sibling, 0 replies; 12+ messages in thread
From: H. Peter Anvin @ 2008-01-29  6:03 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Yinghai Lu, Joachim Deguara, tglx, mingo, linux-kernel, Dean Roe

Andi Kleen wrote:
>> also there are some users are using LinuxBIOS or other firmware that doesn't have  or like ACPI support. but they still need numa.
>> for them ACPI doesn't help.
> 
> We've had this discussion before. The right way even if you don't 
> want to do full ACPI is to do just the minimal static boot tables
> and a SRAT. These are quite simple tables and should be easy to set up.
> SRAT is essentially just a two dimensional table with node distances.
> 

Indeed.  Hacking everything into the kernel just because LinuxBIOS is 
braindead is NOT a good idea.

	-hpa

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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c II
  2008-01-29  8:09       ` [PATCH] x86: add PCI IDs to k8topology_64.c II Andi Kleen
@ 2008-01-29  7:39         ` Yinghai Lu
  2008-01-29  8:31           ` Andi Kleen
  2008-02-01 15:58         ` dean gaudet
  1 sibling, 1 reply; 12+ messages in thread
From: Yinghai Lu @ 2008-01-29  7:39 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Joachim Deguara, tglx, mingo, hpa, linux-kernel, Dean Roe

On Jan 29, 2008 12:09 AM, Andi Kleen <andi@firstfloor.org> wrote:
> > SRAT is essentially just a two dimensional table with node distances.
>
> Sorry, that was actually SLIT. SRAT is not two dimensional, but also
> relatively simple. SLIT you don't really need to implement.
>

need to add some CONFIG option to parse SRAT, MADT etc only. but don't
pull DSDT related...

YH

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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c II
  2008-01-29  4:56     ` Andi Kleen
  2008-01-29  6:03       ` H. Peter Anvin
@ 2008-01-29  8:09       ` Andi Kleen
  2008-01-29  7:39         ` Yinghai Lu
  2008-02-01 15:58         ` dean gaudet
  1 sibling, 2 replies; 12+ messages in thread
From: Andi Kleen @ 2008-01-29  8:09 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Yinghai Lu, Joachim Deguara, tglx, mingo, hpa, linux-kernel, Dean Roe

> SRAT is essentially just a two dimensional table with node distances.

Sorry, that was actually SLIT. SRAT is not two dimensional, but also
relatively simple. SLIT you don't really need to implement.

-Andi

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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c II
  2008-01-29  8:31           ` Andi Kleen
@ 2008-01-29  8:20             ` Yinghai Lu
  0 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2008-01-29  8:20 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Joachim Deguara, tglx, mingo, hpa, linux-kernel, Dean Roe

On Jan 29, 2008 12:31 AM, Andi Kleen <andi@firstfloor.org> wrote:
>
> On Mon, Jan 28, 2008 at 11:39:30PM -0800, Yinghai Lu wrote:
> > On Jan 29, 2008 12:09 AM, Andi Kleen <andi@firstfloor.org> wrote:
> > > > SRAT is essentially just a two dimensional table with node distances.
> > >
> > > Sorry, that was actually SLIT. SRAT is not two dimensional, but also
> > > relatively simple. SLIT you don't really need to implement.
> > >
> >
> > need to add some CONFIG option to parse SRAT, MADT etc only. but don't
> > pull DSDT related...
>
> I don't think it needs a CONFIG. The code should handle this case
> by itself in any case. I'm not entirely sure it does currently, but if it
> doesn't it will likely not be very difficult to fix.
>
> Or are you worried about code size? ACPI is around ~270k on x86-64,
> which while certainly not small should not be a problem on x86 NUMA
> systems.

like acpi=off, acpi=tableonly? so it will load dsdt, and some one
module rely on dsdt could not complain ACPI ERROR..

YH

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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c II
  2008-01-29  7:39         ` Yinghai Lu
@ 2008-01-29  8:31           ` Andi Kleen
  2008-01-29  8:20             ` Yinghai Lu
  0 siblings, 1 reply; 12+ messages in thread
From: Andi Kleen @ 2008-01-29  8:31 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Andi Kleen, Joachim Deguara, tglx, mingo, hpa, linux-kernel, Dean Roe

On Mon, Jan 28, 2008 at 11:39:30PM -0800, Yinghai Lu wrote:
> On Jan 29, 2008 12:09 AM, Andi Kleen <andi@firstfloor.org> wrote:
> > > SRAT is essentially just a two dimensional table with node distances.
> >
> > Sorry, that was actually SLIT. SRAT is not two dimensional, but also
> > relatively simple. SLIT you don't really need to implement.
> >
> 
> need to add some CONFIG option to parse SRAT, MADT etc only. but don't
> pull DSDT related...

I don't think it needs a CONFIG. The code should handle this case 
by itself in any case. I'm not entirely sure it does currently, but if it 
doesn't it will likely not be very difficult to fix.

Or are you worried about code size? ACPI is around ~270k on x86-64, 
which while certainly not small should not be a problem on x86 NUMA
systems.

-Andi


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

* Re: [PATCH] x86: add PCI IDs to k8topology_64.c II
  2008-01-29  8:09       ` [PATCH] x86: add PCI IDs to k8topology_64.c II Andi Kleen
  2008-01-29  7:39         ` Yinghai Lu
@ 2008-02-01 15:58         ` dean gaudet
  1 sibling, 0 replies; 12+ messages in thread
From: dean gaudet @ 2008-02-01 15:58 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Yinghai Lu, Joachim Deguara, tglx, mingo, hpa, linux-kernel, Dean Roe

On Tue, 29 Jan 2008, Andi Kleen wrote:

> > SRAT is essentially just a two dimensional table with node distances.
> 
> Sorry, that was actually SLIT. SRAT is not two dimensional, but also
> relatively simple. SLIT you don't really need to implement.

yeah but i'd heartily recommend implementing SLIT too.  mind you it's 
almost universal non-existence means i've had to resort to userland 
measurements to determine node distances and that won't change.  i guess i 
just wanted to grumble somewhere.

-dean

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

end of thread, other threads:[~2008-02-01 15:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-28 20:11 [PATCH] x86: add PCI IDs to k8topology_64.c Joachim Deguara
2008-01-28 20:54 ` Ingo Molnar
2008-01-28 21:49   ` Yinghai Lu
2008-01-29  3:48 ` Andi Kleen
2008-01-29  4:12   ` Yinghai Lu
2008-01-29  4:56     ` Andi Kleen
2008-01-29  6:03       ` H. Peter Anvin
2008-01-29  8:09       ` [PATCH] x86: add PCI IDs to k8topology_64.c II Andi Kleen
2008-01-29  7:39         ` Yinghai Lu
2008-01-29  8:31           ` Andi Kleen
2008-01-29  8:20             ` Yinghai Lu
2008-02-01 15:58         ` dean gaudet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).