From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751922AbbCTKbq (ORCPT ); Fri, 20 Mar 2015 06:31:46 -0400 Received: from mail.skyhub.de ([78.46.96.112]:51470 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751665AbbCTKbk (ORCPT ); Fri, 20 Mar 2015 06:31:40 -0400 Date: Fri, 20 Mar 2015 11:30:01 +0100 From: Borislav Petkov To: Denys Vlasenko Cc: Andy Lutomirski , Linus Torvalds , Steven Rostedt , Ingo Molnar , "H. Peter Anvin" , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] x86: change THREAD_INFO definition to not depend on KERNEL_STACK_OFFSET Message-ID: <20150320103001.GB17058@pd.tnic> References: <1426785469-15125-1-git-send-email-dvlasenk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1426785469-15125-1-git-send-email-dvlasenk@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > CC: Linus Torvalds > CC: Steven Rostedt > CC: Ingo Molnar > CC: Borislav Petkov > CC: "H. Peter Anvin" > CC: Andy Lutomirski > CC: Oleg Nesterov > CC: Frederic Weisbecker > CC: Alexei Starovoitov > CC: Will Drewry > CC: Kees Cook > CC: x86@kernel.org > CC: linux-kernel@vger.kernel.org Acked-by: Borislav Petkov -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --