From: Jan Beulich <jbeulich@suse.com>
To: Jason Andryuk <jandryuk@gmail.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"George Dunlap" <george.dunlap@citrix.com>,
"Ian Jackson" <iwj@xenproject.org>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 04/13] cpufreq: Add Hardware P-State (HWP) driver
Date: Fri, 4 Jun 2021 08:39:12 +0200 [thread overview]
Message-ID: <2d88b1db-3064-63e1-e197-9318624e6cc6@suse.com> (raw)
In-Reply-To: <CAKf6xpvCkzHOZsBY2yMQSVxq844_muaAaKd-JZUQfd7UCrXLVg@mail.gmail.com>
On 03.06.2021 13:55, Jason Andryuk wrote:
> On Fri, May 28, 2021 at 2:35 AM Jan Beulich <jbeulich@suse.com> wrote:
>> On 27.05.2021 20:50, Jason Andryuk wrote:
>>> On Wed, May 26, 2021 at 11:00 AM Jan Beulich <jbeulich@suse.com> 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
next prev parent reply other threads:[~2021-06-04 6:39 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-03 19:27 [PATCH 00/13] Intel Hardware P-States (HWP) support Jason Andryuk
2021-05-03 19:27 ` [PATCH 01/13] cpufreq: Allow restricting to internal governors only Jason Andryuk
2021-05-26 13:18 ` Jan Beulich
2021-05-26 14:12 ` Jason Andryuk
2021-05-26 15:09 ` Jan Beulich
2021-05-26 16:44 ` Jason Andryuk
2021-05-03 19:27 ` [PATCH 02/13] cpufreq: Add perf_freq to cpuinfo Jason Andryuk
2021-05-26 13:24 ` Jan Beulich
2021-05-26 14:19 ` Jason Andryuk
2021-05-03 19:28 ` [PATCH 03/13] cpufreq: Export intel_feature_detect Jason Andryuk
2021-05-26 13:27 ` Jan Beulich
2021-05-26 14:44 ` Jason Andryuk
2021-05-26 15:11 ` Jan Beulich
2021-05-03 19:28 ` [PATCH 04/13] cpufreq: Add Hardware P-State (HWP) driver Jason Andryuk
2021-05-26 14:59 ` Jan Beulich
2021-05-27 7:23 ` Jan Beulich
2021-05-27 18:50 ` Jason Andryuk
2021-05-28 6:35 ` Jan Beulich
2021-06-03 11:55 ` Jason Andryuk
2021-06-04 6:39 ` Jan Beulich [this message]
2021-05-27 7:45 ` Jan Beulich
2021-05-03 19:28 ` [PATCH 05/13] xenpm: Change get-cpufreq-para output for internal Jason Andryuk
2021-05-26 15:21 ` Jan Beulich
2021-05-27 5:54 ` Jan Beulich
2021-05-03 19:28 ` [PATCH 06/13] cpufreq: Export HWP parameters to userspace Jason Andryuk
2021-05-27 7:55 ` Jan Beulich
2021-05-28 13:19 ` Jason Andryuk
2021-05-28 13:39 ` Jan Beulich
2021-05-03 19:28 ` [PATCH 07/13] libxc: Include hwp_para in definitions Jason Andryuk
2021-05-03 19:28 ` [PATCH 08/13] xenpm: Print HWP parameters Jason Andryuk
2021-05-27 8:02 ` Jan Beulich
2021-05-03 19:28 ` [PATCH 09/13] xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op Jason Andryuk
2021-05-27 8:33 ` Jan Beulich
2021-05-03 19:28 ` [PATCH 10/13] libxc: Add xc_set_cpufreq_hwp Jason Andryuk
2021-05-04 8:03 ` Jan Beulich
2021-05-04 11:31 ` Jason Andryuk
2021-05-27 9:45 ` Jan Beulich
2021-05-03 19:28 ` [PATCH 11/13] xenpm: Factor out a non-fatal cpuid_parse variant Jason Andryuk
2021-05-27 8:41 ` Jan Beulich
2021-05-03 19:28 ` [PATCH 12/13] xenpm: Add set-cpufreq-hwp subcommand Jason Andryuk
2021-05-27 9:46 ` Jan Beulich
2021-05-03 19:28 ` [PATCH 13/13] CHANGELOG: Add Intel HWP entry Jason Andryuk
2021-05-27 9:48 ` Jan Beulich
2021-05-20 14:57 ` [PATCH 00/13] Intel Hardware P-States (HWP) support Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2d88b1db-3064-63e1-e197-9318624e6cc6@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=iwj@xenproject.org \
--cc=jandryuk@gmail.com \
--cc=julien@xen.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).