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: <20240420082345.GD614130@ravnborg.org>
Date: Sat, 20 Apr 2024 10:23:45 +0200
From: Sam Ravnborg <sam@...nborg.org>
To: Dawei Li <dawei.li@...ngroup.cn>
Cc: davem@...emloft.net, andreas@...sler.com, sparclinux@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/7] sparc/pci_msi: Remove on-stack cpumask var

On Sat, Apr 20, 2024 at 01:15:44PM +0800, Dawei Li wrote:
> In general it's preferable to avoid placing cpumasks on the stack, as
> for large values of NR_CPUS these can consume significant amounts of
> stack space and make stack overflows more likely.
> 
> @cpumask of irq_set_affinity() is read-only and free of change, drop
> unneeded cpumask var.
> 
> Signed-off-by: Dawei Li <dawei.li@...ngroup.cn>
Reviewed-by: Sam Ravnborg <sam@...nborg.org>
> ---
>  arch/sparc/kernel/pci_msi.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/arch/sparc/kernel/pci_msi.c b/arch/sparc/kernel/pci_msi.c
> index fc7402948b7b..acb2f83a1d5c 100644
> --- a/arch/sparc/kernel/pci_msi.c
> +++ b/arch/sparc/kernel/pci_msi.c
> @@ -287,10 +287,7 @@ static int bringup_one_msi_queue(struct pci_pbm_info *pbm,
>  
>  	nid = pbm->numa_node;
>  	if (nid != -1) {
> -		cpumask_t numa_mask;
> -
> -		cpumask_copy(&numa_mask, cpumask_of_node(nid));
> -		irq_set_affinity(irq, &numa_mask);
> +		irq_set_affinity(irq, cpumask_of_node(nid));
>  	}
>  	err = request_irq(irq, sparc64_msiq_interrupt, 0,
>  			  "MSIQ",
> -- 
> 2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ