[PATCH v2] powerpc/vphn: fix endian issue in NUMA device node code
Nishanth Aravamudan
nacc at linux.vnet.ibm.com
Tue Oct 7 09:36:40 EST 2014
On 03.10.2014 [11:13:17 +0200], Greg Kurz wrote:
> The associativity domain numbers are obtained from the hypervisor through
> registers and written into memory by the guest: the packed array passed to
> vphn_unpack_associativity() is then native-endian, unlike what was assumed
> in the following commit:
>
> commit b08a2a12e44eaec5024b2b969f4fcb98169d1ca3
> Author: Alistair Popple <alistair at popple.id.au>
> Date: Wed Aug 7 02:01:44 2013 +1000
>
> powerpc: Make NUMA device node code endian safe
>
> If a CPU home node changes, the topology gets filled with
> bogus values. This leads to severe performance breakdowns.
>
> This patch does two things:
> - extract values from the packed array with shifts, in order to be endian
> neutral
> - convert the resulting values to be32 as expected
>
> Suggested-by: Anton Blanchard <anton at samba.org>
> Signed-off-by: Greg Kurz <gkurz at linux.vnet.ibm.com>
Reviewed-by: Nishanth Aravamudan <nacc at linux.vnet.ibm.com>
Tested-by: Nishanth Aravamudan <nacc at linux.vnet.ibm.com>
> ---
>
> Changes in v2:
> - removed the left out __be16 *field declaration
> - removed the left out be16_to_cpup() call
> - updated the comment of the magic formula
>
> Thanks again Nish... the two left outs probably explain why PowerVM wasn't
> happy that patch. :P
Yep, I've tested this v2 patch successfully now!
-Nish
More information about the Linuxppc-dev
mailing list