Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942136AbcLWSTW convert rfc822-to-8bit (ORCPT ); Fri, 23 Dec 2016 13:19:22 -0500 Received: from mga06.intel.com ([134.134.136.31]:56034 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S942107AbcLWSTV (ORCPT ); Fri, 23 Dec 2016 13:19:21 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,395,1477983600"; d="scan'208";a="915614904" From: "Andrejczuk, Grzegorz" To: Thomas Gleixner CC: "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "Luc, Piotr" , "dave.hansen@linux.intel.com" Subject: RE: [Patch v11 4/5] x86/cpufeature: enable RING3MWAIT for Knights Landing Thread-Topic: [Patch v11 4/5] x86/cpufeature: enable RING3MWAIT for Knights Landing Thread-Index: AQHSWsfWby0ag3ZTSUq6LLYbMivcDaERKPyAgAGx5YCAANYpEIAAIBqAgAAELNCAADJVAIABeKxQ Date: Fri, 23 Dec 2016 18:19:06 +0000 Message-ID: References: <1482241726-27310-5-git-send-email-grzegorz.andrejczuk@intel.com> <1482258687-4582-1-git-send-email-grzegorz.andrejczuk@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1190 Lines: 28 On Thursday, December 22, 2016 3:21 PM Thomas Gleixner wrote: > Changing types to match is the proper solution to all problems? You cannot > just change types to make the compiler happy. You have to check what type > is expected for it in the places which consume it, including compat mode. HWCAP is u32 on x86 architecture, HWCAP2 on other architectures is uint. I think I will be consistent with architecture and use u32 and bit OR operator. It should be handled same way as ELF_HWCAP in user space and in 32 bits. Please let me know if you agree to this solution. > What has the MSR to do with ELF_HWCAP2? ELF_HWCAP2 is a system global > variable. The MSR is of course per hardware thread. You are right - nothing. I can set HWCAP2 once for boot cpu. To achieve that I need to distinguish boot cpu in probe_xeon_phi_r3mwait. >From looking around the kernel code I suspect it can be done like below: if (c == &boot_cpu_data) ELF_HWCAP2 |= HWCAP2_RING3MWAIT; If there's a better way, please let me know. > CPU bringup is serialized, i.e. init_intel() cannot run concurrently on > different CPUs. Thank you for your explanation, time and effort. Merry Christmas, Grzegorz