diff mbox series

[3/3] htm: Setup targetting for nest htm

Message ID 20180904061231.6409-3-mikey@neuling.org
State Accepted
Headers show
Series [1/3] htm: Always run configure functions | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Michael Neuling Sept. 4, 2018, 6:12 a.m. UTC
Without this, nest HTM commands target nothing.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 src/htm.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/htm.c b/src/htm.c
index 97c7d14434..8dd7303696 100644
--- a/src/htm.c
+++ b/src/htm.c
@@ -255,7 +255,7 @@  fail:
 
 int run_htm(int optind, int argc, char *argv[])
 {
-	struct pdbg_target *target;
+	struct pdbg_target *target, *nhtm;
 	enum htm_type type;
 	struct pdbg_target *core_target = NULL;
 	int i, rc = 0;
@@ -322,6 +322,16 @@  int run_htm(int optind, int argc, char *argv[])
 		}
 	}
 
+	if (type == HTM_NEST) {
+		pdbg_for_each_class_target("pib", target) {
+			if (!target_selected(target))
+				continue;
+
+			pdbg_for_each_target("nhtm", target, nhtm)
+				target_select(nhtm);
+		}
+	}
+
 	optind++;
 	for (i = 0; i < ARRAY_SIZE(actions); i++) {
 		if (strcmp(argv[optind], actions[i].name) == 0) {