mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Thompson <daniel.thompson@linaro.org>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Arnd Bergmann <arnd@kernel.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Arnd Bergmann <arnd@arndb.de>, kernel test robot <lkp@intel.com>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Paul Burton <paulburton@kernel.org>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] MIPS: make kgdb depend on FPU support
Date: Wed, 10 Feb 2021 12:29:29 +0000	[thread overview]
Message-ID: <20210210122929.rgqfkoop4rsso3yo@maple.lan> (raw)
In-Reply-To: <alpine.DEB.2.21.2102101252580.35623@angie.orcam.me.uk>

On Wed, Feb 10, 2021 at 01:11:28PM +0100, Maciej W. Rozycki wrote:
> On Wed, 10 Feb 2021, Daniel Thompson wrote:
> 
> > >  Wrapping the relevant parts of this file into #ifdef MIPS_FP_SUPPORT 
> > > would be as easy though and would qualify as a proper fix given that we 
> > > have no XML description support for the MIPS target (so we need to supply 
> > > the inexistent registers in the protocol; or maybe we can return NULL in 
> > > `dbg_get_reg' to get them padded out in the RSP packet, I haven't checked 
> > > if generic KGDB code supports this feature).
> > 
> > Returning NULL should be fine.
> > 
> > The generic code will cope OK. The values in the f.p. registers may
> > act a little odd if gdb uses a 'G' packet to set them to non-zero values
> > (since kgdb will cache the values gdb sent it) but the developer
> > operating the debugger will probably figure out what is going on without
> > too much pain.
> 
>  Ack, thanks!
> 
>  NB if GDB sees a register padded out (FAOD it means all-x's rather than a 
> hex string placed throughout the respective slot) in a `g' packet, then it 
> will mark the register internally as "unavailable" and present it to the 
> receiver of the information as such rather than giving any specific value.  
> I don't remember offhand what the syntax for the `G' packet is in that 
> case; possibly GDB just sends all-zeros, and in any case you can't make 
> GDB write any specific value to such a register via any user
> interface.

kgdb doesn't track register validity and adding would be a fairly big
change. Everything internally (including some of the interactions with
arch code) is based on updating a binary shadow of register state which
is only bin2hex'ed just before transmitting a packet.

It will simply default them to zero and update them on a 'G' packet.

>  The way the unavailability is shown depends on the interface used, i.e. 
> it will be different between the `info all-registers'/`info register $reg' 
> commands, and the `p $reg' command (or any expression involving `$reg'), 
> and the MI interface.  But in any case it will be unambiguous.

I guess this probably does create a technical protocol violation since
kgdb will reject per-register read/write for register that its report
says are zero rather then invalid.


Daniel.

  reply	other threads:[~2021-02-10 12:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 11:02 [PATCH 1/2] MIPS: jazz: always allow little-endian builds Arnd Bergmann
2021-01-22 11:02 ` [PATCH 2/2] MIPS: make kgdb depend on FPU support Arnd Bergmann
2021-01-22 13:06   ` Thomas Bogendoerfer
2021-02-08 17:03   ` Maciej W. Rozycki
2021-02-10 11:38     ` Daniel Thompson
2021-02-10 12:11       ` Maciej W. Rozycki
2021-02-10 12:29         ` Daniel Thompson [this message]
2021-02-10 14:15           ` Maciej W. Rozycki
2021-02-10 17:05             ` Daniel Thompson
2021-01-22 13:05 ` [PATCH 1/2] MIPS: jazz: always allow little-endian builds Thomas Bogendoerfer

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=20210210122929.rgqfkoop4rsso3yo@maple.lan \
    --to=daniel.thompson@linaro.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=macro@orcam.me.uk \
    --cc=paul@crapouillou.net \
    --cc=paulburton@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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

all inboxes | Powered by JetHome®