aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2011-01-29 07:28:04 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-02-06 21:06:03 -0500
commitc0e5e46f3911a451b6915feda709fd1b9b7f026a (patch)
tree37429ad13b91df41267c85303fd14e77e5f7ce19 /arch/powerpc/mm
parentd69043e8069f493ebee9472bcc78b3f54c5c27d9 (diff)
powerpc/numa: Add length when creating OF properties via VPHN
The rest of the NUMA code expects an OF associativity property with the first cell containing the length. Without this fix all topology changes cause us to misparse the property and put the cpu into node 0. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/numa.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index b2937efdfd7a..d07cd08747e5 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1355,8 +1355,11 @@ static int update_cpu_associativity_changes_mask(void)
1355 return nr_cpus; 1355 return nr_cpus;
1356} 1356}
1357 1357
1358/* 6 64-bit registers unpacked into 12 32-bit associativity values */ 1358/*
1359#define VPHN_ASSOC_BUFSIZE (6*sizeof(u64)/sizeof(u32)) 1359 * 6 64-bit registers unpacked into 12 32-bit associativity values. To form
1360 * the complete property we have to add the length in the first cell.
1361 */
1362#define VPHN_ASSOC_BUFSIZE (6*sizeof(u64)/sizeof(u32) + 1)
1360 1363
1361/* 1364/*
1362 * Convert the associativity domain numbers returned from the hypervisor 1365 * Convert the associativity domain numbers returned from the hypervisor
@@ -1371,7 +1374,7 @@ static int vphn_unpack_associativity(const long *packed, unsigned int *unpacked)
1371#define VPHN_FIELD_MSB (0x8000) 1374#define VPHN_FIELD_MSB (0x8000)
1372#define VPHN_FIELD_MASK (~VPHN_FIELD_MSB) 1375#define VPHN_FIELD_MASK (~VPHN_FIELD_MSB)
1373 1376
1374 for (i = 0; i < VPHN_ASSOC_BUFSIZE; i++) { 1377 for (i = 1; i < VPHN_ASSOC_BUFSIZE; i++) {
1375 if (*field == VPHN_FIELD_UNUSED) { 1378 if (*field == VPHN_FIELD_UNUSED) {
1376 /* All significant fields processed, and remaining 1379 /* All significant fields processed, and remaining
1377 * fields contain the reserved value of all 1's. 1380 * fields contain the reserved value of all 1's.
@@ -1394,6 +1397,9 @@ static int vphn_unpack_associativity(const long *packed, unsigned int *unpacked)
1394 } 1397 }
1395 } 1398 }
1396 1399
1400 /* The first cell contains the length of the property */
1401 unpacked[0] = nr_assoc_doms;
1402
1397 return nr_assoc_doms; 1403 return nr_assoc_doms;
1398} 1404}
1399 1405