From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 81F933858C55 for ; Tue, 20 Sep 2022 17:50:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 81F933858C55 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 4MX8GL1w00z43F9 for ; Tue, 20 Sep 2022 17:50:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 4MX8GL18y6z3w6K for ; Tue, 20 Sep 2022 17:50:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663696234; 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=bZrY0c6l4bTWPXZ3ChTm8PDHTBWVwvrBpRX88oc/VDc=; b=Z+wydpCA+WKVUAPRnFZWNMuXgkddRrEttrpejBpuqb73PENs0fR/Ahbs9ucQhvh2Q3fxOE YihaEfxMWv3i1KrQYkoo9MbVZl5gHMnBmdmpZXRCj//hKNjtvEVS/2GRNbV1t1DRLLM/3n qXEEi6cT/KwvQpP9Hg9nbEStJbjElvtE5Ie0181fbswtaHVANSYQE75+LM12QZ1dmMbPOY vi/NaEpggRwZkgV0GNVZ7Mpsti06AT8pNErAan+aTapn2Qj7xgTAb7unbnkqlV9uIzKG8w FJcfttzE7syB2icDM6a+4jOT81JHlvvdc19dgZzAKJO7/usk59HFOz1Hz0l2kw== 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 4MX8GK6756z1BNG for ; Tue, 20 Sep 2022 17:50:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <5dabc301-e7af-1e8c-a70d-555ce22c8064@FreeBSD.org> Date: Tue, 20 Sep 2022 10:50:32 -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.0 Subject: Re: [PING] [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> In-Reply-To: <05fb4402-32c5-123d-075a-5a7e78d2a5fd@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=1663696234; 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=bZrY0c6l4bTWPXZ3ChTm8PDHTBWVwvrBpRX88oc/VDc=; b=a4A5gNmNqie5MhMlC7MsetMFbN1zSQjagsFmTkBiQhXB1bFoxWk5hV7Bkb6O8hOeGK+Pb0 Nbxax1qx/iAKvKoOgOm3mkN/vRxz9zriDcR2q1JLuPOKOcoxzbL4hLdYeDkoRYJdo9PQEd bfYe6e87R2z1w4HJ6zTBV2uoymumDfPtTPl61a1aVBf8FZ2I0wWFdMfoSuentObyAbk8d2 ielZv+JHKrsQyB2Z4+DhIIwKepiSo6dJ+hH+S+E6NybczqmR2Xd9V5jkMUotPW8C4p1FgO x7x7IWn0iXKYzSsWR2WpTnwvvw+sHyodWlBhPdWsdYJ9PsxRM0U+npSgV8sTpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663696234; a=rsa-sha256; cv=none; b=C10OeV+pc0cCVHJaTxxlDyOx0YctYuxyZDZSa4l6x8So4jdnEjLAl4IeMa00rShHM9DrU/ ueeP1trKGGOXdm70EWNs2qV43gkQY2z0ZPMDI0p6UegqzgK9Y6JsiprxndjxJ2QSWGvSec vKPKtZh7RTyvlRMx4spB8ItWxJzUShv22Tql5j3zXOSCqobOgUg6MD5GI128nzW65D+Q0B GpkaJoTAWONE5oNjO9cbvPayKrEgN5wj/i8rtvs35adXKOuDxlQY5HYploB2NLbv3/aT4M WkPU9tNSomGcyha46E9vyWOp9KKfg4HYk5SMChOTB9Gn20VDhjF9rH+M1vlhhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, 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: Tue, 20 Sep 2022 17:50:36 -0000 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