Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751260AbeAEFFa (ORCPT + 1 other); Fri, 5 Jan 2018 00:05:30 -0500 Received: from mga09.intel.com ([134.134.136.24]:7370 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750760AbeAEFF2 (ORCPT ); Fri, 5 Jan 2018 00:05:28 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,317,1511856000"; d="scan'208";a="189952638" Subject: Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS To: Andy Lutomirski References: <032e71e3826ed92523e9070fffa7108392848dc6.1515086770.git.tim.c.chen@linux.intel.com> <20180104221645.GC32035@hirez.programming.kicks-ass.net> <7fe03060-3904-dcf7-3cdf-a98ade5f5148@linux.intel.com> Cc: Tim Chen , Peter Zijlstra , Thomas Gleixner , Linus Torvalds , Greg KH , Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , LKML From: Dave Hansen Message-ID: <02624089-58b5-a3a1-834c-d6fd3b84478d@intel.com> Date: Thu, 4 Jan 2018 21:05:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: 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 Return-Path: On 01/04/2018 08:54 PM, Andy Lutomirski wrote: > On Thu, Jan 4, 2018 at 2:23 PM, Dave Hansen wrote: >> On 01/04/2018 02:21 PM, Tim Chen wrote: >>>> Does this really have to live outside of arch/x86/entry/ ? >>>> >>> There are some inline C routines later in this file >>> that will be needed by other functions. Want to consolidate >>> them in the same file. >> >> We could put all of the assembly into calling.h along with the PTI >> assembly. Seems as sane a place as anywhere else to put it. > > We should also stop thinking that NMI is at all special. All the > paranoid entry paths + NMI should just save and restore it, just like > CR3. Otherwise we get nasty corner cases with MCE, kprobes, etc. I've probably been too imprecise in my language here. The goal is absolutely to deal with all the paranoid paths. It's just that the NMI one is the easiest to understand and easiest to exercise. It also *is* special because it's the only one needing paranoid handling that does not use paranoid_exit itself.