[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUyFk8Z=c8vqec3-bzvM98vz18SBxQVvchT1dyHCbfu5g@mail.gmail.com>
Date: Tue, 10 Mar 2015 07:22:50 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Ingo Molnar <mingo@...nel.org>, Andi Kleen <andi@...stfloor.org>,
"H. Peter Anvin" <hpa@...or.com>, Oleg Nesterov <oleg@...hat.com>,
Borislav Petkov <bp@...en8.de>
Cc: Al Viro <viro@...iv.linux.org.uk>, X86 ML <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andy Lutomirski <luto@...capital.net>
Subject: Re: [PATCH v2 2/2] x86_64,signal: Remove 'fs' and 'gs' from sigcontext
[cc: Oleg, Borislav]
On Tue, Mar 10, 2015 at 7:03 AM, Andy Lutomirski <luto@...capital.net> wrote:
> As far as I can tell, these fields have been set to zero on save and
> ignored on restore since Linux was imported into git. Rename them
> '__pad1' and '__pad2' to avoid confusion and to allow them to be
> recycled some day.
>
> I'm intentionally avoiding calling either of them __pad0: the field
> formerly known as __pad0 is now ss.
>
> Signed-off-by: Andy Lutomirski <luto@...capital.net>
> ---
> arch/x86/include/asm/sigcontext.h | 4 ++--
> arch/x86/include/uapi/asm/sigcontext.h | 4 ++--
> arch/x86/kernel/signal.c | 4 ++--
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/include/asm/sigcontext.h b/arch/x86/include/asm/sigcontext.h
> index f910cdcb71fd..5f0ef11719e1 100644
> --- a/arch/x86/include/asm/sigcontext.h
> +++ b/arch/x86/include/asm/sigcontext.h
> @@ -57,8 +57,8 @@ struct sigcontext {
> unsigned long ip;
> unsigned long flags;
> unsigned short cs;
> - unsigned short gs;
> - unsigned short fs;
> + unsigned short __pad2; /* Was called gs, but was always zero. */
> + unsigned short __pad1; /* Was called gs, but was always zero. */
> unsigned short ss;
> unsigned long err;
> unsigned long trapno;
> diff --git a/arch/x86/include/uapi/asm/sigcontext.h b/arch/x86/include/uapi/asm/sigcontext.h
> index 076b11fd6fa1..df9908b1aa95 100644
> --- a/arch/x86/include/uapi/asm/sigcontext.h
> +++ b/arch/x86/include/uapi/asm/sigcontext.h
> @@ -177,8 +177,8 @@ struct sigcontext {
> __u64 rip;
> __u64 eflags; /* RFLAGS */
> __u16 cs;
> - __u16 gs;
> - __u16 fs;
> + __u16 __pad2; /* Was called gs, but was always zero. */
> + __u16 __pad1; /* Was called fs, but was always zero. */
> __u16 ss;
> __u64 err;
> __u64 trapno;
> diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
> index 40f34574fb36..01a53767823c 100644
> --- a/arch/x86/kernel/signal.c
> +++ b/arch/x86/kernel/signal.c
> @@ -155,8 +155,8 @@ int setup_sigcontext(struct sigcontext __user *sc, void __user *fpstate,
> #else /* !CONFIG_X86_32 */
> put_user_ex(regs->flags, &sc->flags);
> put_user_ex(regs->cs, &sc->cs);
> - put_user_ex(0, &sc->gs);
> - put_user_ex(0, &sc->fs);
> + put_user_ex(0, &sc->__pad2);
> + put_user_ex(0, &sc->__pad1);
> put_user_ex(regs->ss, &sc->ss);
> #endif /* CONFIG_X86_32 */
>
> --
> 2.3.0
>
--
Andy Lutomirski
AMA Capital Management, LLC
--
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