[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/4] xen/cppc: introduce cppc data upload sub-hypercall
- To: Penny Zheng <Penny.Zheng@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Wed, 11 Dec 2024 15:55:05 -0500
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZAv7KRx89DhcXcVv6bLoGdu/cM2Loc4RW/Vc9i+/tv4=; b=GZ1gC+7CIT30IlszSYdJgeYj+HbKVGlZWjjD5PKDlC9hQeCUEIn9urTrRBPXvjBtWphBRswn8bPPymf8jmn8CQPs67T5DxaFMWXwPQJfqmWqMeDzxrNQuJRQcR9YY5wz9uQe2BzpiZIXmcq1KkUp9xqHX2zF/7lpxDkwn/YlfDgR0XDlZeRUCPgkXfBCxuc0TBpA3Q5qWUQGFzPAZwPd2Dqmfokc+pW7owGYzf10GCDSib43819bsfkFejnwlUnveSaObK3PyqPnsacHDJS7qxVOGiE7hHCAmxYaQx7kRs+a3BCqRRCZhLByv+Q7LJIQqLDDsVPXu5NKlmpDZO/gIA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Y/EepAqvEW71O5iWgLvLMpaTjsyYh0z6kK2odW35Rgy1MENRjduOCZfTLrzeRKN0XK1+nxyo5NzMYs4o72gA1V2K4NopSIEFZPzhpyx3HszVexJ2TmfizUTRHgDFfABpxF/TRBJ5BQbqCVaydlCecJdjR4M/zMjdd5EQAEoed4XGLfW7sXsfj5uMYD7rOQ2zutzn0Ps/81Ix4UCpR1QN46BLghjebL20GKZ0+kGTzVVOezz8YC9gcIHtA9KkCSvIzA1BHrv/YunWEZDmiYJN8S4quNk+uDky5kJ0mMKgIXHe+RNc2ChzH1Rd9HyhA2uhwn++Wj7h7Ec+steoC40tOg==
- Cc: Ray Huang <Ray.Huang@xxxxxxx>, Xenia Ragiadakou <Xenia.Ragiadakou@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>
- Delivery-date: Wed, 11 Dec 2024 20:55:31 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2024-12-05 00:42, Penny Zheng wrote:
As Xen is uncapable of parsing the ACPI dynamic table, this commit
introduces a new sub-hypercall XEN_PM_CPPC to deliver CPPC perf
caps data.
Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
@@ -208,6 +213,44 @@ static int xen_copy_pct_data(struct acpi_pct_register *pct,
dst_pct->address = pct->address;
return 0;
}
+static int push_cppc_to_hypervisor(struct acpi_processor *_pr)
+{
+ int ret = 0;
+ struct xen_platform_op op = {
+ .cmd = XENPF_set_processor_pminfo,
+ .interface_version = XENPF_INTERFACE_VERSION,
+ .u.set_pminfo.id = _pr->acpi_id,
+ .u.set_pminfo.type = XEN_PM_CPPC,
+ };
+ struct cppc_perf_caps *cppc_perf = acpi_cppc_data + _pr->acpi_id;
+
+ op.u.set_pminfo.cppc_data.highest_perf = cppc_perf->highest_perf;
+ op.u.set_pminfo.cppc_data.lowest_perf = cppc_perf->lowest_perf;
+ op.u.set_pminfo.cppc_data.nominal_perf = cppc_perf->nominal_perf;
+ op.u.set_pminfo.cppc_data.lowest_nonlinear_perf =
cppc_perf->lowest_nonlinear_perf;
+ op.u.set_pminfo.cppc_data.lowest_freq = cppc_perf->lowest_freq;
+ op.u.set_pminfo.cppc_data.nominal_freq = cppc_perf->nominal_freq;
+
+ if (!no_hypercall)
+ ret = HYPERVISOR_platform_op(&op);
+
+ if (!ret) {
+ pr_debug("ACPI CPU%u - CPPC uploaded.\n", _pr->acpi_id);
+ pr_debug(" highest_perf: %d\n", cppc_perf->highest_perf);
+ pr_debug(" lowest_perf: %d\n", cppc_perf->lowest_perf);
+ pr_debug(" lowest_nonlinear_perf: %d\n",
cppc_perf->lowest_nonlinear_perf);
+ pr_debug(" nominal_perf: %d\n", cppc_perf->nominal_perf);
+ pr_debug(" lowest_freq: %d Mhz\n", cppc_perf->lowest_freq);
+ pr_debug(" nominal_freq: %d Mhz\n",
cppc_perf->nominal_freq);
+ } else if ((ret != -EINVAL) && (ret != -ENOSYS))
+ /* EINVAL means the ACPI ID is incorrect - meaning the ACPI
+ * table is referencing a non-existing CPU - which can happen
+ * with broken ACPI tables. */
+ pr_warn("(_CPC): Hypervisor error (%d) for ACPI CPU%u\n",
+ ret, _pr->acpi_id);
+
+ return ret;
I just saw gcc warn about misleading indent here given the lack of { }
on else if above. I think you just want a single tab indent for return.
Regards,
Jason
+}
static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
{
int ret = 0;
|