diff options
author | Anton Blanchard <anton@samba.org> | 2010-04-07 11:33:44 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-04-28 02:22:33 -0400 |
commit | 4b83c330b4d38e869111bda6e9077d4f61ed974a (patch) | |
tree | c85d12aaea6be5dd26caa1b99ffa6adcaa50bc05 /arch/powerpc | |
parent | dbc9632a8c25c6efcc1ca3f3a2177c855b6e053e (diff) |
powerpc/numa: Add form 1 NUMA affinity
Firmware changed the way it represents memory and cpu affinity on POWER7.
Unfortunately the old method now caps the topology to work around issues
with legacy operating systems. For Linux to get the correct topology we
need to use the new form 1 affinity information.
We set the form 1 field in the client architecture, and if we see "1" in the
ibm,associativity-form property firmware supports form 1 affinity and
we should look at the first field in the ibm,associativity-reference-points
array. If not we use the second field as we always have.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 3 | ||||
-rw-r--r-- | arch/powerpc/mm/numa.c | 17 |
2 files changed, 17 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 5f306c4946e5..97d4bd9442d3 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -653,6 +653,7 @@ static void __init early_cmdline_parse(void) | |||
653 | #else | 653 | #else |
654 | #define OV5_CMO 0x00 | 654 | #define OV5_CMO 0x00 |
655 | #endif | 655 | #endif |
656 | #define OV5_TYPE1_AFFINITY 0x80 /* Type 1 NUMA affinity */ | ||
656 | 657 | ||
657 | /* Option Vector 6: IBM PAPR hints */ | 658 | /* Option Vector 6: IBM PAPR hints */ |
658 | #define OV6_LINUX 0x02 /* Linux is our OS */ | 659 | #define OV6_LINUX 0x02 /* Linux is our OS */ |
@@ -706,7 +707,7 @@ static unsigned char ibm_architecture_vec[] = { | |||
706 | OV5_DONATE_DEDICATE_CPU | OV5_MSI, | 707 | OV5_DONATE_DEDICATE_CPU | OV5_MSI, |
707 | 0, | 708 | 0, |
708 | OV5_CMO, | 709 | OV5_CMO, |
709 | 0, | 710 | OV5_TYPE1_AFFINITY, |
710 | 0, | 711 | 0, |
711 | 0, | 712 | 0, |
712 | 0, | 713 | 0, |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 64c00227b997..eaa7633515b7 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -242,10 +242,11 @@ EXPORT_SYMBOL_GPL(of_node_to_nid); | |||
242 | */ | 242 | */ |
243 | static int __init find_min_common_depth(void) | 243 | static int __init find_min_common_depth(void) |
244 | { | 244 | { |
245 | int depth; | 245 | int depth, index; |
246 | const unsigned int *ref_points; | 246 | const unsigned int *ref_points; |
247 | struct device_node *rtas_root; | 247 | struct device_node *rtas_root; |
248 | unsigned int len; | 248 | unsigned int len; |
249 | struct device_node *options; | ||
249 | 250 | ||
250 | rtas_root = of_find_node_by_path("/rtas"); | 251 | rtas_root = of_find_node_by_path("/rtas"); |
251 | 252 | ||
@@ -258,11 +259,23 @@ static int __init find_min_common_depth(void) | |||
258 | * configuration (should be all 0's) and the second is for a normal | 259 | * configuration (should be all 0's) and the second is for a normal |
259 | * NUMA configuration. | 260 | * NUMA configuration. |
260 | */ | 261 | */ |
262 | index = 1; | ||
261 | ref_points = of_get_property(rtas_root, | 263 | ref_points = of_get_property(rtas_root, |
262 | "ibm,associativity-reference-points", &len); | 264 | "ibm,associativity-reference-points", &len); |
263 | 265 | ||
266 | /* | ||
267 | * For type 1 affinity information we want the first field | ||
268 | */ | ||
269 | options = of_find_node_by_path("/options"); | ||
270 | if (options) { | ||
271 | const char *str; | ||
272 | str = of_get_property(options, "ibm,associativity-form", NULL); | ||
273 | if (str && !strcmp(str, "1")) | ||
274 | index = 0; | ||
275 | } | ||
276 | |||
264 | if ((len >= 2 * sizeof(unsigned int)) && ref_points) { | 277 | if ((len >= 2 * sizeof(unsigned int)) && ref_points) { |
265 | depth = ref_points[1]; | 278 | depth = ref_points[index]; |
266 | } else { | 279 | } else { |
267 | dbg("NUMA: ibm,associativity-reference-points not found.\n"); | 280 | dbg("NUMA: ibm,associativity-reference-points not found.\n"); |
268 | depth = -1; | 281 | depth = -1; |