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: <b35783d1-c676-4c66-8a50-627883ff2c3b@kernel.org>
Date: Mon, 13 Oct 2025 13:52:48 -0500
From: Mario Limonciello <superm1@...nel.org>
To: Kuan-Wei Chiu <visitorckw@...il.com>
Cc: perry.yuan@....com, hansg@...nel.org, ilpo.jarvinen@...ux.intel.com,
 jserv@...s.ncku.edu.tw, platform-driver-x86@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] platform/x86/amd: hfi: Remove unused cpumask from
 cpuinfo struct

On 10/11/25 1:38 AM, Kuan-Wei Chiu wrote:
> The cpus field within the struct amd_hfi_cpuinfo was allocated and set
> in the amd_hfi_online() CPU hotplug callback, and subsequently freed in
> the amd_hfi_offline() callback.
> 
> However, after being initialized, this cpumask was never read or used
> for any purpose within the driver. It represents dead code that serves
> no functional role.
> 
> This change has no impact on the driver's functionality as the removed
> code was entirely superfluous.
> 
> Signed-off-by: Kuan-Wei Chiu <visitorckw@...il.com>
> ---
> Build test only.

Thanks, this LGTM.  There is other code that was going to use these, but 
it's not upstream ready still.  If we end up using them we can bring 'em 
back later.

Reviewed-by: Mario Limonciello (AMD) <superm1@...nel.org>

> 
>   drivers/platform/x86/amd/hfi/hfi.c | 10 ----------
>   1 file changed, 10 deletions(-)
> 
> diff --git a/drivers/platform/x86/amd/hfi/hfi.c b/drivers/platform/x86/amd/hfi/hfi.c
> index a465ac6f607e..5d5d2cf23a75 100644
> --- a/drivers/platform/x86/amd/hfi/hfi.c
> +++ b/drivers/platform/x86/amd/hfi/hfi.c
> @@ -12,7 +12,6 @@
>   
>   #include <linux/acpi.h>
>   #include <linux/cpu.h>
> -#include <linux/cpumask.h>
>   #include <linux/debugfs.h>
>   #include <linux/gfp.h>
>   #include <linux/init.h>
> @@ -95,7 +94,6 @@ struct amd_hfi_classes {
>    * struct amd_hfi_cpuinfo - HFI workload class info per CPU
>    * @cpu:		CPU index
>    * @apic_id:		APIC id of the current CPU
> - * @cpus:		mask of CPUs associated with amd_hfi_cpuinfo
>    * @class_index:	workload class ID index
>    * @nr_class:		max number of workload class supported
>    * @ipcc_scores:	ipcc scores for each class
> @@ -106,7 +104,6 @@ struct amd_hfi_classes {
>   struct amd_hfi_cpuinfo {
>   	int		cpu;
>   	u32		apic_id;
> -	cpumask_var_t	cpus;
>   	s16		class_index;
>   	u8		nr_class;
>   	int		*ipcc_scores;
> @@ -295,11 +292,6 @@ static int amd_hfi_online(unsigned int cpu)
>   
>   	guard(mutex)(&hfi_cpuinfo_lock);
>   
> -	if (!zalloc_cpumask_var(&hfi_info->cpus, GFP_KERNEL))
> -		return -ENOMEM;
> -
> -	cpumask_set_cpu(cpu, hfi_info->cpus);
> -
>   	ret = amd_hfi_set_state(cpu, true);
>   	if (ret)
>   		pr_err("WCT enable failed for CPU %u\n", cpu);
> @@ -329,8 +321,6 @@ static int amd_hfi_offline(unsigned int cpu)
>   	if (ret)
>   		pr_err("WCT disable failed for CPU %u\n", cpu);
>   
> -	free_cpumask_var(hfi_info->cpus);
> -
>   	return ret;
>   }
>   


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ