From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-f198.google.com (mail-ot0-f198.google.com [74.125.82.198]) by kanga.kvack.org (Postfix) with ESMTP id D74EA6B0033 for ; Wed, 17 Jan 2018 09:45:20 -0500 (EST) Received: by mail-ot0-f198.google.com with SMTP id 60so12498939otc.8 for ; Wed, 17 Jan 2018 06:45:20 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id r10si351404oib.100.2018.01.17.06.45.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 06:45:19 -0800 (PST) Date: Wed, 17 Jan 2018 08:45:03 -0600 From: Josh Poimboeuf Subject: Re: [PATCH 03/16] x86/entry/32: Leave the kernel via the trampoline stack Message-ID: <20180117144503.62e47m6e5yyyze3d@treble> References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-4-git-send-email-joro@8bytes.org> <20180117092442.GJ28161@8bytes.org> <20180117141418.GS28161@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180117141418.GS28161@8bytes.org> Sender: owner-linux-mm@kvack.org List-ID: To: Joerg Roedel Cc: Brian Gerst , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , X86 ML , LKML , Linux-MM , Linus Torvalds , Dave Hansen , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Joerg Roedel On Wed, Jan 17, 2018 at 03:14:18PM +0100, Joerg Roedel wrote: > On Wed, Jan 17, 2018 at 06:00:07AM -0800, Brian Gerst wrote: > > On Wed, Jan 17, 2018 at 5:57 AM, Brian Gerst wrote: > > But then again, you could take a fault on the trampoline stack if you > > get a bad segment. Perhaps just pushing the new stack pointer onto > > the process stack before user segment loads will be the right move. > > User segment loads pop from the stack, so having anything on-top also > doesn't work. > > Maybe I can leave some space at the bottom of the task-stack at entry > time and store the pointer there on exit, if that doesn't confuse the > stack unwinder too much. If you put it at the end of the stack page, I _think_ all you'd have to do is just adjust TOP_OF_KERNEL_STACK_PADDING. -- Josh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org