Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754537AbeALJv7 (ORCPT + 1 other); Fri, 12 Jan 2018 04:51:59 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:50419 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754483AbeALJv5 (ORCPT ); Fri, 12 Jan 2018 04:51:57 -0500 Date: Fri, 12 Jan 2018 10:51:48 +0100 From: Peter Zijlstra To: Dave Hansen Cc: Ashok Raj , linux-kernel@vger.kernel.org, Thomas Gleixner , Tim Chen , Andy Lutomirski , Linus Torvalds , Greg KH , Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , David Woodhouse , Dan Williams , Paolo Bonzini , Jun Nakajima , Asit Mallick Subject: Re: [PATCH 3/5] x86/ibrs: Add direct access support for MSR_IA32_SPEC_CTRL Message-ID: <20180112095148.GP3040@hirez.programming.kicks-ass.net> References: <1515720739-43819-1-git-send-email-ashok.raj@intel.com> <1515720739-43819-4-git-send-email-ashok.raj@intel.com> 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 Thu, Jan 11, 2018 at 05:58:11PM -0800, Dave Hansen wrote: > On 01/11/2018 05:32 PM, Ashok Raj wrote: > > +static void save_guest_spec_ctrl(struct vcpu_vmx *vmx) > > +{ > > + if (boot_cpu_has(X86_FEATURE_SPEC_CTRL)) { > > + vmx->spec_ctrl = spec_ctrl_get(); > > + spec_ctrl_restriction_on(); > > + } else > > + rmb(); > > +} > > Does this need to be "ifence()"? Better yet, do we just need to create > a helper for boot_cpu_has(X86_FEATURE_SPEC_CTRL) that does the barrier? static_cpu_has() + hard asm-goto requirement. Please drop all the above nonsense on the floor hard. Let backporters sort out whever they need, don't introduce crap like that upstream.