Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753138AbeAQOKJ (ORCPT + 1 other); Wed, 17 Jan 2018 09:10:09 -0500 Received: from 8bytes.org ([81.169.241.247]:40408 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752491AbeAQOKH (ORCPT ); Wed, 17 Jan 2018 09:10:07 -0500 Date: Wed, 17 Jan 2018 15:10:06 +0100 From: Joerg Roedel To: Brian Gerst Cc: Andy Lutomirski , 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 , 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: <20180117141006.GR28161@8bytes.org> References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-4-git-send-email-joro@8bytes.org> <20180117092442.GJ28161@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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 05:57:53AM -0800, Brian Gerst wrote: > On Wed, Jan 17, 2018 at 1:24 AM, Joerg Roedel wrote: > > I have no real idea on how to switch back to the entry stack without > > access to per_cpu variables. I also can't access the cpu_entry_area for > > the cpu yet, because for that we need to be on the entry stack already. > > Switch to the trampoline stack before loading user segments. That requires to copy most of pt_regs from task- to trampoline-stack, not sure if that is faster than temporily restoring kernel %fs. Joerg