Subject: Re: [PATCH v2] powerpc/vphn: fix endian issue in NUMA device node code

From: Nishanth Aravamudan <[email-masked]>
Date: Mon, 6 Oct 2014 15:36:40 -0700

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 <[email-masked]>
> 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 <[email-masked]>
> Signed-off-by: Greg Kurz <[email-masked]>

Reviewed-by: Nishanth Aravamudan <[email-masked]>
Tested-by: Nishanth Aravamudan <[email-masked]>

> ---
> 
> 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