powerpc/pseries: Fix how we iterate over the DTL entries
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Thu, 27 Sep 2018 08:10:58 +0000 (13:40 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:19:53 +0000 (08:19 +0100)
commit38d7fa28157e00819741e419543a56d37f2b1ab5
treeb5fcfa724e69f0cb4a8fd692e3235225f6c4f069
parenta3576a228404f5eb2b1dbb42e8dce5390b00088d
powerpc/pseries: Fix how we iterate over the DTL entries

[ Upstream commit 9258227e9dd1da8feddb07ad9702845546a581c9 ]

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: Sasha Levin <sashal@kernel.org>
arch/powerpc/platforms/pseries/dtl.c