lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220414164801.1051-6-mario.limonciello@amd.com>
Date:   Thu, 14 Apr 2022 11:48:00 -0500
From:   Mario Limonciello <mario.limonciello@....com>
To:     Rui Huang <ray.huang@....com>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Viresh Kumar <viresh.kumar@...aro.org>
CC:     "open list:AMD PSTATE DRIVER" <linux-pm@...r.kernel.org>,
        Perry Yuan <Perry.Yuan@....com>,
        open list <linux-kernel@...r.kernel.org>,
        "Mario Limonciello" <mario.limonciello@....com>
Subject: [PATCH v3 5/6] cpufreq: amd-pstate: Add a module device table

`amd-pstate` currently only loads automatically if compiled into the
kernel.  To improve the usability, add a module device table that
will load when AMD CPUs that support CPPC are detected.

Reviewed-by: Huang Rui <ray.huang@....com>
Signed-off-by: Mario Limonciello <mario.limonciello@....com>
---
v2->v3:
 * Add Ray's tag
v1->v2:
 * Add comment to indicate need of SBIOS support.

 drivers/cpufreq/amd-pstate.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 8ae65a2072d6..3330504b7070 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -710,6 +710,17 @@ static void __exit amd_pstate_exit(void)
 	amd_pstate_enable(false);
 }
 
+/*
+ * This will only match the HW feature, there still needs to be appropriate
+ * SBIOS support, so it's possible that in such cases this causes a module
+ * load with -ENODEV as the result.
+ */
+static const struct x86_cpu_id __maybe_unused amd_pstate_ids[] = {
+	X86_MATCH_VENDOR_FEATURE(AMD, X86_FEATURE_CPPC, NULL),
+	{}
+};
+MODULE_DEVICE_TABLE(x86cpu, amd_pstate_ids);
+
 module_init(amd_pstate_init);
 module_exit(amd_pstate_exit);
 
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ