This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] mips: Fix store/load gp registers to/from ucontext_t
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Wed, 17 May 2017 11:59:04 -0300
- Subject: Re: [PATCH] mips: Fix store/load gp registers to/from ucontext_t
- Authentication-results: sourceware.org; auth=none
- References: <655B60FB9854204DB1D72C498A631BB6013C7191E7@BADAG02.ba.imgtec.org>
On 17/05/2017 10:41, Gordana Cmiljanovic wrote:
> More details, not to be included in the commit message:
>
> get/set/make/swap context implementations for MIPS O32
> incorrectly assume general purpose registers are 32bit
> but they are defined as 64bit in mcontext_t structure, as per:
>
> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/mips/sys/ucontext.h;h=f766dacd205f49a479f17b19df476a8103f55a2e;hb=refs/heads/master#l35
> and
> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/mips/sys/ucontext.h;h=f766dacd205f49a479f17b19df476a8103f55a2e;hb=refs/heads/master#l68
>
> This leads to incorrect general purpose register values.
>
Since it seems to be a user-visible bug it requires an assigned
bugzilla for it. Also, what kind of incorrect register value
are you seeing? I am asking because it seems that, although the
each member individually is accessed by a wrong offset (an the
allocated area for gregs is the double of required), I can see
why the restored value would be different than the saved one
(it is now a block for this fix though, just trying to understand
why this issue has not been seen on mips yet).