All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Brian Gerst <brgerst@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/signal: Remove pax argument from restore_sigcontext
Date: Sat, 4 Apr 2015 16:14:34 +0200	[thread overview]
Message-ID: <20150404141434.GC22756@gmail.com> (raw)
In-Reply-To: <1428152303-17154-1-git-send-email-brgerst@gmail.com>


* Brian Gerst <brgerst@gmail.com> wrote:

> The pax argument is unnecesary.  Instead, store the RAX value directly
> in regs.
> 
> Signed-off-by: Brian Gerst <brgerst@gmail.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: Andy Lutomirski <luto@amacapital.net>
> Cc: Denys Vlasenko <dvlasenk@redhat.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: x86@kernel.org
> Cc: linux-kernel@vger.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.

Thanks,

	Ingo

  reply	other threads:[~2015-04-04 14:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-04 12:58 [PATCH] x86/signal: Remove pax argument from restore_sigcontext Brian Gerst
2015-04-04 14:14 ` Ingo Molnar [this message]
2015-04-04 17:07   ` Brian Gerst
2015-04-05  5:09     ` Ingo Molnar
2015-04-05  0:01   ` Brian Gerst
2015-04-06  7:03     ` Ingo Molnar
2015-04-06 12:00       ` Brian Gerst
2015-04-07  9:42         ` Ingo Molnar
2015-04-07  9:40 ` [tip:x86/asm] " tip-bot for Brian Gerst

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=20150404141434.GC22756@gmail.com \
    --to=mingo@kernel.org \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.