From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753193AbcHOTXU (ORCPT ); Mon, 15 Aug 2016 15:23:20 -0400 Received: from terminus.zytor.com ([198.137.202.10]:38452 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752902AbcHOTXT (ORCPT ); Mon, 15 Aug 2016 15:23:19 -0400 Subject: Re: [PATCH v3 16/51] x86/32: put real return address on stack in entry code To: Josh Poimboeuf References: <34b62822bb153955ed4ec1ab2e19ea482361c16c.1471011425.git.jpoimboe@redhat.com> <20160815150941.nilwkrkszj5mm5ka@treble> <20160815182522.6vjn6aheuiw65oca@treble> Cc: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , X86 ML , "linux-kernel@vger.kernel.org" , Linus Torvalds , Steven Rostedt , Brian Gerst , Kees Cook , Peter Zijlstra , Frederic Weisbecker , Byungchul Park , Nilay Vaish From: "H. Peter Anvin" Message-ID: <495f58c1-d1f3-6259-1786-d1fc2e154587@zytor.com> Date: Mon, 15 Aug 2016 12:22:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160815182522.6vjn6aheuiw65oca@treble> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/15/16 11:25, Josh Poimboeuf wrote: > On Mon, Aug 15, 2016 at 11:04:42AM -0700, H. Peter Anvin wrote: >> On 08/15/16 08:09, Josh Poimboeuf wrote: >>> On Sun, Aug 14, 2016 at 12:31:47AM -0700, Andy Lutomirski wrote: >>>> On Fri, Aug 12, 2016 at 7:28 AM, Josh Poimboeuf wrote: >>>>> This standardizes the stacks of idle tasks to be consistent with other >>>>> tasks on 32-bit. >>>> >>>> It might be nice to stick a ud2 or 1: hlt; jmp 1b or similar >>>> afterwards to make it clear that initial_code can't return. >>> >>> Yeah, I'll do something like that. >>> >> >> "Standardizing the stack" how? A zero on the stack terminates the stack >> trace. > > Instead of zero, user tasks have a real return address at that spot. > This makes idle tasks consistent with that, so we have a well defined > "end of stack". Also it makes the stack trace more useful since it > shows what entry code was involved in calling into C. > So how is the stack terminated, and does things like kdb and kgdb need modifications? Or is there now a stack termination above the struct pt_regs? -hpa