From: "Jan Beulich" Subject: Re: [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver Date: Mon, 08 Jun 2015 10:21:09 +0100 Message-ID: <55757AA50200007800081E03@mail.emea.novell.com> References: <1463125852-14155-1-git-send-email-wei.w.wang@intel.com> <55649803020000780007DF1A@mail.emea.novell.com> <286AC319A985734F985F78AFA26841F797EDD9@shsmsx102.ccr.corp.intel.com> <557557320200007800081CC1@mail.emea.novell.com> <286AC319A985734F985F78AFA26841F797F257@shsmsx102.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <286AC319A985734F985F78AFA26841F797F257@shsmsx102.ccr.corp.intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei W Wang Cc: "jinsong.liu@alibaba-inc.com" , "xen-devel@lists.xen.org" , "wei.liu2@citrix.com" , "ian.campbell@citrix.com" , "andrew.cooper3@citrix.com" List-Id: xen-devel@lists.xenproject.org >>> On 08.06.15 at 10:18, wrote: > Regarding the self-documenting related comment here, which of the following > do you think is better? > 1) > #define BYT_MIN_PSTATE_SHIFT 8 > #define BYT_MAX_PSTATE_SHIFT 16 > #define BYT_PSTATE_MASK 0x7f > #define BYT_TURBO_CONTROL_BIT 32 > > 2) > #define BYT_MIN_PSTATE(value) (((value) >> 8) & 0x7F) > #define BYT_MAX_PSTATE(value) (((value) >> 16) & 0x7F) > #define BYT_SET_TURBO_CONTROL_BIT(value) ((val) |= (u64)1 << 32) I think the first two of 2) and the fourth one of 1) are the best combination, but I'd really leave it up to you (with, if using it, the val vs value issue fixed in the last one). Jan