Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: "Maciej W. Rozycki" <macro@imgtec.com>
Cc: Bhushan Attarde <bhushan.attarde@imgtec.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	Matthew Fortune <Matthew.Fortune@imgtec.com>,
	James Hogan <James.Hogan@imgtec.com>,
	Andrew Bennett <Andrew.Bennett@imgtec.com>,
	Jaydeep Patil <Jaydeep.Patil@imgtec.com>
Subject: Re: [PATCH 01/24] MIPS: Handle run-time reconfigurable FPR size
Date: Fri, 11 Nov 2016 12:29:00 -0000	[thread overview]
Message-ID: <20161111122844.GB31376@E107787-LIN> (raw)
In-Reply-To: <alpine.DEB.2.20.17.1611101158560.10580@tp.orcam.me.uk>

On Thu, Nov 10, 2016 at 12:42:53PM +0000, Maciej W. Rozycki wrote:
> 
> > >     This is implemented by retaining the raw register size for the FPRs at its
> > >     native size (64-bits; this is required for remote packet offsets to work
> > >     out correctly) and then truncating the cooked register size or not as
> > >     required.  I have skipped `maintenance print registers' dumps here for
> > >     brevity, the types flip between "double" and "float" as expected.
> > >
> > 
> > If I understand you correctly, 64-bits are still transferred in remote protocol
> > if FPRs are 32-bit.
> 
>  Nope.  In the FR=0 mode existing XML-described stubs present a file of 32 
> 32-bit FPRs; this applies to MIPS32 targets only as so far we've had an 
> assumption that MIPS32 <=> FR=0 and MIPS64 <=> FR=1.  I think switching 
> the view at this time would be an undesireable complication, as it would 
> be yet another variant we'd have to handle forever along with the new one.

Yeah, there are different variants.  Let me be specific, with this patch
applied, on MIPS64, FR=0, how many bits needed for each FPR in 'g' packet?
I ask this question for this sentence "This is implemented by retaining the
raw register size for the FPRs at its native size (64-bits; this is required for
remote packet offsets to work out correctly) and then truncating the cooked
register size or not as required." in Bhushan's mail.
IIUC, with this patch applied, on MIPS64, FR=0, FPR is 32-bit, but 64-bit
space is used in 'g' packet.  No?

> 
>  FWIW I think the FR=0 mode should have been chosen to present the FPR 
> file as 16 64-bit FPRs instead, with the cooked register view used to 
> access register halves if required, but then I think a further 
> complication would arise with non-XML-described stubs.
> 
> > >      The change also supports both XML and non-XML targets, but currently
> > >     bare-iron targets for which this update has any significant meaning do not
> > >     really support XML.  Any XML target is supposed to always provide an FPU
> > >     description that matches the current setting of CP0.Status.FR, the new
> > >     code verifies this is always the case and rejects the description as
> > >     invalid otherwise.
> > 
> > How do I understand "Any XML target is supposed to always provide
> > an FPU description that matches the current setting of CP0.Status.FR"?
> > I don't see how it is done in current GDB/GDBserver.
> 
>  I do hope the last patch which adds `gdbserver' features en masse, which 
> I didn't get to to looking through yet, has it (although I think the 
> individual features should be included along with corresponding base 
> target and native support instead).

Oh, it must be this patch
https://sourceware.org/ml/gdb-patches/2016-06/msg00511.html

> 
> > "reconfigure FPRs" is a target description change to me, instead of a
> > regcache change.
> 
>  The regcache change is partly historic, because parts of the series 
> (dating back to 2005) were implemented even before we had XML 
> descriptions, and an FR transition is also supposed to work with 
> non-XML-described MIPS64 bare-metal targets (where the FPR file is 
> presented as 32 64-bit FPRs regardless of the FR setting).  I do agree a 
> target description should take precedence where available, and certainly 
> with Linux targets where you cannot get a MIPS64 FR=0 configuration or a 
> non-XML-described MIPS32 FR=1 configuration).
> 
>  What do you propose if we don't have a target description though?  We 
> can't handle MIPS32 FR=1, because stubs won't transfer the upper halves of 
> FPRs, but we can handle MIPS64 FR=0, because we can simply ignore the 
> irrelevant upper halves.

Why stubs doesn't transfer the upper bits of PFRs in case of MIPS32 FR=1?
because of keeping backward compatibility?  Does
register_remote_g_packet_guess help?

> 
> > There are two different ways to support handling target description
> > change in general.  Other thoughts are welcome too.
> > 
> > 1)
> >  - Implement target hook to_thread_architecture in ARCH-linux-nat.c,
> >    in which we can use ptrace to read the register A which indicates
> >    the target description is changed or not.  In MIPS, register A is
> >    CP0.Status.  Create target info and return the right gdbarch.
> >    [In MIPS, we have one gdbarch for 32-bit FPR and one gdbarch for
> >    64-bit FPR]
> >  - Add register A to expedited registers, which is included in the stop
> >    reply from GDBserver.
> 
>  I think I'd prefer this to be the $fp_mode register if available (as 
> it'll include the FRE setting as well), and the $status register 
> otherwise.  Linux kernels which support the FRE setting will always make 
> $fp_mode available, as it'll be a part of the same change (unless someone 
> sneaks a broken patch through behind my back, as I still yet have to see 
> the kernel parts of this framework, let alone review them).

If we have $fp_mode, that is better.

> 
>  The rest looks like a good plan to me, although I think I like your #1 
> proposal a bit better.
> 

Thanks for your feedback, Maciej.  I personally like #1 better too :)

-- 
Yao (齐尧)


  reply	other threads:[~2016-11-11 12:29 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27 14:50 Bhushan Attarde
2016-06-27 14:50 ` [PATCH 11/24] MIPS: Add support for hybrid fp32/fp64 mode Bhushan Attarde
2016-06-27 14:50 ` [PATCH 06/24] mips-linux-nat: pick fp64 target description when appropriate Bhushan Attarde
2016-06-27 14:50 ` [PATCH 03/24] regcache: handle invalidated regcache Bhushan Attarde
2016-10-21 22:42   ` Maciej W. Rozycki
2016-06-27 14:50 ` [PATCH 10/24] MIPS: override fscr/fir types and print control registers specially Bhushan Attarde
2016-06-27 14:50 ` [PATCH 08/24] MIPS: Convert FP mode to enum and put fp registers into fp reggroup Bhushan Attarde
2016-06-27 14:51 ` [PATCH 09/24] MIPS: Enhance cooked FP format Bhushan Attarde
2016-06-27 14:51 ` [PATCH 19/24] Add MIPS MSA vector branch instruction support Bhushan Attarde
2016-06-27 14:51 ` [PATCH 22/24] Support all new ABIs when detecting if an FPU is present Bhushan Attarde
2016-06-27 14:51 ` [PATCH 20/24] Drop FP and MSA control registers from default info registers Bhushan Attarde
2016-06-27 14:51 ` [PATCH 14/24] Implement core MSA stuff Bhushan Attarde
2016-06-27 14:51 ` [PATCH 12/24] o32 sigframe unwinding with FR1 Bhushan Attarde
2016-06-27 14:51 ` [PATCH 24/24] MIPS R6 forbidden slot support Bhushan Attarde
2016-06-27 14:51 ` [PATCH 05/24] MIPS: Add config5 to MIPS GDB target descriptions Bhushan Attarde
2016-06-27 14:51 ` [PATCH 21/24] MIPSR6 support for GDB Bhushan Attarde
2016-07-29 21:10   ` Maciej W. Rozycki
2016-06-27 14:51 ` [PATCH 23/24] MIPS R6 opcode table shuffle for LDC2/SDC2 Bhushan Attarde
2016-06-27 14:51 ` [PATCH 04/24] Add MIPS Config5 register related support Bhushan Attarde
2016-06-27 14:51 ` [PATCH 02/24] Add MIPS32 FPU64 GDB target descriptions Bhushan Attarde
2016-10-12 12:42   ` Maciej W. Rozycki
2016-10-12 13:58     ` James Hogan
2016-10-12 16:30       ` Maciej W. Rozycki
2016-10-12 18:05         ` James Hogan
2016-10-12 22:04           ` Maciej W. Rozycki
2016-10-13 10:09             ` Matthew Fortune
2016-10-21 19:17               ` Maciej W. Rozycki
2016-10-21 19:24                 ` Maciej W. Rozycki
2016-06-27 14:51 ` [PATCH 18/24] mips-linux-nat: get msa registers Bhushan Attarde
2016-06-27 14:51 ` [PATCH 13/24] Add MIPS MSA GDB target descriptions Bhushan Attarde
2016-06-27 14:51 ` [PATCH 07/24] MIPS: Make Linux restart register more dynamic Bhushan Attarde
2016-07-25 14:03 ` [PATCH 01/24] MIPS: Handle run-time reconfigurable FPR size Maciej W. Rozycki
2016-10-18 17:37   ` Maciej W. Rozycki
2016-11-08 19:46 ` Yao Qi
2016-11-10 12:43   ` Maciej W. Rozycki
2016-11-11 12:29     ` Yao Qi [this message]
2016-12-02  2:31       ` Maciej W. Rozycki

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=20161111122844.GB31376@E107787-LIN \
    --to=qiyaoltc@gmail.com \
    --cc=Andrew.Bennett@imgtec.com \
    --cc=James.Hogan@imgtec.com \
    --cc=Jaydeep.Patil@imgtec.com \
    --cc=Matthew.Fortune@imgtec.com \
    --cc=bhushan.attarde@imgtec.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@imgtec.com \
    /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