From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752940AbdK0Wxb (ORCPT ); Mon, 27 Nov 2017 17:53:31 -0500 Received: from merlin.infradead.org ([205.233.59.134]:39706 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409AbdK0Wxa (ORCPT ); Mon, 27 Nov 2017 17:53:30 -0500 Date: Mon, 27 Nov 2017 23:53:06 +0100 From: Peter Zijlstra To: Dave Hansen Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Ingo Molnar , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Josh Poimboeuf , Linus Torvalds , Rik van Riel , daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, linux-mm@kvack.org, michael.schwarz@iaik.tugraz.at, moritz.lipp@iaik.tugraz.at, richard.fellner@student.tugraz.at Subject: Re: [PATCH 4/5] x86/mm/kaiser: Remove superfluous SWITCH_TO_KERNEL Message-ID: <20171127225306.6f7iueus7fq2hg7h@hirez.programming.kicks-ass.net> References: <20171127223110.479550152@infradead.org> <20171127223405.329572992@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon, Nov 27, 2017 at 02:47:08PM -0800, Dave Hansen wrote: > On 11/27/2017 02:31 PM, Peter Zijlstra wrote: > > We never use this code-path with KAISER enabled. > ... > > @@ -201,14 +201,6 @@ ENTRY(entry_SYSCALL_64) > > > > swapgs > > movq %rsp, PER_CPU_VAR(rsp_scratch) > > - > > - /* > > - * The kernel CR3 is needed to map the process stack, but we > > - * need a scratch register to be able to load CR3. %rsp is > > - * clobberable right now, so use it as a scratch register. > > - * %rsp will look crazy here for a couple instructions. > > - */ > > - SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp > > movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp > > What's the mechanism that we use to switch between the two versions of > the SYSCALL entry? It wasn't obvious from some grepping. the next patch, the code in tip will in fact never use this code. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f72.google.com (mail-it0-f72.google.com [209.85.214.72]) by kanga.kvack.org (Postfix) with ESMTP id 584316B0033 for ; Mon, 27 Nov 2017 17:53:18 -0500 (EST) Received: by mail-it0-f72.google.com with SMTP id p144so12747438itc.9 for ; Mon, 27 Nov 2017 14:53:18 -0800 (PST) Received: from merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id d93si22226631ioj.24.2017.11.27.14.53.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 14:53:17 -0800 (PST) Date: Mon, 27 Nov 2017 23:53:06 +0100 From: Peter Zijlstra Subject: Re: [PATCH 4/5] x86/mm/kaiser: Remove superfluous SWITCH_TO_KERNEL Message-ID: <20171127225306.6f7iueus7fq2hg7h@hirez.programming.kicks-ass.net> References: <20171127223110.479550152@infradead.org> <20171127223405.329572992@infradead.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: Dave Hansen Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Ingo Molnar , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Josh Poimboeuf , Linus Torvalds , Rik van Riel , daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, linux-mm@kvack.org, michael.schwarz@iaik.tugraz.at, moritz.lipp@iaik.tugraz.at, richard.fellner@student.tugraz.at On Mon, Nov 27, 2017 at 02:47:08PM -0800, Dave Hansen wrote: > On 11/27/2017 02:31 PM, Peter Zijlstra wrote: > > We never use this code-path with KAISER enabled. > ... > > @@ -201,14 +201,6 @@ ENTRY(entry_SYSCALL_64) > > > > swapgs > > movq %rsp, PER_CPU_VAR(rsp_scratch) > > - > > - /* > > - * The kernel CR3 is needed to map the process stack, but we > > - * need a scratch register to be able to load CR3. %rsp is > > - * clobberable right now, so use it as a scratch register. > > - * %rsp will look crazy here for a couple instructions. > > - */ > > - SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp > > movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp > > What's the mechanism that we use to switch between the two versions of > the SYSCALL entry? It wasn't obvious from some grepping. the next patch, the code in tip will in fact never use this code. -- 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