[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5f4b6e0e-cbeb-460e-ae03-34c678866c85@kernel.org>
Date: Fri, 21 Feb 2025 22:17:13 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Arnd Bergmann <arnd@...nel.org>, Jon Mason <jdmason@...zu.us>,
Dave Jiang <dave.jiang@...el.com>, Allen Hubbe <allenbh@...il.com>
Cc: Arnd Bergmann <arnd@...db.de>, kernel test robot <lkp@...el.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
zhang jiao <zhangjiao2@...s.chinamobile.com>,
Philipp Stanner <pstanner@...hat.com>, ntb@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ntb: reduce stack usage in idt_scan_mws
On 2/21/25 17:57, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> idt_scan_mws() puts a large fixed-size array on the stack and copies
> it into a smaller dynamically allocated array at the end. On 32-bit
> targets, the fixed size can easily exceed the warning limit for
> possible stack overflow:
>
> drivers/ntb/hw/idt/ntb_hw_idt.c:1041:27: error: stack frame size (1032) exceeds limit (1024) in 'idt_scan_mws' [-Werror,-Wframe-larger-than]
>
> Change it to instead just always use dynamic allocation for the
> array from the start. It's too big for the stack, but not actually
> all that much for a permanent allocation.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/all/202205111109.PiKTruEj-lkp@intel.com/
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
Looks good to me.
Reviewed-by: Damien Le Moal <dlemoal@...nel.org>
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists