From: Perry Yuan <perry.yuan@amd.com>
To: <rafael.j.wysocki@intel.com>, <Mario.Limonciello@amd.com>,
<Borislav.Petkov@amd.com>, <viresh.kumar@linaro.org>,
<Ray.Huang@amd.com>, <gautham.shenoy@amd.com>
Cc: <Alexander.Deucher@amd.com>, <Xinmei.Huang@amd.com>,
<Xiaojian.Du@amd.com>, <Li.Meng@amd.com>,
<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH Resend 6/8] tools/power x86_energy_perf_policy: remove the invalid feature options for AMD processors
Date: Tue, 30 Jan 2024 13:56:30 +0800 [thread overview]
Message-ID: <bc53456d6748a7fcb6a0c3ea3f136873fbf1d646.1706592301.git.perry.yuan@amd.com> (raw)
In-Reply-To: <cover.1706592301.git.perry.yuan@amd.com>
EPB feature is not supported by AMD CPU, remove the unsupported options
to advoid confusion for the failure result when using the parameters.
Here is the new help output with below command.
$ sudo ./x86_energy_perf_policy -h
./x86_energy_perf_policy [options] [scope][field value]
scope: --cpu cpu-list [--hwp-use-pkg #] | --pkg pkg-list
field: --all | --hwp-epp | --hwp-min | --hwp-max | --hwp-desired
other: --hwp-enable | --turbo-enable (0 | 1) | --help | --force
value: ( # | "normal" | "performance" | "balance-performance" |
"balance-power"| "power")
--hwp-window usec
./x86_energy_perf_policy: [-c cpu] [-v] (-r | policy-value )
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
---
.../x86_energy_perf_policy.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
index 7bc668d22728..ada1aaabad8c 100644
--- a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
+++ b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
@@ -105,13 +105,18 @@ void usage(void)
{
fprintf(stderr, "%s [options] [scope][field value]\n", progname);
fprintf(stderr, "scope: --cpu cpu-list [--hwp-use-pkg #] | --pkg pkg-list\n");
- fprintf(stderr, "field: --all | --epb | --hwp-epp | --hwp-min | --hwp-max | --hwp-desired\n");
+
+ if (genuine_intel)
+ fprintf(stderr, "field: --all | --epb | --hwp-epp | --hwp-min | --hwp-max | --hwp-desired\n");
+ else if (authentic_amd)
+ fprintf(stderr, "field: --all | --hwp-epp | --hwp-min | --hwp-max | --hwp-desired\n");
+
fprintf(stderr, "other: --hwp-enable | --turbo-enable (0 | 1) | --help | --force\n");
fprintf(stderr,
"value: ( # | \"normal\" | \"performance\" | \"balance-performance\" | \"balance-power\"| \"power\")\n");
fprintf(stderr, "--hwp-window usec\n");
-
- fprintf(stderr, "Specify only Energy Performance BIAS (legacy usage):\n");
+ if (genuine_intel)
+ fprintf(stderr, "Specify only Energy Performance BIAS (legacy usage):\n");
fprintf(stderr, "%s: [-c cpu] [-v] (-r | policy-value )\n", progname);
exit(1);
@@ -1309,7 +1314,7 @@ int update_cpu_msrs(int cpu)
unsigned long long msr;
int epb;
- if (update_epb) {
+ if (update_epb && genuine_intel) {
epb = get_epb(cpu);
set_epb(cpu, new_epb);
@@ -1318,7 +1323,7 @@ int update_cpu_msrs(int cpu)
cpu, epb, (unsigned int) new_epb);
}
- if (update_turbo) {
+ if (update_turbo && genuine_intel) {
int turbo_is_present_and_disabled;
intel_get_msr(cpu, MSR_IA32_MISC_ENABLE, &msr);
--
2.34.1
next prev parent reply other threads:[~2024-01-30 5:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 5:56 [PATCH Resend 0/8] enable x86_energy_perf_policy for AMD CPU Perry Yuan
2024-01-30 5:56 ` [PATCH Resend 1/8] tools/power x86_energy_perf_policy: add info show support for AMD Pstate EPP driver Perry Yuan
2024-01-30 20:04 ` Mario Limonciello
2024-01-30 5:56 ` [PATCH Resend 2/8] tools/power x86_energy_perf_policy: enable AMD pstate EPP profile switching on MSR based system Perry Yuan
2024-01-30 20:01 ` Mario Limonciello
2024-01-30 5:56 ` [PATCH Resend 3/8] tools/power x86_energy_perf_policy: rename get_msr() and put_msr() with intel prefix Perry Yuan
2024-01-30 19:57 ` Mario Limonciello
2024-01-30 5:56 ` [PATCH Resend 4/8] tools/power x86_energy_perf_policy: rename get_cpuid_or_exit() " Perry Yuan
2024-01-30 19:56 ` Mario Limonciello
2024-01-30 5:56 ` [PATCH Resend 5/8] tools/power x86_energy_perf_policy: add nominal and lowest nonlinear perf values showing support Perry Yuan
2024-01-30 19:56 ` Mario Limonciello
2024-01-30 5:56 ` Perry Yuan [this message]
2024-01-30 19:54 ` [PATCH Resend 6/8] tools/power x86_energy_perf_policy: remove the invalid feature options for AMD processors Mario Limonciello
2024-01-30 5:56 ` [PATCH Resend 7/8] tools/power x86_energy_perf_policy: rename some perf output strings " Perry Yuan
2024-01-30 19:54 ` Mario Limonciello
2024-01-30 5:56 ` [PATCH Resend 8/8] tools/power x86_energy_perf_policy: change intel msr functions to be static Perry Yuan
2024-01-30 19:55 ` Mario Limonciello
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=bc53456d6748a7fcb6a0c3ea3f136873fbf1d646.1706592301.git.perry.yuan@amd.com \
--to=perry.yuan@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Borislav.Petkov@amd.com \
--cc=Li.Meng@amd.com \
--cc=Mario.Limonciello@amd.com \
--cc=Ray.Huang@amd.com \
--cc=Xiaojian.Du@amd.com \
--cc=Xinmei.Huang@amd.com \
--cc=gautham.shenoy@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=viresh.kumar@linaro.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
all inboxes | Powered by JetHome®