public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@arm.com>
To: John Baldwin <jhb@FreeBSD.org>, gdb-patches@sourceware.org
Cc: thiago.bauermann@linaro.org
Subject: Re: [PATCH] [AArch64] Enable pointer authentication support for aarch64 bare metal/kernel mode addresses
Date: Thu, 19 Jan 2023 09:34:22 +0000	[thread overview]
Message-ID: <2fbe4596-17fa-1962-66ae-8b4b9f4edd22@arm.com> (raw)
In-Reply-To: <a83eaa2d-9494-9907-37f4-be7400af7a5b@FreeBSD.org>

Hi,

On 1/18/23 18:39, John Baldwin wrote:
> On 1/5/23 5:16 AM, Luis Machado wrote:
>> Hi John,
>>
>> Any thoughts on this patch from BSD's side?
> 
> Sorry, I missed the cc earlier.  FreeBSD does have support for the userland
> registers that I haven't yet added for userland PAC and this seems to make
> that easier as I will just need to add the registers to the tdesc when
> present/supported.  However, one question I have is what does this do if the
> registers aren't available and kernel addresses are used?  I have this use
> case for existing FreeBSD/aarch64 kernel debugging.  The default version of
> the gdbarch hook seems to always assume TBI and strip the upper bits, but
> for kernel addresses what I kind of need is to sign-extend addresses based
> on bit 55.  I do have a separate gdbarch for kernels vs userland programs
> so it might just be I need a custom version of this gdbarch hook for the kernel
> gdbarch?> 

The default behavior in the absence of the PAC registers for the kernel addresses is to
assume TBI, remove the top bits and sign-extend based on bit 55.

This is done by aarch64_remove_top_bits.

I suppose that would work for you then.

  reply	other threads:[~2023-01-19  9:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 10:57 Luis Machado
2022-12-20  3:20 ` Thiago Jung Bauermann
2022-12-20  9:17   ` Luis Machado
2023-01-05 13:16 ` Luis Machado
2023-01-18 18:39   ` John Baldwin
2023-01-19  9:34     ` Luis Machado [this message]
2023-01-19 18:35       ` John Baldwin
2023-02-21  9:11 ` Luis Machado

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=2fbe4596-17fa-1962-66ae-8b4b9f4edd22@arm.com \
    --to=luis.machado@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.org \
    --cc=thiago.bauermann@linaro.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).