Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis <luis.machado.foss@gmail.com>
To: Simon Marchi <simark@simark.ca>,
	Thiago Jung Bauermann <thiago.bauermann@linaro.org>,
	gdb-patches@sourceware.org
Cc: Chris Packham <judge.packham@gmail.com>, Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH v3 1/4] GDB: Add gdb/arch/aarch64-pauth-linux.h
Date: Sun, 22 Feb 2026 10:06:49 +0000	[thread overview]
Message-ID: <63d2e095-b170-4316-90a8-c62c71c64c40@gmail.com> (raw)
In-Reply-To: <8f7b78e6-5f49-4243-8f89-a48ee2884266@simark.ca>

On 21/02/2026 15:57, Simon Marchi wrote:
>>> 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 <http://www.gnu.org/licenses/>.  */
>>> +
>>> +#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.

I don´t recall the discussions touching renaming/moving of these 
constants. But I see your point. I just don´t think we should block this 
series from going in on that particular snag. We should try a 
refactoring as a follow on.

On the naming, I don´t mind adding an AARCH64 prefix, but I find it 
unlikely we will run into a naming collision given BSD uses equivalent 
constants. Again, not disputing the matter of what is technically 
correct or not.

> 
> 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


  reply	other threads:[~2026-02-22 10:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17  6:00 [PATCH v3 0/4] GDB: aarch64-linux: Some header fixes Thiago Jung Bauermann
2026-02-17  6:00 ` [PATCH v3 1/4] GDB: Add gdb/arch/aarch64-pauth-linux.h Thiago Jung Bauermann
2026-02-21 12:14   ` Luis
2026-02-21 15:57     ` Simon Marchi
2026-02-22 10:06       ` Luis [this message]
2026-02-22 14:22         ` Simon Marchi
2026-02-22 15:15           ` Luis
2026-02-22 15:25             ` Simon Marchi
2026-03-03  5:00               ` Thiago Jung Bauermann
2026-02-17  6:01 ` [PATCH v3 2/4] GDB: Add gdb/arch/aarch64-fpmr-linux.h Thiago Jung Bauermann
2026-02-21 12:15   ` Luis
2026-02-17  6:01 ` [PATCH v3 3/4] GDB: aarch64-linux: Move definition of struct user_gcs Thiago Jung Bauermann
2026-02-21 12:20   ` Luis
2026-02-17  6:01 ` [PATCH v3 4/4] GDB: aarch64-linux: Fix build failure on musl systems Thiago Jung Bauermann
2026-02-21 12:23   ` Luis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63d2e095-b170-4316-90a8-c62c71c64c40@gmail.com \
    --to=luis.machado.foss@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=judge.packham@gmail.com \
    --cc=simark@simark.ca \
    --cc=thiago.bauermann@linaro.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox