From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494AbdK0WrM (ORCPT ); Mon, 27 Nov 2017 17:47:12 -0500 Received: from mga06.intel.com ([134.134.136.31]:47150 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752129AbdK0WrL (ORCPT ); Mon, 27 Nov 2017 17:47:11 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,465,1505804400"; d="scan'208";a="10291187" Subject: Re: [PATCH 4/5] x86/mm/kaiser: Remove superfluous SWITCH_TO_KERNEL To: Peter Zijlstra , linux-kernel@vger.kernel.org References: <20171127223110.479550152@infradead.org> <20171127223405.329572992@infradead.org> Cc: 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 From: Dave Hansen Message-ID: Date: Mon, 27 Nov 2017 14:47:08 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171127223405.329572992@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.