From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SkeKJibWmWnZOQQAWB0awg (envelope-from ) for ; Sat, 21 Feb 2026 10:58:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1771689510; bh=C42qUY3lkj+l+8e1OK6uyluJKmT7Mk+SbcbjzJ53Jxo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=D4ay/SRSeELvZ6T9peDcrONfm3vyXzVqY7yEMKMc/laghHYspXXxQb7FBGsOVaK1Q zkq48idKjYgOJDkEVto4lu3+FSnWVtuQ19cV4k1Q+h7ywG28rbWfLioWs0oZ/0GXfy 1xMd5Pl3yeumVyQIok3Qb/HBNLa/rYxcGRMjDkZI= Received: by simark.ca (Postfix, from userid 112) id 870701E0BA; Sat, 21 Feb 2026 10:58:30 -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 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=D8eJ3GYp; dkim-atps=neutral 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 54F991E089 for ; Sat, 21 Feb 2026 10:58:29 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 64BCF4BA23D7 for ; Sat, 21 Feb 2026 15:58:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64BCF4BA23D7 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=D8eJ3GYp Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id E1D984BA23FA for ; Sat, 21 Feb 2026 15:58:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E1D984BA23FA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E1D984BA23FA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771689483; cv=none; b=IHyVjJ2wyTOlrs+662V6VHN0nYQ6Pr2FuGsJ54cOKImw7vO1hiunhxupa6RioMgC/ICdNtLjXENjlG4FKf4BpP2L/UDaFbm/5CzofjM+I5IWxpxqj/xgEuFiUkR2hQoPk8ETUoY9phZmfGXwCRpM9gCAen7tLqYJj7MhALnhDFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771689483; c=relaxed/simple; bh=C42qUY3lkj+l+8e1OK6uyluJKmT7Mk+SbcbjzJ53Jxo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=TqIATaaXDSFAQVIMHinok7ILBSpW3fQrhSu+gO69XBQGkdt6epquqJ1P9VPI25CbkwponNEE+gLC4M3pEQgh1ddVdeVjNMW+y30A3xTiD+eYW/G/LoWvwQ6/CntrJ9lrxqCa99MqxBOwO1VGQuDGDXuNjpIKhhIr1v690btPylI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1D984BA23FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1771689481; bh=C42qUY3lkj+l+8e1OK6uyluJKmT7Mk+SbcbjzJ53Jxo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=D8eJ3GYpKX4240E69VgNOkAwKStVILptAdwpT4N6op3Ro74Jf0C7l/P4E0pzGOmbI sU06pXBIQNbTxqypURD11EkpB+wke90WUThHz7ahi961GyelFEB3gYjJVvUYZ538sm N9KVI/qhHdl6C4UCVsQW/OoRFJSJ1RXpz2XgXsUA= Received: by simark.ca (Postfix) id 1C5701E089; Sat, 21 Feb 2026 10:58:00 -0500 (EST) Message-ID: <8f7b78e6-5f49-4243-8f89-a48ee2884266@simark.ca> Date: Sat, 21 Feb 2026 10:57:59 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/4] GDB: Add gdb/arch/aarch64-pauth-linux.h To: Luis , Thiago Jung Bauermann , gdb-patches@sourceware.org Cc: Chris Packham , Tom Tromey References: <20260217060106.1906312-1-thiago.bauermann@linaro.org> <20260217060106.1906312-2-thiago.bauermann@linaro.org> <201211e6-3061-4b7d-8e0c-6a9875922bcd@gmail.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <201211e6-3061-4b7d-8e0c-6a9875922bcd@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 >> diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c >> index b85c25ecae1d..b5af281d8a40 100644 >> --- a/gdb/aarch64-linux-tdep.c >> +++ b/gdb/aarch64-linux-tdep.c >> @@ -54,6 +54,7 @@ >> #include "arch/aarch64-gcs-linux.h" >> #include "arch/aarch64-mte.h" >> #include "arch/aarch64-mte-linux.h" >> +#include "arch/aarch64-pauth-linux.h" >> #include "arch/aarch64-scalable-linux.h" >> #include "arch-utils.h" >> @@ -1760,7 +1761,7 @@ aarch64_linux_core_read_description (struct gdbarch *gdbarch, >> have the correct target description with the correct SVE vector >> length. */ >> features.vq = aarch64_linux_core_read_vq_from_sections (gdbarch, abfd); >> - features.pauth = hwcap & AARCH64_HWCAP_PACA; >> + features.pauth = hwcap & HWCAP_PACA; See comment below about HWCAP_PACA. >> diff --git a/gdb/arch/aarch64-pauth-linux.h b/gdb/arch/aarch64-pauth-linux.h >> new file mode 100644 >> index 000000000000..e973c79c8767 >> --- /dev/null >> +++ b/gdb/arch/aarch64-pauth-linux.h >> @@ -0,0 +1,31 @@ >> +/* Common Linux target-dependent definitions for AArch64 PAuth. >> + >> + Copyright (C) 2019-2026 Free Software Foundation, Inc. >> + >> + This file is part of GDB. >> + >> + This program is free software; you can redistribute it and/or modify >> + it under the terms of the GNU General Public License as published by >> + the Free Software Foundation; either version 3 of the License, or >> + (at your option) any later version. >> + >> + This program is distributed in the hope that it will be useful, >> + but WITHOUT ANY WARRANTY; without even the implied warranty of >> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + GNU General Public License for more details. >> + >> + You should have received a copy of the GNU General Public License >> + along with this program. If not, see . */ >> + >> +#ifndef GDB_ARCH_AARCH64_PAUTH_LINUX_H >> +#define GDB_ARCH_AARCH64_PAUTH_LINUX_H >> + >> +/* Feature check for Pointer Authentication Code Extension. */ >> +#ifndef HWCAP_PACA >> +#define HWCAP_PACA (1 << 30) >> +#endif As per the previous discussions, I'm not sure this definition of HWCAP_PACA should be here. For instance, what if another architecture defines a HWCAP_PACA with a different meaning/value? It should only be seen by native code, so it should be somehwere in nat/. For the same reason, I think that aarch64-linux-tdep.c should use a constant named AARCH64_HWCAP_PACA, not HWCAP_PACA. I thought this was the conclusion of the previous discussions, there might have been a misunderstanding. The native files aarch64-linux-nat.c and linux-aarch64-low.cc can use HWCAP_PACA though, because they see the definition from the system headers (or worst case, a definition from nat/, to support compiling against older kernels). Simon