From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933269AbeALDOP (ORCPT + 1 other); Thu, 11 Jan 2018 22:14:15 -0500 Received: from mga01.intel.com ([192.55.52.88]:31837 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932432AbeALDON (ORCPT ); Thu, 11 Jan 2018 22:14:13 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,347,1511856000"; d="scan'208";a="9004368" Date: Thu, 11 Jan 2018 19:14:13 -0800 From: "Raj, Ashok" To: Dave Hansen Cc: 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 , Peter Zijlstra , Dan Williams , Paolo Bonzini , Jun Nakajima , Asit Mallick , Ashok Raj Subject: Re: [PATCH 3/5] x86/ibrs: Add direct access support for MSR_IA32_SPEC_CTRL Message-ID: <20180112031412.GB46095@otc-nc-03> 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.5.24 (2015-08-30) 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? Yes... Didn't keep track of ifence() evolution :-).. We could do a helper, will look into other uses and see we can make find a common way to comprehend usages like above. Cheers, Ashok