[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMzpN2gDPej+M=3D_m0-MmtyZ+VYpP=D3GxdP6aEpzH8JeWg9Q@mail.gmail.com>
Date: Sat, 4 Apr 2015 20:01:14 -0400
From: Brian Gerst <brgerst@...il.com>
To: Ingo Molnar <mingo@...nel.org>
Cc: "H. Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...capital.net>,
Denys Vlasenko <dvlasenk@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Borislav Petkov <bp@...en8.de>,
"the arch/x86 maintainers" <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86/signal: Remove pax argument from restore_sigcontext
On Sat, Apr 4, 2015 at 10:14 AM, Ingo Molnar <mingo@...nel.org> wrote:
>
> * Brian Gerst <brgerst@...il.com> wrote:
>
>> The pax argument is unnecesary. Instead, store the RAX value directly
>> in regs.
>>
>> Signed-off-by: Brian Gerst <brgerst@...il.com>
>> Cc: Ingo Molnar <mingo@...nel.org>
>> Cc: "H. Peter Anvin" <hpa@...or.com>
>> Cc: Andy Lutomirski <luto@...capital.net>
>> Cc: Denys Vlasenko <dvlasenk@...hat.com>
>> Cc: Linus Torvalds <torvalds@...ux-foundation.org>
>> Cc: Borislav Petkov <bp@...en8.de>
>> Cc: x86@...nel.org
>> Cc: linux-kernel@...r.kernel.org
>> ---
>> arch/x86/ia32/ia32_signal.c | 17 ++++++-----------
>> arch/x86/include/asm/sighandling.h | 4 +---
>> arch/x86/kernel/signal.c | 22 ++++++++--------------
>> 3 files changed, 15 insertions(+), 28 deletions(-)
>>
>> diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
>> index 1f5e2b0..c81d35e6 100644
>> --- a/arch/x86/ia32/ia32_signal.c
>> +++ b/arch/x86/ia32/ia32_signal.c
>> @@ -161,8 +161,7 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
>> }
>>
>> static int ia32_restore_sigcontext(struct pt_regs *regs,
>> - struct sigcontext_ia32 __user *sc,
>> - unsigned int *pax)
>> + struct sigcontext_ia32 __user *sc)
>> {
>> unsigned int tmpflags, err = 0;
>> void __user *buf;
>> @@ -184,7 +183,7 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
>> RELOAD_SEG(es);
>>
>> COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
>> - COPY(dx); COPY(cx); COPY(ip);
>> + COPY(dx); COPY(cx); COPY(ip); COPY(ax);
>> /* Don't touch extended registers */
>>
>> COPY_SEG_CPL3(cs);
>> @@ -197,8 +196,6 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
>>
>> get_user_ex(tmp, &sc->fpstate);
>> buf = compat_ptr(tmp);
>> -
>> - get_user_ex(*pax, &sc->ax);
>> } get_user_catch(err);
>
> Note that arch/x86/kernel/signal.c appears to have a similar pattern -
> and there it could be removed as well?
>
> I'm wondering what the original reason for adding the extra handling
> of regs->ax was. Maybe something changed regs->ax - but I cannot find
> such code path anymore.
>
> It would be nice to try to do a bit of Git archeology to figure out
> the origins of this complication - maybe it's something subtle - or
> it's something that has changed meanwhile.
It goes all the way back to 2.1.106pre1, when restore_sigcontext() was
changed to return an error code instead of EAX directly.
https://git.kernel.org/cgit/linux/kernel/git/history/history.git/diff/arch/i386/kernel/signal.c?id=9a8f8b7ca3f319bd668298d447bdf32730e51174
--
Brian Gerst
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists