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 569153858D32 for ; Mon, 22 Aug 2022 18:11:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 569153858D32 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 [96.47.72.80]) (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 4MBL5W1S4Fz3x9v for ; Mon, 22 Aug 2022 18:11:11 +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 4MBL5W0kg0z3YlY for ; Mon, 22 Aug 2022 18:11:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661191871; 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=y0HW7NFtQIf3TmNuHvy3xDxIx2zY68J2sxziBGHVm+A=; b=N1ndCquDsq6jIeS5cx9ISLVRKB6inyAULMOIOXpjBcN6gvC+niydMatDK/I3P9RVScwnbz KSdU+NK3ifGAwR53Q9FrAxl0lUofJHbduoYIBU9w+iy3bGygWuI2AAeTXowh5nfIBuIJ9o zwyXs6CcnRfw7NwEh04ByrPdp7x6s14ufqN/RNhMPzFY4/bJNqXHu9ta8GBwKQlKJ34R9m ew0ItZJOO1cnzIGlmWfJ7kZ6kbUPdtxnBNtEjmey0MkyFFSWQJgg1h8kmqkwbDXJK0lDkX /boqxE2MTlZ5a3aTEkAdEMDt5aOO+GzPK1FNZPd8VHs12IiG5A9gpcUfrd4Ayw== 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 4MBL5V5RKpzX87 for ; Mon, 22 Aug 2022 18:11:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <05fb4402-32c5-123d-075a-5a7e78d2a5fd@FreeBSD.org> Date: Mon, 22 Aug 2022 11:11:09 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.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> In-Reply-To: <099949c8-edc0-a7b9-cf5e-9eebdd13e759@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=1661191871; 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=y0HW7NFtQIf3TmNuHvy3xDxIx2zY68J2sxziBGHVm+A=; b=KSQr21nrAfhE+rYSv59K/F3NzTse8fmjxOHgrWNxWgvxpvEHGpFkP7N1MrqVVyueelw0Rr Mv6fuh1+XH8GZdxXu5gyqtSgaJ9UPk9XHxwt1+zWPe4L9mG3cfAlIvpRayeZjnCYU8ujKR NF63CPzvOo0uDBtSneBcvtiDOkTh3f7SZlF0wCb53Yp6ZEI95c7EHzTskw2yb1olCPMusQ J7jPZ9Jo4p83z3M8XCMvFXWTnlJZBqOEVNCsWo/qIpRAQFMsB/qLodzyvpmnfAWLUCdo91 JIF9OML7PAMepIL9hYzCPDtVmYGZcNsJHhrfAEnHp/+n39hwCeTHqc5s4uDs4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661191871; a=rsa-sha256; cv=none; b=snd6Lg3of75O+O8IdDD9U0LEAko5fZnHvziNlhKNL+eui+ZfVHno6oarSR2i+vXbEVwmvb xMXqbFsoUyWh7BS+J3ptcoW5aY5PaomsfH0VEqjMHCPtj+R6ykKw1fHSj9Z+JX82E7plQv ocgF34G/RhNqfUdtqWCN+UglEs7y7AeyMBFnX1LHc5TzhXd0bjve7NckOSgegSBAW4rw8a oUNVsks38AtXnw33jw+iE0cSaZRClApkbPP04oBgvRnJEJx93rj2XG13z98WtNluBRWIms X52ZUA1DSOGf3YwR7nMQMIJEzMhUp4brxZOBYH7lEd92TVkTd9Dr++/QuAyrZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-Spam-Status: No, score=-4.8 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, T_SCC_BODY_TEXT_LINE 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: Mon, 22 Aug 2022 18:11:15 -0000 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. > -- John Baldwin