summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>2018-09-27 13:40:58 +0530
committerBen Hutchings <ben@decadent.org.uk>2019-02-11 17:53:26 +0000
commitb49a472e93237f2fb7f154c1dafccd61c2873745 (patch)
tree051cf535bde378f18a81eadcf58781b2266fbdf4 /arch/powerpc
parente49692c9d7b95aaca4c26c7c21b1294c836a1394 (diff)
downloadlinux-stable-b49a472e93237f2fb7f154c1dafccd61c2873745.tar.gz
linux-stable-b49a472e93237f2fb7f154c1dafccd61c2873745.tar.bz2
linux-stable-b49a472e93237f2fb7f154c1dafccd61c2873745.zip
powerpc/pseries: Fix how we iterate over the DTL entries
commit 9258227e9dd1da8feddb07ad9702845546a581c9 upstream. When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we look up dtl_idx in the lppaca to determine the number of entries in the buffer. Since lppaca is in big endian, we need to do an endian conversion before using this in our calculation to determine the number of entries in the buffer. Without this, we do not iterate over the existing entries in the DTL buffer properly. Fixes: 7c105b63bd98 ("powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option.") Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/pseries/dtl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c
index e168c8142076..36895f6de163 100644
--- a/arch/powerpc/platforms/pseries/dtl.c
+++ b/arch/powerpc/platforms/pseries/dtl.c
@@ -184,7 +184,7 @@ static void dtl_stop(struct dtl *dtl)
static u64 dtl_current_index(struct dtl *dtl)
{
- return lppaca_of(dtl->cpu).dtl_idx;
+ return be64_to_cpu(lppaca_of(dtl->cpu).dtl_idx);
}
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */