From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935367AbcIUVEh (ORCPT ); Wed, 21 Sep 2016 17:04:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54024 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932199AbcIUVEe (ORCPT ); Wed, 21 Sep 2016 17:04:34 -0400 From: Josh Poimboeuf To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Linus Torvalds , Brian Gerst , Peter Zijlstra , Nilay Vaish Subject: [PATCH v2 0/9] x86/entry/head: standardize the end of the stack Date: Wed, 21 Sep 2016 16:03:58 -0500 Message-Id: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 21 Sep 2016 21:04:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v2: - keep 'restore_all' label in "x86/entry/head/32: use local labels" --- Thanks to all the recent x86 entry code refactoring, most tasks' kernel stacks start at the same offset right below their saved pt_regs, regardless of which syscall was used to enter the kernel. That creates a nice convention which makes it straightforward to identify the end of the stack, which can be useful [*] for the unwinder. But there a few places where tasks don't yet follow the convention. This patch set finishes the job. [*] This will be useful for three upcoming proposed features: - Detecting corrupt stacks in the unwinder (which will also be a force for ensuring this end of stack convention continues to be followed in the future). - Printing all saved pt_regs on the stack during an oops/warning. - Validating stacks in the livepatch consistency model. Josh Poimboeuf (9): x86/entry/head/32: use local labels x86/entry/32: rename 'error_code' to 'common_exception' x86/entry/32: fix the end of the stack for newly forked tasks x86/head/32: fix the end of the stack for idle tasks x86/smp: fix initial idle stack location on 32-bit x86/asm/head: use a common function for starting CPUs x86/head: put real return address on idle task stack x86/head: fix the end of the stack for idle tasks x86: move _stext marker to before head code arch/x86/entry/entry_32.S | 108 +++++++++++++++++++++++++----------------- arch/x86/kernel/head_32.S | 49 +++++++++++-------- arch/x86/kernel/head_64.S | 42 ++++++++-------- arch/x86/kernel/smpboot.c | 4 +- arch/x86/kernel/vmlinux.lds.S | 2 +- 5 files changed, 116 insertions(+), 89 deletions(-) -- 2.7.4