lkml.org 
[lkml]   [2015]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] x86: change THREAD_INFO definition to not depend on KERNEL_STACK_OFFSET
On Thu, Mar 19, 2015 at 06:17:45PM +0100, Denys Vlasenko wrote:
> This changes THREAD_INFO definition and all its callsites
> so that they do not count stack position from
> (top of stack - KERNEL_STACK_OFFSET), but from top of stack.
>
> Semi-mysterious expressions THREAD_INFO(%rsp,RIP) - "why RIP??"
> are now replaced by more logical THREAD_INFO(%rsp,SIZEOF_PTREGS) -
> "calculate thread_info's address using information that
> rsp is SIZEOF_PTREGS bytes below top of stack".
>
> While at it, replace "(off)-THREAD_SIZE(reg)" with equivalent
> "((off)-THREAD_SIZE)(reg)". The form without parentheses
> falsely looks like we invoke THREAD_SIZE() macro.
>
> Improve comment atop THREAD_INFO macro definition.
>
> This patch does not change generated code (verified by objdump).
>
> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
> CC: Linus Torvalds <torvalds@linux-foundation.org>
> CC: Steven Rostedt <rostedt@goodmis.org>
> CC: Ingo Molnar <mingo@kernel.org>
> CC: Borislav Petkov <bp@alien8.de>
> CC: "H. Peter Anvin" <hpa@zytor.com>
> CC: Andy Lutomirski <luto@amacapital.net>
> CC: Oleg Nesterov <oleg@redhat.com>
> CC: Frederic Weisbecker <fweisbec@gmail.com>
> CC: Alexei Starovoitov <ast@plumgrid.com>
> CC: Will Drewry <wad@chromium.org>
> CC: Kees Cook <keescook@chromium.org>
> CC: x86@kernel.org
> CC: linux-kernel@vger.kernel.org

Acked-by: Borislav Petkov <bp@suse.de>

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--


\
 
 \ /
  Last update: 2015-03-20 11:41    [W:0.200 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site