Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752847AbeAFSXL (ORCPT + 1 other); Sat, 6 Jan 2018 13:23:11 -0500 Received: from mga01.intel.com ([192.55.52.88]:6278 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbeAFSXK (ORCPT ); Sat, 6 Jan 2018 13:23:10 -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,322,1511856000"; d="scan'208";a="164703258" Subject: Re: [PATCH v2 4/8] x86/spec_ctrl: Add sysctl knobs to enable/disable SPEC_CTRL feature To: Dave Hansen , Konrad Rzeszutek Wilk Cc: Thomas Gleixner , Andy Lutomirski , Linus Torvalds , Greg KH , Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , David Woodhouse , linux-kernel@vger.kernel.org References: <20180106144110.GA2592@localhost.localdomain> <742ed1d9-7210-8443-0373-5af74f193ab9@intel.com> From: Tim Chen Message-ID: <7d2457b1-9cfb-f9b4-2d7c-69fd99492375@linux.intel.com> Date: Sat, 6 Jan 2018 10:23:09 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <742ed1d9-7210-8443-0373-5af74f193ab9@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/06/2018 09:33 AM, Dave Hansen wrote: > On 01/06/2018 06:41 AM, Konrad Rzeszutek Wilk wrote: >>> .macro DISABLE_IBRS >>> - ALTERNATIVE "jmp .Lskip_\@", "", X86_FEATURE_SPEC_CTRL >>> + testl $1, dynamic_ibrs >> On every system call we end up hammering on this 'dynamic_ibrs' >> variable. And it looks like it can be flipped via the IPI mechanism. >> >> Would it make sense for this to be per-cpu? > > It's probably better to either just make it __read_mostly or get the > static branches that folks were suggesting actually working. > dynamic_ibrs is indeed declared __read_mostly +unsigned int dynamic_ibrs __read_mostly; +EXPORT_SYMBOL_GPL(dynamic_ibrs); Tim