[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/cpufreq: allocate processor_pminfo[] dynamically
- To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Fri, 6 Nov 2026 18:44:29 -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=dP6Q/DdJ5V7jPEDdOWQPXjI4nlC2dexIFtt3GQhAaPc=; b=wMy2Nm2f7nlXv7IQC04cBECWrfDnvhUOQsBszJ1jH5VHRq99QZrTTEVJsfqFpyIK4+xwekL6HEox1jVZ8QuyDqHAYv+iNNxKfnzs5slWVSFXAwb5QQwMLUFOw1wPe40S1R+zOw8uTdYzB1mMrG9klV/Z+bPAL2bkpe8Ldu6WOyIiN1++s24yXOvFjB3VeFCftRTKYK3mEO+3kYqG/MD2BDVdst8mkjdRUJ1ntXkT5jRhFJmXj9i0StGY84zrZdYZP1Hb71SlLoGT47B9i91in93Ybz3dJZ0DaaxFEdPCkzIgfKyKS1/dzjh4ASKaN0OA/gzbNxxqEb9asv0ZoxBQwA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pA6lnio+yp2XDRhpMrxACnFGpBR6RfsWvqWx8RaoxpAXFD+PZReyRlQhjZC0VFovhLWIJn6fjbGx23LdHgl9yZclJguf7+kSOPqZ8DNYxQMLiwxP59Lu4lQMh7AH95S4HFpWWWmUr6m+J/F5rZvJWi+e8mNvsFtpE7JnPT2CtjExDr7EFiZLjMhxSUjMcvbfONeaxOH8WVbav9ggPoVkHxPsVcMAXHTXICG9h+LW7+38/h6nnvzcb1nzb6+hZ3oHdS7Q2NUcXjPNMsaFDj9hlk8hussnPe5yG86RlxlfA6INajr+d5iIk5FjDw4Btf1H818sLLe/lN7MwPhVMboaHg==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
- Delivery-date: Fri, 06 Nov 2026 23:44:43 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2026-11-03 07:53, Jan Beulich wrote:
There's no need to have a NR_CPUS-dimensioned static array there.
As ordering of pre-SMP initcalls isn't well-defined, allocate the array
from both cpufreq_presmp_init() and cpufreq_register_driver().
Alongside adding a few NULL checks, drop a redundant one from
get_cpufreq_para().
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- a/xen/drivers/acpi/pm-op.c
+++ b/xen/drivers/acpi/pm-op.c
@@ -104,8 +104,7 @@ static int get_cpufreq_para(struct xen_s
pmpt = processor_pminfo[op->cpuid];
policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
- if ( !pmpt ||
- ((pmpt->init & XEN_PX_INIT) && !pmpt->perf.states) ||
+ if ( ((pmpt->init & XEN_PX_INIT) && !pmpt->perf.states) ||
It's redundant today, but that depends on the other check. Though maybe
get_cpufreq_para could take pmpt as an argument?
Anyway:
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Regards,
Jason
|