Skip to content

Commit

Permalink
powerpc/pseries: Fix how we iterate over the DTL entries
Browse files Browse the repository at this point in the history
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: 7c105b6 ("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>
  • Loading branch information
Naveen N. Rao authored and Michael Ellerman committed Oct 3, 2018
1 parent db787af commit 9258227
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/dtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 9258227

Please sign in to comment.