Skip to content

Commit 9258227

Browse files
rnavmpe
authored andcommitted
powerpc/pseries: Fix how we iterate over the DTL entries
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>
1 parent db787af commit 9258227

File tree

1 file changed

+1
-1
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+1
-1
lines changed

arch/powerpc/platforms/pseries/dtl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static void dtl_stop(struct dtl *dtl)
184184

185185
static u64 dtl_current_index(struct dtl *dtl)
186186
{
187-
return lppaca_of(dtl->cpu).dtl_idx;
187+
return be64_to_cpu(lppaca_of(dtl->cpu).dtl_idx);
188188
}
189189
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
190190

0 commit comments

Comments
 (0)