This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/3 v3] [AArch64] Support tagged pointer
- From: Pedro Alves <palves at redhat dot com>
- To: Omair Javaid <omair dot javaid at linaro dot org>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, GDB Patches <gdb-patches at sourceware dot org>
- Date: Wed, 11 Apr 2018 12:19:48 +0100
- Subject: Re: [PATCH 0/3 v3] [AArch64] Support tagged pointer
- References: <1512727471-30745-1-git-send-email-yao.qi@linaro.org> <CAH=s-PP6BcsW_RCZivdm1DCkxVz6E94dtFGBBtHWnDcF6EO7YQ@mail.gmail.com> <CANW4E-1SQ5Ye-kVm45x0A_8EFK6919E62NFLSHHceLnWDsJLng@mail.gmail.com> <5429b7f0-ee91-67f4-3b15-f5de9aa06389@redhat.com> <CANW4E-0XPRJdsxb6=5zvAqcT8s=aTsUGjhk7x3gewgxCWfqUxg@mail.gmail.com>
On 04/11/2018 12:12 PM, Omair Javaid wrote:
> On 11 April 2018 at 15:13, Pedro Alves <palves@redhat.com <mailto:palves@redhat.com>> wrote:
>
> On 04/11/2018 01:15 AM, Omair Javaid wrote:
>
> > This patch has broken kernel debugging using kgdb and openOCD.
>
> OOC, can you qualify this a bit more, please?
>
> Does the kernel use the high bits for something?
>
>
> We can safely assume that top byte is 0 in case of user address space on linux because it enables tagging support but not for kernel address space.
>
> According to linux memory layout of AArch64 given here: https://www.kernel.org/doc/Documentation/arm64/memory.txt
>
> "User addresses have bits 63:48 set to 0 while the kernel addresses have
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> the same bits set to 1. TTBRx selection is given by bit 63 of the
^^^^^^^^^^^^^^^^^^^^^^^^^
> virtual address."
Ah, that's clear as day now.
>
> According to kernel document on tagged pointer support in AArch64 given here: https://www.kernel.org/doc/Documentation/arm64/tagged-pointers.txt
>
> The kernel configures the translation tables so that translations made
> via TTBR0 (i.e. userspace mappings) have the top byte (bits 63:56) of
> the virtual address ignored by the translation hardware. This frees up
> this byte for application use.
>
> With set_gdbarch_significant_addr_bit applied to aarch64-tdep following happens when gdb tries reading kernel address space memory:
>
> query the 0xffffffc000092698 memory data, GDB sent "m00ffffc000092698,4" instead of "mffffffc000092698,4"
>
OK, that makes a lot more sense now. The above is the perfect
info to be included in a git commit log. Want to submit a patch?
Thanks,
Pedro Alves