From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f200.google.com (mail-wr0-f200.google.com [209.85.128.200]) by kanga.kvack.org (Postfix) with ESMTP id 492A4800D8 for ; Mon, 22 Jan 2018 05:11:20 -0500 (EST) Received: by mail-wr0-f200.google.com with SMTP id s9so4738752wra.10 for ; Mon, 22 Jan 2018 02:11:20 -0800 (PST) Received: from theia.8bytes.org (8bytes.org. [2a01:238:4383:600:38bc:a715:4b6d:a889]) by mx.google.com with ESMTPS id c10si80807edf.457.2018.01.22.02.11.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 02:11:19 -0800 (PST) Date: Mon, 22 Jan 2018 11:11:18 +0100 From: Joerg Roedel Subject: Re: [PATCH 02/16] x86/entry/32: Enter the kernel via trampoline stack Message-ID: <20180122101118.GG28161@8bytes.org> References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-3-git-send-email-joro@8bytes.org> <20180117091853.GI28161@8bytes.org> <20180119095523.GY28161@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Andy Lutomirski Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , X86 ML , LKML , Linux-MM , Linus Torvalds , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Joerg Roedel Hey Andy, On Fri, Jan 19, 2018 at 08:30:33AM -0800, Andy Lutomirski wrote: > I meant that we could have sp0 have a genuinely constant value per > cpu. That means that the entry trampoline ends up with RIP, etc in a > different place depending on whether VM was in use, but the entry > trampoline code should be able to handle that. sp1 would have a value > that varies by task, but it could just point to the top of the stack > instead of being changed depending on whether VM is in use. Instead, > the entry trampoline would offset the registers as needed to keep > pt_regs in the right place. > > I think you already figured all of that out, though :) Yes, and after looking a while into it, it would make a nice cleanup for the entry code. On the other side, it would change the layout for the in-kernel 'struct pt_regs', so that the user-visible pt_regs ends up with a different layout than the one we use in the the kernel. This can certainly be all worked out, but it makes this nice entry-code cleanup not so nice and clean anymore. At least the work required to make it work without breaking user-space is not in the scope of this patch-set. Regards, Joerg -- 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