[PATCH] Add PTRACE_{GET|SET}VRREGS

Kumar Gala kumar.gala at freescale.com
Fri Sep 2 00:28:34 EST 2005


On Sep 1, 2005, at 5:09 AM, Anton Blanchard wrote:

>
> Hi Rob,
>
>
>> The ptrace get and set methods for VMX/Altivec registers present in
>>
> the
>
>> ppc tree were missing for ppc64.  This patch adds the 32-bit and
>>
> 64-bit
>
>> methods.
>>
>
> Nice work. A couple of suggestions:
>
> 1. You need to call flush_altivec_to_thread(child) before reading or
> writing the altivec state.
>
> 2. It looks like vrsave will be read/written incorrectly:
>
> /*
>  * Get/set all the altivec registers vr0..vr31, vscr, vrsave, in  
> one go.
>  * The transfer totals 34 quadword.  Quadwords 0-31 contain the
>  * corresponding vector registers.  Quadword 32 contains the vscr  
> as the
>  * last word (offset 12) within that quadword.  Quadword 33  
> contains the
>  * vrsave as the first word (offset 0) within the quadword.
>  *
>  * This definition of the VMX state is compatible with the current  
> PPC32
>  * ptrace interface.  This allows signal handling and ptrace to use  
> the
>  * same
>  * structures.  This also simplifies the implementation of a bi-arch
>  * (combined (32- and 64-bit) gdb.
>  */
>
> vrsave is a 64bit field in the ppc64 task struct (its only 32bit on
> ppc32). It might be safer to read all three parts separately, such as:

Is vrsave really a 64-bit register in ppc64?  If not can we make it  
be a 32-bit quantity on ppc64 to simplify our lives later.

- kumar



More information about the Linuxppc64-dev mailing list