Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932399AbeAHMrZ (ORCPT + 1 other); Mon, 8 Jan 2018 07:47:25 -0500 Received: from merlin.infradead.org ([205.233.59.134]:50164 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932346AbeAHMrX (ORCPT ); Mon, 8 Jan 2018 07:47:23 -0500 Date: Mon, 8 Jan 2018 13:47:07 +0100 From: Peter Zijlstra To: Dave Hansen Cc: Tim Chen , Thomas Gleixner , Andy Lutomirski , Linus Torvalds , Greg KH , 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: <20180108124707.GH32035@hirez.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Jan 05, 2018 at 07:12:12PM -0800, Dave Hansen wrote: > On 01/05/2018 06:12 PM, Tim Chen wrote: > > .macro ENABLE_IBRS > > - ALTERNATIVE "jmp .Lskip_\@", "", X86_FEATURE_SPEC_CTRL > > + testl $1, dynamic_ibrs > > + jz .Lskip_\@ > > There was an earlier suggestion to use STATIC_JUMP_IF_... here. That's Yes, and thanks for Cc'ing me... :/ > a good suggestion, but we encountered some issues with it either > crashing the kernel at boot or not properly turning on/off. > > We would love to do that minor really soon, but we figured everyone > would rather see this version than wait for us to debug such a minor tweak. Its not minor, you need that LFENCE without it. Which makes the whole thing unconditionally expensive, which sucks.