diff options
author | Greg Kurz <gkurz@linux.vnet.ibm.com> | 2015-02-23 10:14:19 -0500 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-03-17 19:48:59 -0400 |
commit | 9d0e6d9db56a38e205e7138837b885082dc769ec (patch) | |
tree | 4b8eec6f84f5cd97d75e8f9cd6573452e54c8e2c /arch | |
parent | 52d99627003278bcd1a40ea45136a8148d351531 (diff) |
powerpc/vphn: clarify the H_HOME_NODE_ASSOCIATIVITY API
The number of values returned by the H_HOME_NODE_ASSOCIATIVITY h_call deserves
to be explicitly defined, for a better understanding of the code.
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/mm/numa.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 0257a7d659ef..7a5bc21152f6 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -1247,11 +1247,15 @@ static int update_cpu_associativity_changes_mask(void) | |||
1247 | return cpumask_weight(changes); | 1247 | return cpumask_weight(changes); |
1248 | } | 1248 | } |
1249 | 1249 | ||
1250 | /* The H_HOME_NODE_ASSOCIATIVITY h_call returns 6 64-bit registers. | ||
1251 | */ | ||
1252 | #define VPHN_REGISTER_COUNT 6 | ||
1253 | |||
1250 | /* | 1254 | /* |
1251 | * 6 64-bit registers unpacked into 12 32-bit associativity values. To form | 1255 | * 6 64-bit registers unpacked into 12 32-bit associativity values. To form |
1252 | * the complete property we have to add the length in the first cell. | 1256 | * the complete property we have to add the length in the first cell. |
1253 | */ | 1257 | */ |
1254 | #define VPHN_ASSOC_BUFSIZE (6*sizeof(u64)/sizeof(u32) + 1) | 1258 | #define VPHN_ASSOC_BUFSIZE (VPHN_REGISTER_COUNT*sizeof(u64)/sizeof(u32) + 1) |
1255 | 1259 | ||
1256 | /* | 1260 | /* |
1257 | * Convert the associativity domain numbers returned from the hypervisor | 1261 | * Convert the associativity domain numbers returned from the hypervisor |
@@ -1309,7 +1313,7 @@ static long hcall_vphn(unsigned long cpu, __be32 *associativity) | |||
1309 | int i; | 1313 | int i; |
1310 | 1314 | ||
1311 | rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, hwcpu); | 1315 | rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, hwcpu); |
1312 | for (i = 0; i < 6; i++) | 1316 | for (i = 0; i < VPHN_REGISTER_COUNT; i++) |
1313 | retbuf[i] = cpu_to_be64(retbuf[i]); | 1317 | retbuf[i] = cpu_to_be64(retbuf[i]); |
1314 | vphn_unpack_associativity(retbuf, associativity); | 1318 | vphn_unpack_associativity(retbuf, associativity); |
1315 | 1319 | ||