From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755513AbdKBK65 (ORCPT ); Thu, 2 Nov 2017 06:58:57 -0400 Received: from terminus.zytor.com ([65.50.211.136]:54937 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752632AbdKBK64 (ORCPT ); Thu, 2 Nov 2017 06:58:56 -0400 Date: Thu, 2 Nov 2017 03:54:21 -0700 From: tip-bot for Andy Lutomirski Message-ID: Cc: bpetkov@suse.de, brgerst@gmail.com, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, hpa@zytor.com, luto@kernel.org, dave.hansen@intel.com, tglx@linutronix.de, torvalds@linux-foundation.org Reply-To: dave.hansen@intel.com, tglx@linutronix.de, torvalds@linux-foundation.org, bpetkov@suse.de, peterz@infradead.org, brgerst@gmail.com, linux-kernel@vger.kernel.org, mingo@kernel.org, luto@kernel.org, hpa@zytor.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/entry: Add task_top_of_stack() to find the top of a task's stack Git-Commit-ID: 3500130b84a3cdc5b6796eba1daf178944935efe X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 3500130b84a3cdc5b6796eba1daf178944935efe Gitweb: https://git.kernel.org/tip/3500130b84a3cdc5b6796eba1daf178944935efe Author: Andy Lutomirski AuthorDate: Thu, 2 Nov 2017 00:59:11 -0700 Committer: Ingo Molnar CommitDate: Thu, 2 Nov 2017 11:04:44 +0100 x86/entry: Add task_top_of_stack() to find the top of a task's stack This will let us get rid of a few places that hardcode accesses to thread.sp0. Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/b49b3f95a8ff858c40c9b0f5b32be0355324327d.1509609304.git.luto@kernel.org Signed-off-by: Ingo Molnar --- arch/x86/include/asm/processor.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 064b847..ad59cec 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -795,6 +795,8 @@ static inline void spin_lock_prefetch(const void *x) #define TOP_OF_INIT_STACK ((unsigned long)&init_stack + sizeof(init_stack) - \ TOP_OF_KERNEL_STACK_PADDING) +#define task_top_of_stack(task) ((unsigned long)(task_pt_regs(task) + 1)) + #ifdef CONFIG_X86_32 /* * User space process size: 3GB (default).