From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5F4dFSwKq1+VGAAAWB0awg (envelope-from ) for ; Tue, 10 Nov 2020 16:46:20 -0500 Received: by simark.ca (Postfix, from userid 112) id 4D4591F08B; Tue, 10 Nov 2020 16:46:20 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (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 simark.ca (Postfix) with ESMTPS id E07781E58E for ; Tue, 10 Nov 2020 16:46:19 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 645763840C16; Tue, 10 Nov 2020 21:46:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 645763840C16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605044779; bh=Uiqx28IgpL0Bw7eero6Ac12Z6tzIUqeABF0s7PJlVLk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=qEtFHGA79XMiPloXwhuQZ9y1MdXkjYmA6Mok0kGIU20wl/2HNN+JDBKvSeVvoJouI xkTyTV+qQEpJ+Wrc2WrvpNPQ8q/6m7Q/HjBZjfd7wIY2WALckdGHqtdoG4K0wZUh2/ 5s4cdQ7UyZa86qUvA8gRYdsj6NRUYguZgsE1ktwU= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 8C8B53840C0C for ; Tue, 10 Nov 2020 21:46:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8C8B53840C0C X-ASG-Debug-ID: 1605044775-0c856e6cd671660001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id Ij3Aa3HlhQdYkoBS (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Nov 2020 16:46:15 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by smtp.ebox.ca (Postfix) with ESMTP id 7955E441B21; Tue, 10 Nov 2020 16:46:15 -0500 (EST) X-Barracuda-RBL-IP: 192.222.181.218 X-Barracuda-Effective-Source-IP: 192-222-181-218.qc.cable.ebox.net[192.222.181.218] X-Barracuda-Apparent-Source-IP: 192.222.181.218 To: gdb-patches@sourceware.org Subject: [PATCH 00/12] Concurrent displaced stepping Date: Tue, 10 Nov 2020 16:46:02 -0500 X-ASG-Orig-Subj: [PATCH 00/12] Concurrent displaced stepping Message-Id: <20201110214614.2842615-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1605044775 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 5642 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.85785 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This patch series changes GDB to allow concurrent displaced steps to occur simultanesously in a single inferior. The goal is to reduce the bottleneck in applications that need to do many displaced steps at the same time. Patches 09, 11 and 12 are the main ones implementing the feature. The other ones are mostly preparatory patches to reduce the diff and complexity in the main ones. At the end of the series, GDB uses two displaced stepping buffers when debugging an AMD64/Linux program, so is able to execute two displaced steps at a time. There isn't a super significant performance improvement as a result. However, this work was done in the context of ROCm GDB [1], where we have as many displaced step buffers as there are threads. In this context, it makes a huge difference. So, the feature isn't absolutely necessary on AMD64/Linux, but it is there at least to have one reference implementation of an architecture in upstream using multiple displaced step buffers, so that it's possible to test the feature with common hardware. This was regtested on x86-64 Ubuntu 20.04 using the unix, native-gdbserver and native-extended-gdbserver boards. [1] https://github.com/ROCm-Developer-Tools/ROCgdb Simon Marchi (12): gdb: add inferior_execd observable gdb: clear inferior displaced stepping state on exec gdb: rename things related to step over chains gdb: rename displaced_step_closure to displaced_step_copy_insn_closure gdb: rename displaced_step_fixup to displaced_step_finish gdb: introduce status enum for displaced step prepare/finish gdb: pass inferior to get_linux_inferior_data gdb: move displaced stepping types to displaced-stepping.{h,c} gdb: move displaced stepping logic to gdbarch, allow starting concurrent displaced steps gdb: change linux gdbarch data from post to pre-init gdb: make displaced stepping implementation capable of managing multiple buffers gdb: use two displaced step buffers on amd64/Linux gdb/Makefile.in | 1 + gdb/aarch64-linux-tdep.c | 3 +- gdb/aarch64-tdep.c | 18 +- gdb/aarch64-tdep.h | 5 +- gdb/alpha-linux-tdep.c | 2 +- gdb/amd64-linux-tdep.c | 11 +- gdb/amd64-tdep.c | 23 +- gdb/amd64-tdep.h | 9 +- gdb/arc-linux-tdep.c | 2 +- gdb/arm-linux-tdep.c | 19 +- gdb/arm-tdep.c | 183 +++---- gdb/arm-tdep.h | 18 +- gdb/bfin-linux-tdep.c | 2 +- gdb/cris-linux-tdep.c | 2 +- gdb/csky-linux-tdep.c | 2 +- gdb/displaced-stepping.c | 289 +++++++++++ gdb/displaced-stepping.h | 200 ++++++++ gdb/frv-linux-tdep.c | 2 +- gdb/gdbarch.c | 117 ++++- gdb/gdbarch.h | 47 +- gdb/gdbarch.sh | 26 +- gdb/gdbthread.h | 35 +- gdb/hppa-linux-tdep.c | 2 +- gdb/i386-linux-tdep.c | 31 +- gdb/i386-tdep.c | 14 +- gdb/i386-tdep.h | 12 +- gdb/ia64-linux-tdep.c | 2 +- gdb/inferior.h | 1 + gdb/infrun.c | 449 ++++++++---------- gdb/infrun.h | 84 +--- gdb/jit.c | 9 +- gdb/jit.h | 7 - gdb/linux-tdep.c | 114 ++++- gdb/linux-tdep.h | 27 +- gdb/m32r-linux-tdep.c | 2 +- gdb/m68k-linux-tdep.c | 2 +- gdb/microblaze-linux-tdep.c | 2 +- gdb/mips-linux-tdep.c | 2 +- gdb/mn10300-linux-tdep.c | 2 +- gdb/nios2-linux-tdep.c | 2 +- gdb/observable.c | 1 + gdb/observable.h | 3 + gdb/or1k-linux-tdep.c | 2 +- gdb/ppc-linux-tdep.c | 5 +- gdb/riscv-linux-tdep.c | 2 +- gdb/rs6000-aix-tdep.c | 6 +- gdb/rs6000-tdep.c | 94 +++- gdb/s390-linux-tdep.c | 2 +- gdb/s390-tdep.c | 22 +- gdb/sh-linux-tdep.c | 2 +- gdb/solib.c | 4 + gdb/sparc-linux-tdep.c | 2 +- gdb/sparc64-linux-tdep.c | 2 +- .../gdb.arch/amd64-disp-step-avx.exp | 2 +- .../forking-threads-plus-breakpoint.exp | 2 +- .../gdb.threads/non-stop-fair-events.exp | 2 +- gdb/thread.c | 60 ++- gdb/tic6x-linux-tdep.c | 2 +- gdb/tilegx-linux-tdep.c | 2 +- gdb/xtensa-linux-tdep.c | 2 +- 60 files changed, 1352 insertions(+), 647 deletions(-) create mode 100644 gdb/displaced-stepping.c create mode 100644 gdb/displaced-stepping.h -- 2.28.0