From: Naveen N. Rao <hidden> Date: 2018-09-27 08:11:12
Two trivial fixes to DTL buffer access over debugfs when
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set.
- Naveen
Naveen N. Rao (2):
powerpc/pseries: Fix DTL buffer registration
powerpc/pseries: Fix how we iterate over the DTL entries
arch/powerpc/platforms/pseries/dtl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.19.0
From: Naveen N. Rao <hidden> Date: 2018-09-27 08:11:17
When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we register the DTL
buffer for a cpu when the associated file under powerpc/dtl in debugfs
is opened. When doing so, we need to set the size of the buffer being
registered in the second u32 word of the buffer. This needs to be in big
endian, but we are not doing the conversion resulting in the below error
showing up in dmesg:
dtl_start: DTL registration for cpu 0 (hw 0) failed with -4
Fix this in the obvious manner.
Fixes: 7c105b63bd98 ("powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option.")
Signed-off-by: Naveen N. Rao <redacted>
---
arch/powerpc/platforms/pseries/dtl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -149,7 +149,7 @@ static int dtl_start(struct dtl *dtl)/* Register our dtl buffer with the hypervisor. The HV expects the*buffersizetobepassedinthesecondwordofthebuffer*/-((u32*)dtl->buf)[1]=DISPATCH_LOG_BYTES;+((u32*)dtl->buf)[1]=cpu_to_be32(DISPATCH_LOG_BYTES);hwcpu=get_hard_smp_processor_id(dtl->cpu);addr=__pa(dtl->buf);
From: Naveen N. Rao <hidden> Date: 2018-09-27 08:11:17
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 <redacted>
---
arch/powerpc/platforms/pseries/dtl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Michael Ellerman <hidden> Date: 2018-10-04 06:52:52
On Thu, 2018-09-27 at 08:10:57 UTC, "Naveen N. Rao" wrote:
When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we register the DTL
buffer for a cpu when the associated file under powerpc/dtl in debugfs
is opened. When doing so, we need to set the size of the buffer being
registered in the second u32 word of the buffer. This needs to be in big
endian, but we are not doing the conversion resulting in the below error
showing up in dmesg:
dtl_start: DTL registration for cpu 0 (hw 0) failed with -4
Fix this in the obvious manner.
Fixes: 7c105b63bd98 ("powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option.")
Signed-off-by: Naveen N. Rao <redacted>