Received: by 10.223.176.46 with SMTP id f43csp793488wra; Fri, 19 Jan 2018 01:58:14 -0800 (PST) X-Google-Smtp-Source: ACJfBoswwSA9PS4uogi/gzluraRsrDEXqsaEmpsYnc1J4m1vG1z6CVn2CnWA97l7a4isESrkHdbr X-Received: by 10.98.102.135 with SMTP id s7mr36668384pfj.209.1516355894571; Fri, 19 Jan 2018 01:58:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516355894; cv=none; d=google.com; s=arc-20160816; b=ynQpOz4wuGuSAMT2T8OoDHNMU3hkuehBJPrd82LyMzMYlDNJasBxhfMjWkFIC+WN5B mUc6u5K2WfreAAnm9sIp/EriLj7IaSA0nxM9JMsxg4CH8sXK7II3LstiroQvvtrfxKuV 2s8WQFA//8RPWdJ9np8z7L17V0trduNonWo2Sheyx0sUVS78smtFlk5wGN++2RlDfsLk TV1Pf5oasjFwO8IwIaqzJid9/angYkV7Prw3DJMBkTUvN0IEnWm0gG206YmMO+NqaGR6 0j+Fp6Dhw6DuSHrDy75h0TzXL9/EO+VeXi/vZCtXIZL/fazB5JEnXqkeIapuI97xxRY1 /ssQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=BV8lM+Ug9fEhqzXtrvRjR8gQTY4/ylFVafJSFcMyEPo=; b=oim0iN0HkskqdNp36A6Fy0ra3/Eg7RGcsNpuZfqm6kAudOwKOEfePGCtLKZ52pCiu4 06gY7uWNrjkk7NsjAGG1N9LWj/pqdqY9QCo9hrrPq15N3NcjFILyTIkDMl29xTCnnKbi zfjU0ndzojz4NhHfJf8COvf4QqSSsCat/5++s/0DnoZy/d1T4l077IAvoN12spV8wz+O zMc7ix9Rtvm3SkGURHkNDH11NQ7fnp1iO1YnOxNGlIrfMrHXpGh0a6avZZl8HJ5wzgQJ DnrJ5U2NG7tWQD1n05P9ZysFEmHUNM15iR6V6hgSvzN1tS3DPHnDEitGpOtz2GaMcGXA 2nKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=ftNF9S+m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si7783379pgp.717.2018.01.19.01.58.00; Fri, 19 Jan 2018 01:58:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=ftNF9S+m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755174AbeASJ5L (ORCPT + 99 others); Fri, 19 Jan 2018 04:57:11 -0500 Received: from 8bytes.org ([81.169.241.247]:55674 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754699AbeASJ5H (ORCPT ); Fri, 19 Jan 2018 04:57:07 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id EE51B1FD; Fri, 19 Jan 2018 10:57:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1516355825; bh=hs4y4TG/If3o8Eakginbzqnv+EMqu5/tUTlw2nn5vdo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ftNF9S+m/aEeu3/ddro1cT49PndIG/IUNtPwRObkloE1wZGtajUg8FH/mba9pFrXN 8A04F0x9QED3cD7rZdBuioBF4AXBGWhOnt4b4Q0lWkmp/Y7JBDfGaKUmVpdNy3w66b goqBC3/fZjp0CBxI7p6YAA7bOy5JwYdWyPFYAYcUissMQYc4nBDiuiEpMGr1RCNKOt b3jMApfFNdftjkA6S6t5vkUyijBNuRrnnmhRUkJtaIebnsRgefqVOtjqjQFSAm4cM6 42KjYSJ53Eb/+b7U9qNcZTvd+EQ4UEzDeIg2ft6JZMcAB6+AKfJxikDe1u9bTWGeWI KjIkHdI5Ua/rQ== Date: Fri, 19 Jan 2018 10:57:05 +0100 From: Joerg Roedel To: Andy Lutomirski Cc: Brian Gerst , 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: <20180119095705.GZ28161@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> <20180117141006.GR28161@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 17, 2018 at 10:12:32AM -0800, Andy Lutomirski wrote: > I would optimize for simplicity, not speed. You're already planning > to write to CR3, which is serializing, blows away the TLB, *and* takes > the absurdly large amount of time that the microcode needs to blow > away the TLB. Okay, so I am going to do the stack-switch before pt_regs is restored. This is at least better than playing games with hiding the entry/exit %esp somewhere in stack-memory. Thanks, Joerg