Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752332AbeAGIUa (ORCPT + 1 other); Sun, 7 Jan 2018 03:20:30 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54662 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbeAGIU3 (ORCPT ); Sun, 7 Jan 2018 03:20:29 -0500 Date: Sun, 7 Jan 2018 09:20:26 +0100 From: Greg KH To: Konrad Rzeszutek Wilk Cc: Tim Chen , Thomas Gleixner , Andy Lutomirski , Linus Torvalds , Dave Hansen , Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , David Woodhouse , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/8] x86/spec_ctrl: Add sysctl knobs to enable/disable SPEC_CTRL feature Message-ID: <20180107082026.GA11510@kroah.com> References: <20180106085410.GA4380@kroah.com> <0de2d41c-368c-685f-ac52-cf7ce440ac60@linux.intel.com> <20180106212519.GA18459@x230.dumpdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180106212519.GA18459@x230.dumpdata.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sat, Jan 06, 2018 at 04:25:19PM -0500, Konrad Rzeszutek Wilk wrote: > On Sat, Jan 06, 2018 at 10:10:59AM -0800, Tim Chen wrote: > > > > > > On 01/06/2018 12:54 AM, Greg KH wrote: > > > On Fri, Jan 05, 2018 at 06:12:19PM -0800, Tim Chen wrote: > > >> From: Tim Chen > > >> From: Andrea Arcangeli > > >> > > >> There are 2 ways to control IBRS > > >> > > >> 1. At boot time > > >> noibrs kernel boot parameter will disable IBRS usage > > >> > > >> Otherwise if the above parameters are not specified, the system > > >> will enable ibrs and ibpb usage if the cpu supports it. > > >> > > >> 2. At run time > > >> echo 0 > /sys/kernel/debug/x86/ibrs_enabled will turn off IBRS > > >> echo 1 > /sys/kernel/debug/x86/ibrs_enabled will turn on IBRS in kernel > > >> echo 2 > /sys/kernel/debug/x86/ibrs_enabled will turn on IBRS in both userspace and kernel > > >> > > > This is going to create headaches in the future. > > That is future CPUs there will be no need for this MSR nor retpoline as > the CPUs will observe correctness when switching .. rings/vm-exits/etc > and I would assume that 'ibrs_enabled' will return 0. > > And that will make folks scared and run to support/Intel with > complaints. > > Furthmore with the 'retpoline' work you can disable IBRS and instead use > 'retpoline's as mitigation - and again the 'ibrs_enabled' is now zero. > Cue in horde of customers calling support. > > Would it be better to have an global /sys/../spectre_resistent instead > of these 'well, check if the repoline sysfs is enabled, or if that is > not, then look at the cpuid flags'. > > It would be good to have this future proof. It's a debugfs api, it can be changed at any time, to be anything we want, and all is fine :) Let's get this all working first please, and then a "real" api can be designed and implemented to please everyone. thanks, greg k-h