From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cXFULiZrpmlTzhEAWB0awg (envelope-from ) for ; Tue, 03 Mar 2026 00:01:26 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=RMfo/F30; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B56A81E0DD; Tue, 03 Mar 2026 00:01:26 -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 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 DBDDE1E08D for ; Tue, 03 Mar 2026 00:01:25 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 46CC14BA2E24 for ; Tue, 3 Mar 2026 05:01:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46CC14BA2E24 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=RMfo/F30 Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) by sourceware.org (Postfix) with ESMTPS id 685D34BA2E0B for ; Tue, 3 Mar 2026 05:00:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 685D34BA2E0B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 685D34BA2E0B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::92b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772514052; cv=none; b=sN8AaleGhNpnx3lltq3WVfpXWx+LGswWYuiRnUi0cIgbbPKAaYLLfwHq8qhdPUAjlIHmoQhymA8DIuhNiaOi+Qq+1TyFMDjOQ/YqDO8V0LvUPMluJI+/pf2wMuPoJx20fwt+tYPoQxGn4JaUlpMjSPVpFrvWCv2p6jeMYZKv7lk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772514052; c=relaxed/simple; bh=kz/1aoHiFoZjIa+/k9D0quVOAc4Io2CVDp4K9YWnHDY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UIih5iufru1OlJxNRFN5i1IJVfoOG+IvYr8m+8gnzPszSnTtoNo1pr0PeDi+htwC+JL7blJSeh/+6xbOttsSwcok0acUAfg6JTDNM1jOu/0Sy9gR+sfq3nCoOdTPOEQOFMdIE4nmYiRbs66BeiYCA2SFFsxVKqrrEn0XWarmrxQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 685D34BA2E0B Received: by mail-ua1-x92b.google.com with SMTP id a1e0cc1a2514c-94dd01deb53so1186512241.0 for ; Mon, 02 Mar 2026 21:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772514052; x=1773118852; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5DCaxsznB/zE2F1MekurlrVe8dmolqcU0wdJiBPbbDc=; b=RMfo/F30cbRbv8OXjEM0wCGNKDAah/4oXMKKo/7uscYuBg1Ipyzw2FhzevUOij6JnA 8BepRzvbG1dx+Ug8IP6J8KVSr8YpuXqnmZXJXYsnkhWaW9huqeC/2ZmnpKWoT8BDV3QC CtPMyk5/3aFG043DwNFwYIZra2P9ITqzI3BNCJQdM/fLIOGqUTDICDKSztXrwiluGakC rk5pBT5vAcy0NZY7VLStLhMyFKSuGXt8hG4cGRmwIo3dp2gFVs1hat0e3BLlm3Xhj3Ix LGP1I43KjnJvX4XixpuxEt9a0SpDdT0tTWs9EjDKMVJxWYJ7Va4qa/PHlZiMHHnIsrDu uw1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772514052; x=1773118852; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5DCaxsznB/zE2F1MekurlrVe8dmolqcU0wdJiBPbbDc=; b=QfSKdK1HXhNAIWKHv1y82h8DkgtuhfN7BLDPVeAMM3gl7SyqhpOn49joy7TXnfp/xX +nRXZ4owUq4fFpdYhptfDtbuXda13QMoR0TKf+yOpUkDecG9qkSohJWlTn6rMRmVQvrf Dc8TTvEJOWfhzzruMr3jtMbe9MfuI0FIkHjL8ap3c9vPV7PRz+0eJSnaTXNH+g2KXUoO DGoslC1KKUUOCe1Kse5Axv5+fT9PL7vT7ohZeyI6ICK/6IHak7UwtvkxKMIxlBj5OQ7m 2RWqUWAzcjJchJh3H7tOkbnExgiJ/P+NZPPiSYbkhrfcvGSi6iMznrFV2RFKeO0zwswB mWdA== X-Forwarded-Encrypted: i=1; AJvYcCWKQlEHuhuvvNm13zC6A7kxEjIro4SJjXmNVkdW/KvUQZcXiS91kCNBkww9CkMGti7ZEX3uyQCOYExphA==@sourceware.org X-Gm-Message-State: AOJu0YwjUbG3ds8WQxRMuODM+FW7Xd8/yz5OuvtmUqKUwJ9WxfqhVzit UNGu21O7o/x2+zJa6WAdS5m99ROymjrOQOvrqUsvHjTe8MozgGpgQqbG/EsPvQ/2ZPU= X-Gm-Gg: ATEYQzxU9fhmTPXi3tN5LizV/kBsiMEnp04Q+PZ1l5oTTkmV4HaiLdo2UW3WBio4RLr qM7/EBL1wqRT4XUoOFYDaDfov4pz371kKpbt2RWgm1YJNqUpdCYOYQ8q8gTvIsvW2xfime0Vg5p ZUCQQe1dBZ9rHlKf5YmcA/n7NMjJSw90Cx5EPNeqsWKoQGncbEjdDBfbxN06vuv6vc1g2PSM3Pk ZYXvo544M4m7Z3X4F3XOmejW+u190YTbAE4Bv2+ueX6MhnCUw4s89wfwboqWGkxzI6zLMapMvmA B1l7Fkk3NtmeEcDFkW+KPUOdlnSENGJ5ZhWMhEzisd2Y5qni7ncB+XuFZB5VUBI7xg+F2mxEgWO vfowf/O2CdqTLkQ+BB8mvZNOJvBdh0ilgmwJm5HT2XDWGqBFaFOQBlrjyx9rOkB1GAqmeJck88c AjgEfa/ripXGvOFTabCKgf8i9/K3weWBF4PA== X-Received: by 2002:a05:6102:370f:b0:5f7:24db:c800 with SMTP id ada2fe7eead31-5ff32555580mr7721612137.34.1772514051746; Mon, 02 Mar 2026 21:00:51 -0800 (PST) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-5ff1e7af30asm15544090137.3.2026.03.02.21.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2026 21:00:51 -0800 (PST) From: Thiago Jung Bauermann To: Simon Marchi Cc: Luis , gdb-patches@sourceware.org, Chris Packham , Tom Tromey Subject: Re: [PATCH v3 1/4] GDB: Add gdb/arch/aarch64-pauth-linux.h In-Reply-To: <9c9a0b37-5cad-4dec-97fb-e84e2478858e@simark.ca> (Simon Marchi's message of "Sun, 22 Feb 2026 10:25:42 -0500") References: <20260217060106.1906312-1-thiago.bauermann@linaro.org> <20260217060106.1906312-2-thiago.bauermann@linaro.org> <201211e6-3061-4b7d-8e0c-6a9875922bcd@gmail.com> <8f7b78e6-5f49-4243-8f89-a48ee2884266@simark.ca> <63d2e095-b170-4316-90a8-c62c71c64c40@gmail.com> <6fbf151f-2213-475a-a5d5-08911a4b22bc@simark.ca> <9c9a0b37-5cad-4dec-97fb-e84e2478858e@simark.ca> User-Agent: mu4e 1.12.15; emacs 30.2 Date: Tue, 03 Mar 2026 02:00:49 -0300 Message-ID: <87ecm1ecce.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 Simon Marchi writes: > On 2026-02-22 10:15, Luis wrote: >> That's ok by me. Would you like to clarify what Thiago needs to do so we= don't send mixed signals then? > > I think we can summarize it like this: > > - Definitions in arch/ should be namespaced / prefixed with AARCH64_ > (e.g. AARCH64_HWCAP_FOO) > - Definitions in nat/, which are there to allow building natively > against an older, should use the original name (e.g HWCAP_FOO) > - -tdep files should use the AARCH64_-prefixed versions (e.g. > AARCH64_HWCAP_FOO) > - -nat (in gdb) and -low (in gdbserver) should use the original name > (e.g. HWCAP_FOO) Thank you for the clarification. I've done all of the above in v4. Regarding the first point, I found some definitions in arch/ besides the HWCAP ones which should have the AARCH64_ prefix, so I did that too: - SEGV_MTEAERR =E2=86=92 AARCH64_SEGV_MTEAERR - SEGV_MTESERR =E2=86=92 AARCH64_SEGV_MTESERR - SEGV_CPERR =E2=86=92 AARCH64_SEGV_CPERR - PR_SHADOW_STACK_ENABLE =E2=86=92 AARCH64_PR_SHADOW_STACK_ENABLE - PR_SHADOW_STACK_WRITE =E2=86=92 AARCH64_PR_SHADOW_STACK_WRITE - PR_SHADOW_STACK_PUSH =E2=86=92 AARCH64_PR_SHADOW_STACK_PUSH Actually, the last four of them weren't even in a gdb/arch/ header, but in gdb/linux-tdep.h. I moved them into gdb/arch/. >From your other email in this thread: > On 2026-02-22 05:06, Luis wrote: >> I don=C2=B4t recall the discussions touching renaming/moving of these >> constants. But I see your point. I just don=C2=B4t think we should block >> this series from going in on that particular snag. We should try a >> refactoring as a follow on. >>=20 > > This is what I was referring to, from Thiago: > > Ok. While fixing this, I noticed that gdb/arch/aarch64-gcs-linux.h al= so > contains: > > /* Feature check for Guarded Control Stack. */ > #ifndef HWCAP_GCS > #define HWCAP_GCS (1ULL << 32) > #endif > > which can be said to be an implicit dependency on an arch-specific > include file (since it relies on such file defining or not HWCAP_GCS). > > Also, on non-AArch64 systems it relies on them not having by coincide= nce > an unrelated hardware capability bit also named HWCAP_GCS... > > I fixed this in v2 by renaming the macro to AARCH64_HWCAP_GCS and > defining it unconditionally (following the existing example of > AARCH64_HWCAP_PACA). > > From: https://inbox.sourceware.org/gdb-patches/87qzqkx8l1.fsf@linaro.org/= T/#mbe0d3d5a2802f4f88abe907874ed44c063666639 > > I think that was a good idea, and it seems like we went backwards from > there? I misunderstood this comment you made when you reviewed v2=C2=B9: >> diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c >> index 028de981588b..b2dd192a7b56 100644 >> --- a/gdb/aarch64-linux-nat.c >> +++ b/gdb/aarch64-linux-nat.c >> @@ -51,7 +51,7 @@ >> #include "gdb_proc_service.h" >> #include "arch-utils.h" >>=20=20 >> -#include "arch/aarch64-gcs-linux.h" >> +#include "arch/aarch64-linux.h" >> #include "arch/aarch64-mte-linux.h" >>=20=20 >> #include "nat/aarch64-mte-linux-ptrace.h" >> @@ -1013,7 +1013,7 @@ aarch64_linux_nat_target::read_description () >> active or not. */ >> features.vq =3D aarch64_sve_get_vq (tid); >> features.pauth =3D hwcap & AARCH64_HWCAP_PACA; >> - features.gcs =3D features.gcs_linux =3D hwcap & HWCAP_GCS; > > This one could stay HWCAP_GCS, but I don't have a preference. > > If we want to ensure / prove they are the same, we could add asserts > like this in the nat/ header: > > static_assert (AARCH64_HWCAP_GCS =3D=3D HWCAP_GCS); > > That assert would only be checked when compiling natively for an aarch64 > system (where HWCAP_GCS is available), but it's better than nothing. to mean that you didn't have a preference on whether to use AARCH64_-prefixed definitions. I didn't notice that the comment was made in a hunk from a -nat.c file. Sorry for the confusion. --=20 Thiago =C2=B9 https://inbox.sourceware.org/gdb-patches/5cebfbfa-a192-4359-97d9-834= 55d40fdc6@simark.ca/