x86: add PCI IDs to k8topology_64.c
PATCH 1/1 x86: add PCI IDs to k8topology_64.c
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.
arch/x86/mm/k8topology_64.c +6 -2
@@ -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; }
Quoted 4 lines · Joachim Deguara
x86: add PCI IDs to
k8topology_64.cThis just adds the PCI IDs of AMD's family 10h and 11h CPU's
northbridges to k8topology discovery.
thanks Joachim, applied.
Ingo
Quoted 9 lines · Ingo Molnar
Quoted 4 lines · Joachim Deguara
x86: add PCI IDs to
k8topology_64.cThis 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
Quoted 1 line · Joachim Deguara
Quick history, this is a harmless patch that got dropped by Andi as a mixup to
It's not harmless.
Quoted 2 lines
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
Quoted 37 lines
-Joachim
--
x86: add PCI IDs to
k8topology_64.cThis just adds the PCI IDs of AMD's family 10h and 11h CPU's northbridges
to
k8topology discovery.Signed-off-by Joachim Deguara <[email protected]>Signed-off-by Andi Kleen <[email protected]>Acked-by Yinghai Lu <[email protected]>arch/x86/mm/k8topology_64.c +6
-2@@ -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; }
Quoted 25 lines · Andi Kleen
Quoted 1 line · Joachim Deguara
Quick history, this is a harmless patch that got dropped by Andi as a mixup to
It's not harmless.
Quoted 2 lines
dropping another patch of mine that was made obsolete by Yinghai.
http://thread.gmane.org/gmane.linux.kernel/559581No 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.cis 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.cmostly 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
Quoted 7 lines
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
Quoted 2 lines
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
H. Peter Anvin
reviewerQuoted 7 lines · Andi Kleen
Quoted 2 lines
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
Re: [PATCH] x86: add PCI IDs to k8topology_64.c II
In reply to Andi KleenQuoted 1 line
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
Re: [PATCH] x86: add PCI IDs to k8topology_64.c II
Quoted 5 lines · Andi Kleen
Quoted 1 line
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
Re: [PATCH] x86: add PCI IDs to k8topology_64.c II
Quoted 9 lines · Yinghai Lu
Quoted 5 lines · Andi Kleen
Quoted 1 line
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
Re: [PATCH] x86: add PCI IDs to k8topology_64.c II
Quoted 12 lines · Andi Kleen
Quoted 9 lines · Yinghai Lu
Quoted 5 lines · Andi Kleen
Quoted 1 line
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...
Quoted 7 lines
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
Re: [PATCH] x86: add PCI IDs to k8topology_64.c II
In reply to Andi KleenQuoted 4 lines · Andi Kleen
Quoted 1 line
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