From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753583AbdKXNru (ORCPT ); Fri, 24 Nov 2017 08:47:50 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:55477 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752677AbdKXNrt (ORCPT ); Fri, 24 Nov 2017 08:47:49 -0500 Date: Fri, 24 Nov 2017 14:47:40 +0100 From: Peter Zijlstra To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Dave Hansen , Andy Lutomirski , Thomas Gleixner , "H . Peter Anvin" , Borislav Petkov , Linus Torvalds Subject: Re: [PATCH 30/43] x86/mm/kaiser: Map espfix structures Message-ID: <20171124134740.6dmv6nfo5ihrkj3f@hirez.programming.kicks-ass.net> References: <20171124091448.7649-1-mingo@kernel.org> <20171124091448.7649-31-mingo@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171124091448.7649-31-mingo@kernel.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 24, 2017 at 10:14:35AM +0100, Ingo Molnar wrote: > From: Dave Hansen > > There is some rather arcane code to help when an IRET returns > to 16-bit segments. It is referred to as the "espfix" code. > This consists of a few per-cpu variables: > > espfix_stack: tells us where the stack is allocated > (the bottom) > espfix_waddr: tells us to where %rsp may be pointed > (the top) > > These are in addition to the stack itself. All three things must > be mapped for the espfix code to function. > > Note: the espfix code runs with a kernel GSBASE, but user > (shadow) page tables. A switch to the kernel page tables could > be performed instead of mapping these structures, but mapping > them is simpler and less likely to break the assembly. To switch > over to the kernel copy, additional temporary storage would be > required which is in short supply in this context. With Andy's patches that should actually be doable, no?