public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Alan Hayward <Alan.Hayward@arm.com>
To: Omair Javaid <omair.javaid@linaro.org>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	nd <nd@arm.com>
Subject: Re: [PING 2][PATCH 0/8] Add SVE support for Aarch64 GDB
Date: Tue, 29 May 2018 14:59:00 -0000	[thread overview]
Message-ID: <CBEE2F2C-DF96-43A5-BDE8-CED86A36AF34@arm.com> (raw)
In-Reply-To: <CANW4E-2z_+oThNzOD3-fJyVsGMH+2N2Wf9uw1j37TTvtWa2mMA@mail.gmail.com>



> On 29 May 2018, at 14:06, Omair Javaid <omair.javaid@linaro.org> wrote:
> 
> Hi Alan,
> 
> I would like to help you review and get these patches accepted upstream.
> 

Thanks!


> https://developer.arm.com/docs/ddi0584/latest/arm-architecture-reference-manual-supplement-the-scalable-vector-extension-sve-for-armv8-a
> 
> Do you think above link has the latest documents on SVE?


Yes, that’ll give you the latest docs for SVE.

At the last GNU cauldron I gave a summary of SVE, including the 
latest status on Linux, and the changes required for gdb:
https://slideslive.com/38902367/supporting-variable-register-sizes-for-the-arm-scalable-vector-extension-sve-in-gdb
The regcache slide is out of date - it’s an early plan for
detached_regcache/readable_regcache etc. Not sure if the video
is ok, as I dare not watch it :)

Also, there is also a nice delve into some simple programming
using SVE here:
http://developer.arm.com/hpc/a-sneak-peek-into-sve-and-vla-programming

Binutils fully supports SVE already.

(I should have put all this in the patch summary).

> 
> Also can we test these patches with QEMU or any other virtualization model?

SVE support for QEMU is being worked on by Linaro. The changelog for
the latest release (2.12) says preliminary SVE support. I can look into
this a little more if you want - but I suspect it won’t be good enough yet.
(You’ll need to emulate a full linux kernel - otherwise qemu will fail
when it hits ptrace).

I’ve been using Arm’s Fast Models, but that’s a paid for product and sadly
not something I can easily give you access to.

What happens with other ports to obscure architectures for which most people
/ reviewers don't have access too?
At a minimum, the existing buildbot setup will confirm that nothing is
broken for normal aarch64.

> 
> What is the status of corresponding ptrace changes in kernel? Are they
> already accepted which kernel versions will have that code?

SVE support went into Linux 4.15 in a single batch patches.

Easiest way to check is to look for NT_ARM_SVE in elf.h:
https://github.com/torvalds/linux/blob/v4.15/include/uapi/linux/elf.h


> 
> I will go forward the say more on your patches in coming days.

Note, because this patch set doesn’t support gdbserver, it makes the last
two patches a little strange. I now have gdbserver support working too
(it’s just a few small changes). When I get to V2 of the set, I’ll
probably add in the gdbserver changes.


Thanks,
Alan.


> 
> Thanks!
> 
> On 29 May 2018 at 13:59, Alan Hayward <Alan.Hayward@arm.com> wrote:
>> Ping ping.
>> 
>> Thanks,
>> Alan.
>> 
>>> On 22 May 2018, at 09:34, Alan Hayward <Alan.Hayward@arm.com> wrote:
>>> 
>>> Ping.
>>> 
>>> 
>>> Thanks,
>>> Alan.
>>> 
>>>> On 11 May 2018, at 11:52, Alan Hayward <Alan.Hayward@arm.com> wrote:
>>>> 
>>>> This set of patches adds gdb support for SVE on AArch64.
>>>> 
>>>> SVE is the new vector extension for Aarch64. SVE is different in that the
>>>> length of a vector register is not fixed - it is can vary for different
>>>> hardware implementors. All code compiled for SVE is vector length agnostic.
>>>> The Linux kernel can then further restrict the vector length up to the
>>>> supported maximum for the hardware. Potentially different process and
>>>> threads can have different vector lengths, and they could change at any
>>>> time. However, in practice, we expect the vector length to remain constant
>>>> across the lifetime of a process.
>>>> This set of patches assumes the vector length will not change and either
>>>> warns once (when reading registers) or errors (when writing registers) if the
>>>> vector length has changed. A future set of patches will offer full support.
>>>> 
>>>> This series does not support gdbserver. However, where it makes sense I have
>>>> commonised as much code as possible and have added the groundwork in
>>>> gdbserver. Enabling gdbserver should be a small set of additional patches.
>>>> 
>>>> Core files and watchpoints are not yet supported.
>>>> 
>>>> The vector length is read from ptrace and is required to create the target
>>>> description for the running process. There is no hardcoded SVE XML.
>>>> 
>>>> The patches require recent linux header files for all the SVE ptrace macros.
>>>> To allow builds for older headers, I've added all required macros and
>>>> structures within ifdef checks. I'm not sure if this is the ideal solution.
>>>> When including kernel header code, I've not performed any reformatting (ie
>>>> they are not in GNU style).
>>>> 
>>>> One of the later patches adds functions to gdbserver regcache so that I can
>>>> add common functionality that works on gdb and gdbserver.
>>>> 
>>>> Given there are no working SVE systems available today, this was manually
>>>> tested on an Aarch64 SVE emulator running Ubuntu. In addition I've run make
>>>> check on X86 and Aarch64 builds for both unix and native-gdbserver.
>>>> 
>>>> 
>>>> Alan.
>>>> 
>>>> Alan Hayward (8):
>>>> Add Aarch64 SVE target description
>>>> Function for reading the Aarch64 SVE vector length.
>>>> Add SVE register defines
>>>> Enable SVE for GDB
>>>> Add aarch64 psuedo help functions
>>>> Aarch64 SVE pseudo register support
>>>> Add methods to gdbserver regcache and raw_compare
>>>> Ptrace support for Aarch64 SVE
>>>> 
>>>> gdb/Makefile.in                     |   1 +
>>>> gdb/aarch64-linux-nat.c             |  60 +++++-
>>>> gdb/aarch64-linux-tdep.c            |   5 +-
>>>> gdb/aarch64-tdep.c                  | 402 +++++++++++++++++++++++-------------
>>>> gdb/aarch64-tdep.h                  |  12 +-
>>>> gdb/arch/aarch64.c                  |  12 +-
>>>> gdb/arch/aarch64.h                  |  37 +++-
>>>> gdb/configure.nat                   |   2 +-
>>>> gdb/doc/gdb.texinfo                 |   4 +
>>>> gdb/features/aarch64-sve.c          | 158 ++++++++++++++
>>>> gdb/gdbserver/Makefile.in           |   1 +
>>>> gdb/gdbserver/configure.srv         |   1 +
>>>> gdb/gdbserver/linux-aarch64-tdesc.c |   3 +-
>>>> gdb/gdbserver/regcache.c            |  55 ++++-
>>>> gdb/gdbserver/regcache.h            |   8 +
>>>> gdb/nat/aarch64-sve-linux-ptrace.c  | 315 ++++++++++++++++++++++++++++
>>>> gdb/nat/aarch64-sve-linux-ptrace.h  | 193 +++++++++++++++++
>>>> gdb/regcache.c                      |  17 ++
>>>> gdb/regcache.h                      |   2 +
>>>> 19 files changed, 1122 insertions(+), 166 deletions(-)
>>>> create mode 100644 gdb/features/aarch64-sve.c
>>>> create mode 100644 gdb/nat/aarch64-sve-linux-ptrace.c
>>>> create mode 100644 gdb/nat/aarch64-sve-linux-ptrace.h
>>>> 
>>>> --
>>>> 2.15.1 (Apple Git-101)
>>>> 
>>> 
>> 


      reply	other threads:[~2018-05-29 14:35 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11 10:53 [PATCH " Alan Hayward
2018-05-11 10:53 ` [PATCH 2/8] Function for reading the Aarch64 SVE vector length Alan Hayward
2018-05-31 12:06   ` Simon Marchi
2018-05-31 14:18     ` Alan Hayward
2018-05-31 14:57   ` Pedro Alves
2018-06-05 20:01   ` Sergio Durigan Junior
2018-06-05 22:06     ` [PATCH] Guard declarations of 'sve_*_from_*' macros on Aarch64 (and unbreak build) Sergio Durigan Junior
2018-06-05 23:37       ` Sergio Durigan Junior
2018-06-06  7:34       ` Alan Hayward
2018-06-06 21:19         ` Simon Marchi
2018-06-06 21:36         ` Sergio Durigan Junior
2018-05-11 10:53 ` [PATCH 7/8] Add methods to gdbserver regcache and raw_compare Alan Hayward
2018-05-31 14:57   ` Pedro Alves
2018-05-11 10:53 ` [PATCH 4/8] Enable SVE for GDB Alan Hayward
2018-05-31 12:22   ` Simon Marchi
2018-06-04 11:19     ` Alan Hayward
2018-05-31 14:58   ` Pedro Alves
2018-05-31 16:13   ` Pedro Alves
2018-05-31 16:20     ` Alan Hayward
2018-05-31 16:27       ` Pedro Alves
2018-05-31 18:06         ` Alan Hayward
2018-05-11 10:53 ` [PATCH 8/8] Ptrace support for Aarch64 SVE Alan Hayward
2018-05-31 13:40   ` Simon Marchi
2018-05-31 14:56     ` Alan Hayward
2018-06-01 15:17       ` Simon Marchi
2018-06-04 15:49         ` Alan Hayward
2018-05-31 20:17   ` Simon Marchi
2018-05-11 10:53 ` [PATCH 1/8] Add Aarch64 SVE target description Alan Hayward
2018-05-11 14:56   ` Eli Zaretskii
2018-05-11 16:46     ` Alan Hayward
2018-05-31 11:56   ` Simon Marchi
2018-05-31 14:12     ` Alan Hayward
2018-05-11 10:53 ` [PATCH 6/8] Aarch64 SVE pseudo register support Alan Hayward
2018-05-31 13:26   ` Simon Marchi
2018-06-04 13:29     ` Alan Hayward
2018-05-31 14:59   ` Pedro Alves
2018-05-11 11:52 ` [PATCH 5/8] Add aarch64 psuedo help functions Alan Hayward
2018-05-31 13:22   ` Simon Marchi
2018-05-31 15:20     ` Pedro Alves
2018-06-04 13:13     ` Alan Hayward
2018-05-11 12:12 ` [PATCH 3/8] Add SVE register defines Alan Hayward
2018-06-01  8:33   ` Alan Hayward
2018-06-01 15:18     ` Simon Marchi
2018-05-22 11:00 ` [PATCH 0/8] Add SVE support for Aarch64 GDB Alan Hayward
2018-05-29 12:09   ` [PING 2][PATCH " Alan Hayward
2018-05-29 14:35     ` Omair Javaid
2018-05-29 14:59       ` Alan Hayward [this message]

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=CBEE2F2C-DF96-43A5-BDE8-CED86A36AF34@arm.com \
    --to=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    --cc=omair.javaid@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).