From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id bM07NSOdO2lZRzgAWB0awg (envelope-from ) for ; Thu, 11 Dec 2025 23:42:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1765514531; bh=v3F7qig16shkqhLNHnCQbb3j0O6vjH8edC/hBXR9S70=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=AzsaYExXbBdskJjsgYncu0VTBWtVDvh/CwEzZDhoMR6xWvuER9x2OgLN//W0SJXVA HaR2SeiW/qwZAUceuQ9Db6UMXiEMGnOXzxN+OBCfT56y4ozdiUeMaofllWEM1jWE9K BY/oL2f0qhE4TfdKFqu7B8uovLQuPmqyUJlW/jv8= Received: by simark.ca (Postfix, from userid 112) id CA7371E0B6; Thu, 11 Dec 2025 23:42:11 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=lJf6KNtN; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E9B481E048 for ; Thu, 11 Dec 2025 23:42:10 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 59BDF4BA2E24 for ; Fri, 12 Dec 2025 04:42:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59BDF4BA2E24 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=lJf6KNtN Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 561BF4BA2E1E for ; Fri, 12 Dec 2025 04:41:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 561BF4BA2E1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 561BF4BA2E1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765514486; cv=none; b=H2Ho9IBulUVg8SLsBDj1mYU38tt84rJMn5iwT/LIfXZPjFMd/q84PooHTKu7FXHCXXJY5j9PGinW6G/90dUeT6QAyynpfDIPnDYZ3KK1prZ+kQg7u80Rj+2Dpuu0L/17Ncee9xn7jxECF3tmW30SenGQL2rDJ+bmuyUzVtSzU4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765514486; c=relaxed/simple; bh=v3F7qig16shkqhLNHnCQbb3j0O6vjH8edC/hBXR9S70=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=ZYVXP6PrhQlgVu2dBiYJjAmcdQSEZwB1OhHFlIeAXz0qEasqGFDjrQA3+yiZPK9lAbv8xdeSPNgl5WDDnBmIO3w6MZOCwUqhfHjWwOLxlGONsVBHPwN8ChB6VMna8HnRn4db9wleVkJ4JGT+d5FOnTVmVXQTmsJIjmSgCd518ho= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 561BF4BA2E1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1765514482; bh=v3F7qig16shkqhLNHnCQbb3j0O6vjH8edC/hBXR9S70=; h=Date:Subject:To:References:From:In-Reply-To:From; b=lJf6KNtN/uiaG4K3vuGfg03bqnya8qvieHb8UHlsqT60GU033F1o7ILT21Sn5OWCN 7OuQ0edkfPmDkAR6kLR3mI0rmTavgmyXcWOA/Xr9Hp5aEZJtr9Fh3wJ5nZ+WJGNidO I5ZNd3QwaZ10/sKXJWcUublxOoL9wh4mYqK+frwg= Received: by simark.ca (Postfix) id BAFA41E048; Thu, 11 Dec 2025 23:41:22 -0500 (EST) Message-ID: <2e3e88ca-69c1-4299-ae6f-0ceab94d82a3@simark.ca> Date: Thu, 11 Dec 2025 23:41:22 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 10/44] gdb, gdbserver, rsp, ze: acknowledge libraries To: Tankut Baris Aktemur , gdb-patches@sourceware.org, Markus Metzger References: <20250801-upstream-intelgt-mvp-v3-0-59ce0f87075b@intel.com> <20250801-upstream-intelgt-mvp-v3-10-59ce0f87075b@intel.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <20250801-upstream-intelgt-mvp-v3-10-59ce0f87075b@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2025-08-01 05:37, Tankut Baris Aktemur wrote: > From: Markus Metzger > > On some accelerator devices, device shared libraries are loaded from a > host thread rather than from a device thread. The reporting entity may > not be the one that actually does the load. > > Intel GPU devices, for example, that are based on Level-Zero, will report > shared library events via the device's debug interface. This is triggered > from a host thread calling the run-time interface for loading a device > shared library. > > The Level-Zero run-time ensures that this host thread will not return > until the respective debug event has been acknowledged by the debugger. > This allows debuggers to set breakpoints before the new library is used. > > Add a mechanism that allows gdbserver to request acknowledgement of newly > reported shared libraries and GDB to acknowledge requested libraries after > placing breakpoints. I had trouble understanding the need for this until I remembered that the remote inferior only has the GPU threads. So the thread loading the library isn't even part of the inferior. Otherwise, I think it would just naturally work: - host thread hits magic breakpoint - gdbserver fetches event, notices new library loaded, returns "library loaded" event to gdb - gdb loads the new solibs, then resumes the host thread - gdbserver resumes the host thread, allowing the application to use the newly loaded library Simon