Received: by 10.223.176.46 with SMTP id f43csp2719010wra; Mon, 22 Jan 2018 02:12:44 -0800 (PST) X-Google-Smtp-Source: AH8x224mfm5dl83etLfcpKTIeVzny4LUTA075WT8E+n0xyXcZKhWCgejCIALEe+JIIJEpnNYuICH X-Received: by 2002:a17:902:6b48:: with SMTP id g8-v6mr3136708plt.243.1516615964514; Mon, 22 Jan 2018 02:12:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516615964; cv=none; d=google.com; s=arc-20160816; b=ROpuNkmRmDu102YaBXKE2Dx39nxjk66p+tvdz5Afg5a3GwVm4lbAtpU5HuEWTSVLPC 6fJ93SFMY1chZRnnoFY58DL69eYTZb5Vi7Wwo0JAl2awSRRD9dj+ncBTLy33VW9USUN8 agVOgtJcsRLbQhjdNcbIPxb4YWenYvpiy3kmfrC7hbg9AKcFw7lXLZyrRCNo/mPslhhg QIKa4B72m2kLfHEiT9mR7TsTJd0rzALN6V//BXpHCPrgWxkzWKIq9vQCXtY8jJgwJm/V vhxmWaN5rs+rz8P0bBwfW31iom2fqjZBfkMtSgCTd0sAjOujlczcrhyNhhNTs892Kl7B 49tQ== 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=46w380x51MVtJzVIxV+bguOZAFgzsuGlD5FF4lWni7Q=; b=fI7VWUmHIwlT5jnF1FDeEahbC2rn6TKCQ+lM84XRgcgn/ltxA3UiBJFQhWD65bXM0B Chy+uCzabn3IY06c3tuXpcVEJWPvq3+SCNbqE1mJV12VI89GxdGtzZshTkdcu9sFLewY epqzQGxx2RMJrXuUAiQXASthEVcQFAr9DUWHzGvpUdlCAfgeOy1jPOaDRuXq0U4D1hpo THm2pVoCOYK/V+KKwD3AB6f3yCSE1rMDgJPYusDQMrf4pqpldlW7MOvA+xInS+S6Vogo XdOjNSKyNMp03SI2K3T0apvtYXLSGLXvNXwV9J3vSijvlk26R/WQoLTxDT2qUicaQ4Dh AJaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=dDbWKEcQ; 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 r1si13336592pgp.320.2018.01.22.02.12.29; Mon, 22 Jan 2018 02:12:44 -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=dDbWKEcQ; 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 S1751107AbeAVKLV (ORCPT + 99 others); Mon, 22 Jan 2018 05:11:21 -0500 Received: from 8bytes.org ([81.169.241.247]:53140 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928AbeAVKLU (ORCPT ); Mon, 22 Jan 2018 05:11:20 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 87695230; Mon, 22 Jan 2018 11:11:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1516615878; bh=e1YkLulF4+kk0zKOZwvE1W7YgbqQqQamsTflr1iVUPw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dDbWKEcQcPdh+lJhoBVDDekpZX+uKce9KjKJhSknNy/nvUQjgegsvpp5kZEK1EtFp jCF5LI5aRaIJWZb8JOlDedk/bsg2+aBdH3aVBb0xmINnvZ+ofXBQqz6lr/HWZDdO6d KaLN7G1HcKt2VDZwqZoKQLztREZbUhkKVA3Tf56VGATp4/UmhC5soTCLzTXJuuUQtN /P/KXZTajMZdUyLFDRyGH4VkliZGIXxg4Cm8P55m6qpqX+VYIFcfqc1V4/py/MogvY kcebsh/NC1XvH3ViHSNpCySMNa095AIyBnRE6OsLs9H6onRQpkuB5jSpUAHrCwRxAS icd8AiTlK0bag== Date: Mon, 22 Jan 2018 11:11:18 +0100 From: Joerg Roedel 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 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: 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 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