[Pdbg] [PATCH 2/3] htm: Allow nest htm in htm_toggle_debug_bit()

Michael Neuling mikey at neuling.org
Tue Sep 4 16:12:30 AEST 2018


Currently htm_toggle_debug_bit() assumes the target's parent is a core
but this is only the case for core htm. For nest htm, the target's
parent is a chip.

Also for nest, we don't need to toggle this bit.

This detects the nest htm case and just returns.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 libpdbg/htm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libpdbg/htm.c b/libpdbg/htm.c
index 6bc6b734e4..f9013e5aba 100644
--- a/libpdbg/htm.c
+++ b/libpdbg/htm.c
@@ -730,9 +730,15 @@ static int do_htm_reset(struct htm *htm, bool wrap)
 static int htm_toggle_debug_bit(struct htm *htm)
 {
 	struct pdbg_target *target;
-	struct pdbg_target *core = pdbg_target_require_parent("core", &htm->target);
+	struct pdbg_target *core;
 	uint64_t reg;
 
+	/* NHTM doesn't have a core as a parent but donesn't need this
+	 * bit toggled */
+	core = pdbg_target_parent("core", &htm->target);
+	if (!core)
+		return 0; /* nhtm case */
+
 	/* FIXME: this is a hack for P8 */
 	if (!dt_node_is_compatible(core, "ibm,power8-core")) {
 		PR_ERROR("HTM is POWER8 only currently\n");
-- 
2.17.1



More information about the Pdbg mailing list