Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932867AbeALB6O (ORCPT + 1 other); Thu, 11 Jan 2018 20:58:14 -0500 Received: from mga03.intel.com ([134.134.136.65]:35287 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932297AbeALB6N (ORCPT ); Thu, 11 Jan 2018 20:58:13 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,347,1511856000"; d="scan'208";a="9516889" Subject: Re: [PATCH 3/5] x86/ibrs: Add direct access support for MSR_IA32_SPEC_CTRL To: Ashok Raj , linux-kernel@vger.kernel.org, Thomas Gleixner , Tim Chen , Andy Lutomirski , Linus Torvalds , Greg KH References: <1515720739-43819-1-git-send-email-ashok.raj@intel.com> <1515720739-43819-4-git-send-email-ashok.raj@intel.com> Cc: Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , David Woodhouse , Peter Zijlstra , Dan Williams , Paolo Bonzini , Jun Nakajima , Asit Mallick From: Dave Hansen Message-ID: Date: Thu, 11 Jan 2018 17:58:11 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1515720739-43819-4-git-send-email-ashok.raj@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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?