Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbeAENEJ (ORCPT + 1 other); Fri, 5 Jan 2018 08:04:09 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:44436 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbeAENEI (ORCPT ); Fri, 5 Jan 2018 08:04:08 -0500 Date: Fri, 5 Jan 2018 14:03:58 +0100 (CET) From: Thomas Gleixner To: Juergen Gross cc: David Woodhouse , ak@linux.intel.com, Paul Turner , LKML , Linus Torvalds , Greg Kroah-Hartman , Tim Chen , Dave Hansen , Kees Cook , Rik van Riel , Peter Zijlstra , Andy Lutomirski , Jiri Kosina , gnomes@lxorguk.ukuu.org.uk Subject: Re: [PATCH v3 01/13] x86/retpoline: Add initial retpoline support In-Reply-To: <253b8320-e122-d5f7-b305-387db2f86818@suse.com> Message-ID: References: <1515058213.12987.89.camel@amazon.co.uk> <20180104143710.8961-1-dwmw@amazon.co.uk> <253b8320-e122-d5f7-b305-387db2f86818@suse.com> 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 Fri, 5 Jan 2018, Juergen Gross wrote: > On 05/01/18 13:54, Thomas Gleixner wrote: > > On Thu, 4 Jan 2018, David Woodhouse wrote: > >> diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h > >> index 07cdd1715705..900fa7016d3f 100644 > >> --- a/arch/x86/include/asm/cpufeatures.h > >> +++ b/arch/x86/include/asm/cpufeatures.h > >> @@ -342,5 +342,6 @@ > >> #define X86_BUG_MONITOR X86_BUG(12) /* IPI required to wake up remote CPU */ > >> #define X86_BUG_AMD_E400 X86_BUG(13) /* CPU is among the affected by Erratum 400 */ > >> #define X86_BUG_CPU_INSECURE X86_BUG(14) /* CPU is insecure and needs kernel page table isolation */ > >> +#define X86_BUG_NO_RETPOLINE X86_BUG(15) /* Placeholder: disable retpoline branch thunks */ > > > > I think this is the wrong approach. We have X86_BUG_CPU_INSECURE, which now > > should be renamed to X86_BUG_CPU_MELTDOWN_V3 or something like that. It > > tells the kernel, that the CPU is affected by variant 3. > > MELTDOWN is variant 3. > > > > > If the kernel detects that and has PTI support then it sets the 'pti' > > feature bit which tells that the mitigation is in place. > > > > So what we really want is > > > > X86_BUG_MELTDOWN_V1/2/3 > > X86_BUG_MELTDOWN, X86_BUG_SPECTRE_V1, X86_BUG_SPECTRE_V2 Right. I'm confused as always :)