Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Alan Hayward <alan.hayward@arm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 8/8] AARCH64 SVE: Enable AARCH64 SVE in gdbserver
Date: Wed, 14 Dec 2016 16:51:00 -0000	[thread overview]
Message-ID: <20161214165124.GI25542@E107787-LIN> (raw)
In-Reply-To: <D46B0E8C.15503%alan.hayward@arm.com>

On 16-12-05 12:31:08, Alan Hayward wrote:
> 
> VG is included in the SVE register set and is marked as an expediated
> register
> (added in a previous patch).
> 
> In the gdb remote side, on receipt on a stop-reply the VG value in the stop
> reply is compared against the currently known VG value. If there is a
> difference, then the current target description and register cache is
> cleared
> and a new target description is found (using the new VG value).

This only works when target descriptions change among different VG
values (VG != 0).  If the program starts with VG = 0, the target
description is still the normal aarch64 one, which doesn't 
understand register number of VG.

(gdb) c
Continuing.
Remote sent bad register number 0x55: 55:0000000000000000;thread:p2ad9.2ad9;core:5;
Packet: 'T0b1d:0000000000000000;1f:0000000000000000;20:0000000000000000;55:0000000000000000;thread:p2ad9.2ad9;core:5;'

I applied your patches, hack aarch64_read_vg a little bit, let it
return some random even number, like 0, 2, 4, 8.

Looks adding a new expedite register doesn't help detecting architecture
change.  We may need to add a new stop reason "tdesc:id", "id" is an
integer, the id of a known target description.

>  int aarch64_validate_tdesc (struct thread_info *thread)
>  {
> -  return 1;
> +  int tid = ptid_get_lwp (thread_to_gdb_id (thread));
> +  long vg = aarch64_read_vg (tid);
> +  struct regcache *regcache = inferior_regcache_data (thread);
> +  struct process_info *proc;
> +
> +  /* Non SVE targets always validate as true.  */
> +  if (vg == 0)
> +    return 1;

This function doesn't handle the case VG = 2 changed to VG = 0.  What
we need to do is to compare tdesc, like this,

    return (proc->tdesc == aarch64_get_tdesc(vg));

which is simpler.
> +
> +  if (regcache)
> +    return (register_size (regcache->tdesc, AARCH64_SVE_Z0_REGNO)
> +	    == sve_vl_from_vg (vg));
> +
> +  proc = get_thread_process (thread);
> +  return (register_size (proc->tdesc, AARCH64_SVE_Z0_REGNO)
> +	  == sve_vl_from_vg (vg));
>  }
> 

-- 
Yao (齐尧)


  reply	other threads:[~2016-12-14 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05 12:31 Alan Hayward
2016-12-14 16:51 ` Yao Qi [this message]
2016-12-14 17:15   ` Yao Qi

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=20161214165124.GI25542@E107787-LIN \
    --to=qiyaoltc@gmail.com \
    --cc=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.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