From patchwork Thu Oct 17 05:03:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1178295 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46txsF14Yvz9sPJ for ; Thu, 17 Oct 2019 16:04:01 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="i/xDUwlE"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46txsD1ywbzDr7F for ; Thu, 17 Oct 2019 16:04:00 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46txs70gc5zDqPf for ; Thu, 17 Oct 2019 16:03:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="i/xDUwlE"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46txs63VM4z9sP3; Thu, 17 Oct 2019 16:03:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1571288634; bh=BzvPblbh2pYwXWnxQmoNIkFU0qfgLeWLvUl/QPMwobo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i/xDUwlEsdtwxQIzdGTxQCzyG58e3YXKakF+RCkYRrTTrv+WPfCPk+4/zTEoQ8oB8 aQmhSdk5mT1TbG0+Ugw+ZH9GLrqs2toTjNlA7Xf/IXUtPAjHt2XxdPrSXhjKylNBu2 myJ1QWEvUJ686bz97y/N2uwXoKxggZtWjECXbW7vgR78YCqQUC55VCn1I51lzju80e /nxyX1CBTwhDbfbMoPZ3z2kpkwpylIhbgFscdyfMhFru3/zgv7rYSA6D9qcsCRUuFA QI4xxaydUaElYM7B0g53Ilm3ENwqiW3tLSvKKP6IZxRF39AMh8QdGt0woHEC4faMyj l3Fq/CGz6wUnQ== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 17 Oct 2019 16:03:48 +1100 Message-Id: <20191017050350.26820-2-amitay@ozlabs.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191017050350.26820-1-amitay@ozlabs.org> References: <20191017050350.26820-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v2 1/3] istep: Add checking for istep major/minor numbers X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- src/istep.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/istep.c b/src/istep.c index 7a3c8f3..810d42e 100644 --- a/src/istep.c +++ b/src/istep.c @@ -20,18 +20,40 @@ #include "optcmd.h" #include "path.h" +struct istep_data { + int major; + int minor_first; + int minor_last; +} istep_data[] = { + { 2, 2, 17 }, + { 3, 1, 22 }, + { 4, 1, 34 }, + { 5, 1, 2 }, + { 0, 0, 0 }, +}; + static int istep(uint32_t major, uint32_t minor) { struct pdbg_target *target; - int count = 0; + int count = 0, i; if (major < 2 || major > 5) { fprintf(stderr, "Istep major should be 2 to 5\n"); return 0; } - if (major == 2 && minor == 1) { - fprintf(stderr, "Istep 2 minor should be > 1\n"); - return 0; + + for (i=0; istep_data[i].major != 0; i++) { + if (istep_data[i].major != major) + continue; + + if (minor < istep_data[i].minor_first || + minor > istep_data[i].minor_last) { + fprintf(stderr, "Istep %d minor should be %d to %d\n", + major, + istep_data[i].minor_first, + istep_data[i].minor_last); + return 0; + } } for_each_path_target_class("pib", target) { From patchwork Thu Oct 17 05:03:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1178297 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46txsM3tp1z9sP3 for ; Thu, 17 Oct 2019 16:04:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="o/PexZkK"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46txsL6pCWzDr8v for ; Thu, 17 Oct 2019 16:04:06 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46txs71SwhzDr6S for ; Thu, 17 Oct 2019 16:03:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="o/PexZkK"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46txs66X7Jz9sPV; Thu, 17 Oct 2019 16:03:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1571288634; bh=Yee59xjTqfhwolr+uZJ8/t85csFKTDslSscigW0jQBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o/PexZkKNnjr5gDO/AVNRn8r00FCaQpYMiKwfm/bcp9zW621bqwS6pNl2tFFMBkVR Kv6Wy3tlwfRik2rXlViw/PXQ4wJ/H9Qtf6Nj6/OFqh9RQcJIkhDKPztYdyco2LV4xz QlRFHeXlbjB4Xop3U4kewpcas0UiflbxKnyfXtcPoOZvFHOydZyy0T4EjXjuuJT2Od OcXirTFkq8R4CXHiW+caUfUWhy4B9a0te7JZ3zcN1RtEGBWG8prxOH1e06rVLF19cu uOhV4Qpno6sGQO1w5YuaEUPRhfmb23C44XOlj8XVvhck4NQ6L01x0R8/kxXt9rttWJ VmnpNvytCJxCg== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 17 Oct 2019 16:03:49 +1100 Message-Id: <20191017050350.26820-3-amitay@ozlabs.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191017050350.26820-1-amitay@ozlabs.org> References: <20191017050350.26820-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v2 2/3] istep: Use the first sbefifo to run isteps X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- src/istep.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/istep.c b/src/istep.c index 810d42e..bdb13b3 100644 --- a/src/istep.c +++ b/src/istep.c @@ -34,8 +34,21 @@ struct istep_data { static int istep(uint32_t major, uint32_t minor) { - struct pdbg_target *target; - int count = 0, i; + struct pdbg_target *pib; + int count = 0, i, rc; + + for_each_path_target_class("pib", pib) { + if (pdbg_target_index(pib)) + continue; + + if (pdbg_target_status(pib) == PDBG_TARGET_ENABLED) + break; + } + + if (pib == NULL) { + fprintf(stderr, "No processor found to run isteps\n"); + return 0; + } if (major < 2 || major > 5) { fprintf(stderr, "Istep major should be 2 to 5\n"); @@ -56,16 +69,9 @@ static int istep(uint32_t major, uint32_t minor) } } - for_each_path_target_class("pib", target) { - int rc; - - if (pdbg_target_status(target) != PDBG_TARGET_ENABLED) - continue; - - rc = sbe_istep(target, major, minor); - if (!rc) - count++; - } + rc = sbe_istep(pib, major, minor); + if (!rc) + count++; return count; } From patchwork Thu Oct 17 05:03:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1178296 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46txsJ3bsRz9sPF for ; Thu, 17 Oct 2019 16:04:04 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="Ze1dXULk"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46txsJ0j1mzDr7B for ; Thu, 17 Oct 2019 16:04:04 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46txs72sRyzDr6X for ; Thu, 17 Oct 2019 16:03:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="Ze1dXULk"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46txs7118kz9sPW; Thu, 17 Oct 2019 16:03:55 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1571288635; bh=xPwktMFvUCkU40kkYbuOOjHDvEn2UHfV1cvizCTmJ3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ze1dXULkem81tntMZJTF06DPUNOIYZ66wzRhFB2U6YHwxERjD4M302TQLB+qOjGvB Tzhy5P0O8XeOH3yFE1B1ww3KGKQ1GmJzOznCxElEzdL10RtIfe3eMn15ic3ELZxJuh vZfVsHhgrW7c7BY2G3pEB3NHDNHBCNgCP8GDe37M2v1bVvfMAHsSthqHak7f3wmdVA X2fG1spMBW5f4Vuo+zCBBHHI0CM+crKxAfouMTx0U3OSVXsYFevU0qNWI5IqUXeQIN D78kwhGDNzl4bbjjkjeBn5Fb4ItIWe+E0y5FkySNyiaTIXSLT1EFcfdRF96lFdVyaB Yq1D15urVcyCA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 17 Oct 2019 16:03:50 +1100 Message-Id: <20191017050350.26820-4-amitay@ozlabs.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191017050350.26820-1-amitay@ozlabs.org> References: <20191017050350.26820-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v2 3/3] istep: Run all sub-steps if minor is 0 X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- src/istep.c | 18 +++++++++++++++--- src/main.c | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/istep.c b/src/istep.c index bdb13b3..745448b 100644 --- a/src/istep.c +++ b/src/istep.c @@ -36,6 +36,7 @@ static int istep(uint32_t major, uint32_t minor) { struct pdbg_target *pib; int count = 0, i, rc; + int first = minor, last = minor; for_each_path_target_class("pib", pib) { if (pdbg_target_index(pib)) @@ -59,6 +60,12 @@ static int istep(uint32_t major, uint32_t minor) if (istep_data[i].major != major) continue; + if (minor == 0) { + first = istep_data[i].minor_first; + last = istep_data[i].minor_last; + break; + } + if (minor < istep_data[i].minor_first || minor > istep_data[i].minor_last) { fprintf(stderr, "Istep %d minor should be %d to %d\n", @@ -69,10 +76,15 @@ static int istep(uint32_t major, uint32_t minor) } } - rc = sbe_istep(pib, major, minor); - if (!rc) - count++; + for (i = first; i <= last ; i++) { + printf("Running istep %d.%d\n", major, i); + rc = sbe_istep(pib, major, i); + if (rc) + goto fail; + } + count++; +fail: return count; } OPTCMD_DEFINE_CMD_WITH_ARGS(istep, istep, (DATA32, DATA32)); diff --git a/src/main.c b/src/main.c index efdc4bb..029ed07 100644 --- a/src/main.c +++ b/src/main.c @@ -125,7 +125,7 @@ static struct action actions[] = { { "sreset", "", "Reset" }, { "regs", "[--backtrace]", "State (optionally display backtrace)" }, { "gdbserver", "", "Start a gdb server" }, - { "istep", " ", "Execute istep on SBE" }, + { "istep", " |0", "Execute istep on SBE" }, }; static void print_usage(void)