From: Damien Le Moal <dlemoal@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>, Jon Mason <jdmason@kudzu.us>,
Dave Jiang <dave.jiang@intel.com>,
Allen Hubbe <allenbh@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>, kernel test robot <lkp@intel.com>,
Bjorn Helgaas <bhelgaas@google.com>,
zhang jiao <zhangjiao2@cmss.chinamobile.com>,
Philipp Stanner <pstanner@redhat.com>,
ntb@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ntb: reduce stack usage in idt_scan_mws
Date: Fri, 21 Feb 2025 22:17:13 +0900 [thread overview]
Message-ID: <5f4b6e0e-cbeb-460e-ae03-34c678866c85@kernel.org> (raw)
In-Reply-To: <20250221085748.2298463-1-arnd@kernel.org>
On 2/21/25 17:57, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.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@intel.com>
> Closes: https://lore.kernel.org/all/202205111109.PiKTruEj-lkp@intel.com/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Looks good to me.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2025-02-21 13:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-21 8:57 [PATCH] ntb: reduce stack usage in idt_scan_mws Arnd Bergmann
2025-02-21 13:17 ` Damien Le Moal [this message]
2025-02-21 15:47 ` Dave Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f4b6e0e-cbeb-460e-ae03-34c678866c85@kernel.org \
--to=dlemoal@kernel.org \
--cc=allenbh@gmail.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bhelgaas@google.com \
--cc=dave.jiang@intel.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=ntb@lists.linux.dev \
--cc=pstanner@redhat.com \
--cc=zhangjiao2@cmss.chinamobile.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox