From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753400AbeAQOpU (ORCPT + 1 other); Wed, 17 Jan 2018 09:45:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45258 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753051AbeAQOpT (ORCPT ); Wed, 17 Jan 2018 09:45:19 -0500 Date: Wed, 17 Jan 2018 08:45:03 -0600 From: Josh Poimboeuf 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 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> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 17 Jan 2018 14:45:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 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