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 57B1138582B2 for ; Fri, 23 Sep 2022 16:42:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 57B1138582B2 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 4MYycX6cG3z3tyZ; Fri, 23 Sep 2022 16:42:36 +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 4MYycX5rJTz3C0m; Fri, 23 Sep 2022 16:42:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663951356; 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=Tis4QyCzfEIB2Ql0KRTbYOjRAiQ9jslKD8y8+uzA6Cc=; b=cunAC7N8uoW8nS4EbneDTYSlNRx9bc82tY4WqmOBsHRiEOTlztGe2V7dluOycaREbCZf4K mSdvxM17SBn2xjf4g5883aeE7cadnSqFh5fXcFuF3/vrWRQjk0/3vKweByBqBzd/wtrsIW fHUccKoGpk/hYRRvTC2Qmzk1PqMfoqz/N3/BL12W8BVKQ6C9UkdqAV1Uxx4TZDrBrTFkKL 1CRUSXilurrFkAH4RWlKh0o3HJs14x1zaYI/6p5vTidG72luvNSg5LpMyBdalPEaWwkEeg M3tVuBxMQX4ezmfG9uXCUHOreJ97ye/OWxcI87p0ABkZ2db0+DanCh0F5eV/nQ== 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 4MYycX2tg1z1RMM; Fri, 23 Sep 2022 16:42:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <37c2c67d-9988-eb73-417f-4aa9a2f68a2b@FreeBSD.org> Date: Fri, 23 Sep 2022 09:42:35 -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: [PATCH] [AArch64] Add TPIDR2 register support for Linux Content-Language: en-US To: Luis Machado , gdb-patches@sourceware.org References: <20220923134648.114930-1-luis.machado@arm.com> From: John Baldwin In-Reply-To: <20220923134648.114930-1-luis.machado@arm.com> 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=1663951356; 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=Tis4QyCzfEIB2Ql0KRTbYOjRAiQ9jslKD8y8+uzA6Cc=; b=w5LqmjXwYTQpbidiBAIGlP5awDKNyC+9o7WhYjPoNF/iziaHy0NFRJ4TW498fexVj6799s mYHJU2BVEVYGLfUW0/2p7rW4z2nEEXylB0jCbrDCOeR21u+VGM/rIqG+5jNBGPr9zFKFKG CfNAZwbV2Cyx1dXU+h9ZyX64CHLNuO3JjpkV0Ohdjfia5exDk3TE45HBgAMHHoCqO6fLnx eSJvGv3DwVxMjrLejSazNTnF+khTnqNvlx/Ef/jQvvj1qBvmpvgLV7NJfKQGKevGGiep1S 4nz85oMQ3+1IeoqC+6Lb/dykpdnArmdIsU9/nqRtDkahc86glhzV1sC2/yfAxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663951356; a=rsa-sha256; cv=none; b=ynNtJkIRjWpbw6qWUKBK/b6RIVJS5KHIhS2QzVB2NQHcUipnp1/WITRnVnJjxdbHm5ItxZ FqaFizB/+7GHArLrstwz7qOedeP6k0Gv8Yb7gR7D+6wyKpXzv4k4gK3K8G0C56F2h+fobg VUky6B0E259UCvmOIZIeTvfEgM2dIeb8nQbWBVX2BUqkuqPofCHUeXpGk0ufBl1lnNYEHY htJns1RSPPjmIgs+dI9//6SEcmeycQXwYPuNK+sh2MeKdlVSETTfon66xhNMrY56gmoqBU QLCzMMkrWDqZKOl2bhKWYQ17YwNrQbe/wUK+o0bjH2w7jDhoe3ot2KiUHLpl6Q== 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 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: Fri, 23 Sep 2022 16:42:53 -0000 On 9/23/22 6:46 AM, Luis Machado wrote: > With the AArch64 Scalable Matrix Extension we have a new TPIDR2 register, and > it will be added to the existing NT_ARM_TLS register set. Kernel patches are > being reviewed here: > > https://lore.kernel.org/linux-arm-kernel/20220818170111.351889-1-broonie@kernel.org/ > > From GDB's perspective, we handle it in a similar way to the existing TPIDR > register. But we need to consider cases of systems that only have TPIDR and > systems that have both TPIDR and TPIDR2. > > With that in mind, the following patch adds the required code to support > TPIDR2 and turns the org.gnu.gdb.aarch64.tls feature into a > dynamically-generated target description as opposed to a static target > description containing only TPIDR. > > That means we can remove the gdb/features/aarch64-tls.xml file and replace the > existing gdb/features/aarch64-tls.c auto-generated file with a new file that > dynamically generates the target description containing either TPIDR alone or > TPIDR and TPIDR2. > > In the future, when *BSD's start to support this register, they can just > enable it as is being done for the AArch64 Linux target. > > The core file read/write code has been updated to support TPIDR2 as well. > > On GDBserver's side, there is a small change to the find_regno function to > expose a non-throwing version of it. > > It always seemed strange to me how find_regno causes the whole operation to > abort if it doesn't find a particular register name. The patch moves code > from find_regno into find_regno_no_throw and makes find_regno call > find_regno_no_throw instead. > > This allows us to do register name lookups to find a particular register > number without risking erroring out if nothing is found. > > The patch also adjusts the feature detection code for aarch64-fbsd, since > the infrastructure is shared amongst all aarch64 targets. I haven't added > code to support TPIDR2 in aarch64-fbsd though, as I'm not sure when/if > that will happen. The fbsd bits look fine to me. -- John Baldwin