powerpc/perf/imc: Use cpu_to_node() not topology_physical_package_id()
authorMichael Ellerman <mpe@ellerman.id.au>
Sun, 15 Oct 2017 18:43:41 +0000 (00:13 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Nov 2017 08:40:56 +0000 (08:40 +0000)
commit0b090846da0a14d24a2c943d3ae030692594c9f6
tree4365bd0701d03d42ab19f9c722c9b42a4af2deb7
parent44a4adbc9949653a89e027a86caf373ec49a2fd1
powerpc/perf/imc: Use cpu_to_node() not topology_physical_package_id()

commit f3f1dfd600ff82b18b7ea73d80eb27f476a6aa97 upstream.

init_imc_pmu() uses topology_physical_package_id() to detect the
node id of the processor it is on to get local memory, but that's
wrong, and can lead to crashes. Fix it to use cpu_to_node().

Fixes: 885dcd709ba9 ("powerpc/perf: Add nest IMC PMU support")
Reported-By: Rob Lippert <rlippert@google.com>
Tested-By: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/perf/imc-pmu.c