diff mbox series

[v3,2/2] xive: Fix opal_xive_dump_tm() to access W2 properly

Message ID 20170913033726.24171-2-benh@kernel.crashing.org
State Accepted
Headers show
Series [v3,1/2] xive: Documentation updates | expand

Commit Message

Benjamin Herrenschmidt Sept. 13, 2017, 3:37 a.m. UTC
The HW only supported limited access sizes.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 hw/xive.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/xive.c b/hw/xive.c
index 21dd3d95..26edd669 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -4733,7 +4733,13 @@  static int64_t opal_xive_dump_tm(uint32_t offset, const char *n, uint32_t pir)
 	xive_regr(x, PC_TCTXT_INDIR0);
 
 	v0 = in_be64(ind_tm_base + offset);
-	v1 = in_be64(ind_tm_base + offset + 8);
+	if (offset == TM_QW3_HV_PHYS) {
+		v1 = in_8(ind_tm_base + offset + 8);
+		v1 <<= 56;
+	} else {
+		v1 = in_be32(ind_tm_base + offset + 8);
+		v1 <<= 32;
+	}
 	prlog(PR_INFO, "CPU[%04x]: TM state for QW %s\n", pir, n);
 	prlog(PR_INFO, "CPU[%04x]: NSR CPPR IPB LSMFB ACK# INC AGE PIPR"
 	      " W2       W3\n", pir);