Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751954AbeAENsa (ORCPT + 1 other); Fri, 5 Jan 2018 08:48:30 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:44613 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbeAENs3 (ORCPT ); Fri, 5 Jan 2018 08:48:29 -0500 Date: Fri, 5 Jan 2018 14:48:19 +0100 (CET) From: Thomas Gleixner To: Dave Hansen cc: Borislav Petkov , Tim Chen , Andy Lutomirski , Linus Torvalds , Greg KH , Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/7] x86/spec_ctrl: Add sysctl knobs to enable/disable SPEC_CTRL feature In-Reply-To: Message-ID: References: <4d4b3752e8e533201c6983d8473eea95c747ea33.1515086770.git.tim.c.chen@linux.intel.com> <20180104183345.od2o4hsfu2tv6nc4@pd.tnic> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, 4 Jan 2018, Dave Hansen wrote: > On 01/04/2018 10:33 AM, Borislav Petkov wrote: > >> 2. At run time > >> echo 0 > /sys/kernel/debug/ibrs_enabled will turn off IBRS > >> echo 1 > /sys/kernel/debug/ibrs_enabled will turn on IBRS in kernel > >> echo 2 > /sys/kernel/debug/ibrs_enabled will turn on IBRS in both userspace and kernel > > I am not sure that tristate is really needed. What's wrong with on/off > > only? > > Lots of things: > > Distros have the tri-state already deployed. Which is the least relevant argument. Distros have shipped a lot of crap. > Paranoid people want "IBRS always" aka "ibrs 2". > Future CPUs may have cheap-enough IBRS to not be worth switching it. So again, as I said to David in the retpoline thread. 1) Start off with a CPU bug flag which describes the attack mode. 2) Have feature flags, which denote the mitigation mode 3) Have proper command line switching similar to pti 4) Keep the sysctl stuff separate Thanks, tglx