Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2788889ybi; Sun, 9 Jun 2019 21:15:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTtRVCTTuewz9cgFCyfMe1wjQjUwTK/M7d3Am9Ryzbvjjbd86L8tYH6jWxxmbZt9mHJCLu X-Received: by 2002:a17:90a:2190:: with SMTP id q16mr18657496pjc.23.1560140117633; Sun, 09 Jun 2019 21:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560140117; cv=none; d=google.com; s=arc-20160816; b=OZzJKvJGPm6zhHyRgiCK+B+DsUOcyD34RbMJVTyeIyLIP4y0yO6Doa8QSiZ9cDksgV 9o5mTcVrz2RgBngdRldAZQ0swLjsGmcP2haZ2lctYExXQzXVNzrdiXHIf50UGvgq7EPa PSQAEthNXw9XsEezEAu74F3K55Nemz/k0t1wQERdqrvIKICD0m8mRWzTsm1Hjxb3pM2r mIeRyLlGksH2JXMP7BFQ2/d803WzNsvte9TZKyCfQvoWaj/sOode4VgJLETnW9aFgEO4 F6CRpf2Wwj1F/bPQT4ZbkLng3hmI35XxC9ExMIxoxp/fr3jjGGVdIfxGTDV5BbNfD7E8 kSnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KYJbw2yaRvh0EXTEVOCuxK/swGAVOs1iYJyFq4L7Qj4=; b=D4TJ+QK8P8U+iP+JjxMyjmxF+Wovh1Tdq2jQYurrmbzn4oUB6RY2SiBFUzzjWAT6Ot l1uuKHxr8kqRcked4ef+7FNA4cbTQmIJTj5FNI2sYvFtqI4cGbEqOi87wfRv7T8VbmEs DjxzWrvlLYpY5EsrIUEbA2v+Uk7GfVEMcHU9gFWgXvDi+Yqwz7ZVJCKQ8q6sqccCqH/q jCQda1lyasYEoRgZ3akowJ2Fnvn5bch0aaCb0zNDmwMUc+ZKWRNYYhiZauSHTwSMKDBN WKPgZ0oy9W54MWyY1BVdVexOp2QOds3xwO8t1HoSNVvpEFg05cTkFXvw1C4njUkpB4rk f5Dw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si7318499pgk.375.2019.06.09.21.14.49; Sun, 09 Jun 2019 21:15:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbfFJEOJ (ORCPT + 99 others); Mon, 10 Jun 2019 00:14:09 -0400 Received: from mga02.intel.com ([134.134.136.20]:52558 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbfFJEOJ (ORCPT ); Mon, 10 Jun 2019 00:14:09 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jun 2019 21:14:08 -0700 X-ExtLoop1: 1 Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by orsmga006.jf.intel.com with ESMTP; 09 Jun 2019 21:14:08 -0700 Date: Sun, 9 Jun 2019 21:04:49 -0700 From: Fenghua Yu To: Andy Lutomirski Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Ashok Raj , Tony Luck , Ravi V Shankar , linux-kernel , x86 Subject: Re: [PATCH v4 3/5] x86/umwait: Add sysfs interface to control umwait C0.2 state Message-ID: <20190610040449.GB162238@romley-ivt3.sc.intel.com> References: <1559944837-149589-1-git-send-email-fenghua.yu@intel.com> <1559944837-149589-4-git-send-email-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 08, 2019 at 03:52:03PM -0700, Andy Lutomirski wrote: > On Fri, Jun 7, 2019 at 3:10 PM Fenghua Yu wrote: > > > > C0.2 state in umwait and tpause instructions can be enabled or disabled > > on a processor through IA32_UMWAIT_CONTROL MSR register. > > > > > +static u32 get_umwait_control_c02(void) > > +{ > > + return umwait_control_cached & MSR_IA32_UMWAIT_CONTROL_C02; > > +} > > + > > +static u32 get_umwait_control_max_time(void) > > +{ > > + return umwait_control_cached & MSR_IA32_UMWAIT_CONTROL_MAX_TIME; > > +} > > + > > I'm not convinced that these helpers make the code any more readable. The helpers reduce length of statements that call them. Otherwise, all of the statements would be easily over 80 characters. Plus, each of the helpers is called multiple places in #0003 and #0004. So the helpers make the patches smaller and cleaner. So is it still OK to keep the helpers? Thanks. -Fenghua