From patchwork Tue Mar 29 15:48:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1610682 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=PEiGSl6i; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4KSYsr2TbPz9sFk for ; Wed, 30 Mar 2022 02:49:52 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KSYsq6Srdz2yJQ for ; Wed, 30 Mar 2022 02:49:51 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=PEiGSl6i; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::62a; helo=mail-pl1-x62a.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=PEiGSl6i; dkim-atps=neutral Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 4KSYsk6Sdqz2xYG for ; Wed, 30 Mar 2022 02:49:44 +1100 (AEDT) Received: by mail-pl1-x62a.google.com with SMTP id y6so15463866plg.2 for ; Tue, 29 Mar 2022 08:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mz+gtBVb7K04pIIEXjkBlNDuB7X2WKLSVUjiG3D2fIw=; b=PEiGSl6idhBNEH0VeI6s/hz3qfMtgF5XsdkGNsQGs7ASwnKh+I7H7h81BKCD+zy+Rr onJG/0jKkmagHAthSbuqRDxFOX9+DwAHN2sxpcEHVWpeVlp5tesurPkBqByOQFetnO0E YHMbY9iD4nWuZkTonUxo9RKDC3UEc6P/akCoOKugRymdWpHCAcBi/kUZ53Y8coJ7/2hE 3XL0ZRoS4PDVwHwqkac55wdu3e+C25k1InzpDRX5XDeMKGKq0MFaELPMfMu5Wzq3Nz7m XB3uLiWlstqjj8lBEHhtVcfRvsqxfm3gNfqrd2Ih21XAQPh3rA8wpkGmLK0DG9M2THXi c+kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mz+gtBVb7K04pIIEXjkBlNDuB7X2WKLSVUjiG3D2fIw=; b=7TzV9U/LGTz+BYUgvCnL2dqvMLfIaDYxp4oEp4zXLHlymqWpL1h5TE4gQtLR5RvwNP Rata+2/xfzv5va8VLHuqd7ptMu1TNgMkcze2DgnkuMDrv03TbcaBLw3TfV67sOAgjWS2 GvV90k4zlZ3DT+oI7Q1YY/s3wCinT+vrHXP7LhB/9TKvkUZDQD/XgqWlSUI04XIt0l8D D0e7toBe3ESxTEWbDiBotYNGLsH6++LlYYeL4YFv9iz6FlBl0kMn6BR6xF+XufVt8kPl SIG8voFwPx9gKx3cpGV84D2Uak/aHIexDcbH4kdMHI23K9g++8387JwG9r+98f3mJD45 Qs+Q== X-Gm-Message-State: AOAM5325KXoqh5hpci99nPH5P+T3gpI2HkpN1JVFhke830Eb0DSRsbVY zBozkj4YzEg/ttlhLbAqXoqIYWNAbaY= X-Google-Smtp-Source: ABdhPJzrI2dzKfQCvpj8Kvh4qYZfCn0HDRp3B5EUyAcEKGG6oGhejCsh3SPExN97VXS3Llp67vcq9g== X-Received: by 2002:a17:90a:bb0e:b0:1c7:e8bf:5561 with SMTP id u14-20020a17090abb0e00b001c7e8bf5561mr252244pjr.18.1648568981356; Tue, 29 Mar 2022 08:49:41 -0700 (PDT) Received: from bobo.ibm.com (58-6-255-110.tpgi.com.au. [58.6.255.110]) by smtp.gmail.com with ESMTPSA id s35-20020a056a001c6300b004fb20b5d6c1sm14163564pfw.40.2022.03.29.08.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Mar 2022 08:49:40 -0700 (PDT) From: Nicholas Piggin To: pdbg@lists.ozlabs.org Date: Wed, 30 Mar 2022 01:48:53 +1000 Message-Id: <20220329154931.493851-1-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [Pdbg] [PATCH v2 00/38] gdbserver multi-threaded debugging and POWER9/10 support 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: Nicholas Piggin Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" POWER10 is working well with sbefifo (modulo the start SBE command being buggy with stop states -- make sure you use powersave=off when testing this, until those can be fixed). POWER9 similarly works well, with the exception of breakpoints causing PSI interrupt storm. gdbserver itself was due for a bit of attention so there's a bunch of improvements and fixes. Multi-threaded debugging is implemented later in the series using the gdb "all-stop" threads model (all target threads are stopped if any is stopped). Since v1: - Made changes suggested by Joel (thanks). - Implemented multi-threaded debugging. - A few more smaller improvements (put_mem handling, breakpoint command handling, returning more registers). - Redudce round trips further by returning registers with stop reason. - POWER9 support as well. - Proper SPATTN / attn detection and clearing for POWER9/10. Thanks, Nick Nicholas Piggin (38): gdbserver: fix put_mem command parsing libpdbg: fix p9chip and p10chip thread_stop gdbserver: update gdb_parser_precompile.c, rename detach command gdbserver: include argument in command line help text gdbserver: Document problem and workaround for client remote timeouts gdbserver: print some client/server info gdbserver: Make command static gdbserver: use standard compatibility test calls gdbserver: fix read buffer overflow gdbserver: reduce PR_INFO noise gdbserver: fix interrupt double stop reason response libpdbg: thread_regs don't print regs gdbserver: lexer fixes gdbserver: put_mem handle arbitrary lengths gdbserver: implement NoAckMode libpdbg: Remove enable_attn target command gdbserver: disable attn after breaking gdbserver: use read-modify-write for put_mem that is not 8-byte aligned gdbserver: enable POWER9 support gdbserver: Add POWER10 support gdbserver: check for attn using the SPATTN register gdbserver: test endian when it is required gdbserver: catch ctrl-C gdbserver: return more registers gdbserver: initial thread support gdbserver: track attn enablement by breakpoints gdbserver: implement get_thread / set_thread commands gdbserver: add multi-threaded start/stop helper functions gdbserver: tidy poll() gdbserver: multi-thread polling and stop-reason gdbserver: track stop reason per thread gdbserver: multithread debugging support gdbserver: allow gdbserver to start with targets running gdbserver: better deal with threads initially stopped gdbserver: send regs with stop reason gdbserver: use thread_stop_all() / thread_start_all() gdbserver: handle gdb breakpoint commands gdbserver: remove fallback breakpoint support in put_mem README.md | 38 +- libpdbg/chip.c | 2 - libpdbg/hwunit.h | 2 +- libpdbg/p10chip.c | 8 +- libpdbg/p8chip.c | 31 - libpdbg/p9chip.c | 8 +- libpdbg/thread.c | 7 +- src/gdb_parser.rl | 124 +++- src/gdb_parser_precompile.c | 478 ++++++++++----- src/main.c | 2 +- src/pdbgproxy.c | 1121 +++++++++++++++++++++++++++++++---- src/pdbgproxy.h | 11 +- src/thread.c | 2 + 13 files changed, 1475 insertions(+), 359 deletions(-)