[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 04/13] cpufreq: Add Hardware P-State (HWP) driver


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 4 Jun 2021 08:39:12 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nsRO0AHjPmE+cPy7mRipsIibB3oWyLfHn/5+4yugeP8=; b=B4zRbw+BtIUpAGJH9Ogj2/l2L7ZZAb5644IMQd1BZHEptH2InbXW9GRn7jhYcXtpj9FI+EVy/THZWXMTdcKqvXCbWbebqW256IkbVRxt+lLoEKRRoiWflRleHwNcYzxz+9HLT0MkHu4BlBSDGEHsopJPTixbx4k0xFlJn+3Lw4eO0VqwZIAs8/FrUKD6QToY0qg+3zvn8iGIfVvO1DPEvMgVrXQzfXsLq3JnOFOSwpYxwF3H3uT+tGY8hjzGhd4Qc34QNcxvQgurMpOws1dBhRDBE8X0Ctn3GCNUDo4/FLt42SvyyJ1liBBYB4nx2teGB2U4iCXKxR7rRsEI1genYQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NThK/Gm4fHHYfrHjadyBW8gmLfLKYZFyWpYg9tfASK1dx8pgebPBFKKdA23YI7HPqvbEI+IPMBuMUUqBhp9+fM7b7AvtGJObRp5V+2qBgQ3Erb8qLqqnGAt1/tHLfx8z5WQDdbTEDyHfyEIvbxogCc+COO53E/rfFoMc8IlDVtdDMsjMDnaSgyu+REW9l6WwKYr8yYIXdMRy2FiZeURiHp6Gbi5GdQBn90tv0djV/8f1oO5WragBXKAkkYyc6oBcPXC3C4O0mmol06iBb7ghqLihLFUgaRy0Z69a/a1enm8EuNAvuspUFEfKgSHf3AMcaCqxlN7wgsLUqIPKgWklwg==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 04 Jun 2021 06:39:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.06.2021 13:55, Jason Andryuk wrote:
> On Fri, May 28, 2021 at 2:35 AM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>> On 27.05.2021 20:50, Jason Andryuk wrote:
>>> On Wed, May 26, 2021 at 11:00 AM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>> On 03.05.2021 21:28, Jason Andryuk wrote:
>>>>> +    hwp_verbose("HWP: FAST_IA32_HWP_REQUEST %ssupported\n",
>>>>> +                eax & CPUID6_EAX_FAST_HWP_MSR ? "" : "not ");
>>>>> +    if ( eax & CPUID6_EAX_FAST_HWP_MSR )
>>>>> +    {
>>>>> +        if ( rdmsr_safe(MSR_FAST_UNCORE_MSRS_CAPABILITY, val) )
>>>>> +            hwp_err("error 
>>>>> rdmsr_safe(MSR_FAST_UNCORE_MSRS_CAPABILITY)\n");
>>>>> +
>>>>> +        hwp_verbose("HWP: MSR_FAST_UNCORE_MSRS_CAPABILITY: %016lx\n", 
>>>>> val);
>>>>
>>>> Missing "else" above here?
>>>
>>> Are unbalanced braces acceptable or must they be balanced?  Is this 
>>> acceptable:
>>> if ()
>>>   one;
>>> else {
>>>   two;
>>>   three;
>>> }
>>
>> Yes, it is. But I don't see how the question relates to my comment.
>> All that needs to go in the else's body is the hwp_verbose().
> 
> 'val' shouldn't be used to set features when the rdmsr fails, so the
> following code needs to be within the else.  Unless you want to rely
> on a failed rdmsr returning 0.

It is intentional for rdmsr_safe() to return a zero value when the
access faulted, so I certainly think you may rely on this.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.