From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by sourceware.org (Postfix) with ESMTPS id E0054385828D for ; Thu, 20 Oct 2022 20:26:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E0054385828D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4MtfJY4VY1z4BNc for ; Thu, 20 Oct 2022 20:26:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MtfJY3lGbz3NNn for ; Thu, 20 Oct 2022 20:26:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666297597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C+HTFB2KUAA9o7ar8pi1sahjz8JM6DB/6YD0YPO5H+w=; b=QBNlDN2v+n8cXy5lA3HiQKJyPPncxdfD/ZLq0AmhUiMSI5PZRr4g3+tVUIW3i9iML3nxrb rCImOrChWlFoefjkwemFy/Zxf7Jfrxtj+hpFNcECii+uMrcar/NE2ClYJe1oizs96WVTcT r28iJaPKRZqfW/aogCsbvIkJjsfU0JgVtJ2z156aciUAlXFJgajyh7ASTQ8l8XGmokk/83 cDBk0D06GdE1oasbj/OhP+7JXo7XYf0Y5bknlLbiW48pAOPkUqGc0RupITgA2IwDk5FpAQ cehaHLim4ggt7gsEr6FznKzkyDFxeTw5+VLkE7E9E95EJMt+1Yf8sLOaZwK7eQ== Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4MtfJY1QtlzWh4 for ; Thu, 20 Oct 2022 20:26:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <13906179-7682-8d0e-06fa-e50084029a17@FreeBSD.org> Date: Thu, 20 Oct 2022 13:26:36 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PING 4] [PATCH 0/5] Improve support for regcache_map_entry with variable register base Content-Language: en-US From: John Baldwin To: gdb-patches@sourceware.org References: <20220708005816.9408-1-jhb@FreeBSD.org> <099949c8-edc0-a7b9-cf5e-9eebdd13e759@FreeBSD.org> <05fb4402-32c5-123d-075a-5a7e78d2a5fd@FreeBSD.org> <5dabc301-e7af-1e8c-a70d-555ce22c8064@FreeBSD.org> In-Reply-To: <5dabc301-e7af-1e8c-a70d-555ce22c8064@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666297597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C+HTFB2KUAA9o7ar8pi1sahjz8JM6DB/6YD0YPO5H+w=; b=tuRG6wuW8EHEt5mQ5rqI3UXRmqAjtERRd2HGs820Y3ExJqJUbnaoLExE4ph5LeUPJEBoHR njytYhF1UwLZuoHHI2eqtjqF2APTgoNmSsbYfKCaTnz6ggy7iETyMPQ8mtlbTVMCpCjN9g 2NCvjh3OSc4A753TLaMctyF8aeTUpSj0yXQLrGge8PUlbbHIfixgl8tVcwLCBEYsX533CG wkESgubobkYcWIJJ3jQV9zHAQZ1nrmY+Jxc+z/6/StuwS9x6yRZyE3wchhbswl33C9rzn8 9fAefeFgcu8aPqydw4+EWNMNEh9oIujJCaajG386QrRWHDY3KsWbs6DBNl0bQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666297597; a=rsa-sha256; cv=none; b=b6+6EuUSPmgT1gcfN6clbuQXd3lqNRA17svf46yd/IAm9r3N7GEcD9vr+fs0mVXAHFXGda biseTVUl7/pEjsjno7YH+nSF8+QnBjKDGVkuuTBEKh+c/LumEJjLDphRDlw0w1+e5xSzSg 8Zt3EyyoC2r97okuYBJnq0iOOJySAwZ2HOg/25i9cHAPsB436MONb2RPIkFrUy7FHGPRjW d3hXvaLHyNAiGpTqJvd7rRVYQhb4jYi9VY6IaJJEp91OyoY8zqZ8ej/LRQ6bhMBSnuh7yO 6l69VzUErTvbjJJ4hGza9wLaybwsOCfKMUaB+R03uyt+0RfryLZ7fpBanqc5Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Thu, 20 Oct 2022 20:26:39 -0000 On 9/20/22 10:50 AM, John Baldwin wrote: > On 8/22/22 7:11 PM, John Baldwin wrote: >> On 7/21/22 7:53 AM, John Baldwin wrote: >>> On 7/7/22 5:58 PM, John Baldwin wrote: >>>> When I added support for TLS to the ARM and AArch64 architectures on >>>> FreeBSD, I had to construct register maps and associated register sets >>>> on the fly in both the callback for processing register core dump >>>> notes and in the native target routines to fetch and store registers. >>>> >>>> The reason I had to create these on the fly is that the register >>>> number was not known at compile time, so the register map and register >>>> set could not be constant structures shared among the -tdep and -nat >>>> code the way other register sets were. >>>> >>>> This series aims to rectify that. The first patch adds new variants >>>> of regcache::collect_regset and regcache::supply_regset that accept an >>>> additional 'regbase' argument. When these functions iterate over >>>> regcache map entries, the effective register number for the entry is >>>> computed by adding the value in the entry to 'regbase' permittting the >>>> regcache map entries to hold relative register numbers for a block of >>>> registers. >>>> >>>> The rest of the series then makes use of this to use a single, shared >>>> register map and register set for TLS on FreeBSD/ARM and >>>> FreeBSD/AArch64. Using this requires custom supply and collect regset >>>> routines for the TLS regsets that extract the base register number >>>> from the gdbarch's tdep and invoke the new regcache class methods, so >>>> patch 2 updates the wrappers for dealing with regsets in fbsd-nat to >>>> always invoke the regset routines from the regset instead of directly >>>> calling the default functions. Patch 3 is another change to fbsd-nat >>>> to cope with the fact that regcache_map_supplies() needs to pass in >>>> the relative register number in the wrapper routines rather than the >>>> absolute register number. >>>> >>>> Patches 4 and 5 are the updates to the ARM and AArch64 FreeBSD >>>> architectures and targets. >>>> >>>> I have not done the work to make use of this in the Linux AArch64 >>>> architecture, though I think it would apply to at least the TLS and >>>> MTE register sets there in a similar fashion. SVE is harder because >>>> the register sizes change (though SVE might be able to make use of >>>> this if register_size() returns the right value by using a register >>>> size of 0 in the relevant register cache map entries). >>>> >>>> John Baldwin (5): >>>> regcache: Add collect/supply_regset variants that accept a register >>>> base. >>>> fbsd-nat: Use regset supply/collect methods. >>>> fbsd-nat: Pass an optional register base to the register set helpers. >>>> arm-fbsd: Use a static regset for the TLS register set. >>>> aarch64-fbsd: Use a static regset for the TLS register set. >>>> >>>> gdb/aarch64-fbsd-nat.c | 36 +++------------------------ >>>> gdb/aarch64-fbsd-tdep.c | 54 ++++++++++++++++++++++++++++------------- >>>> gdb/aarch64-fbsd-tdep.h | 1 + >>>> gdb/arm-fbsd-nat.c | 34 +++----------------------- >>>> gdb/arm-fbsd-tdep.c | 52 +++++++++++++++++++++++++++------------ >>>> gdb/arm-fbsd-tdep.h | 1 + >>>> gdb/fbsd-nat.c | 42 +++++++++++++++++--------------- >>>> gdb/fbsd-nat.h | 49 +++++++++++++++++++++---------------- >>>> gdb/regcache.c | 28 ++++++++++++++++++--- >>>> gdb/regcache.h | 24 ++++++++++++++++-- >>>> 10 files changed, 181 insertions(+), 140 deletions(-) >>> >>> Ping. >>> >> >> > > Pinging again. Only patch 1 needs approval by another maintainer, the rest > are FreeBSD specific. > -- John Baldwin