Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: flyingpenghao@gmail.com
Cc: gg@ziepe.ca, nathan@kernel.org, linux-rdma@vger.kernel.org,
	Peng Hao <flyingpeng@tencent.com>
Subject: Re: [PATCH]   infiniband/hw/ocrdma: increase frame warning limit in verifier when using KASAN or KCSAN
Date: Tue, 9 Jul 2024 15:27:37 +0300	[thread overview]
Message-ID: <20240709122737.GD6668@unreal> (raw)
In-Reply-To: <20240709105242.63299-1-flyingpeng@tencent.com>

On Tue, Jul 09, 2024 at 06:52:42PM +0800, flyingpenghao@gmail.com wrote:
> From: Peng Hao <flyingpeng@tencent.com>
> 
> When building kernel with clang, which will typically
> have sanitizers enabled, there is a warning about a large stack frame.
> 
> drivers/infiniband/hw/ocrdma/ocrdma_stats.c:686:16: error: stack frame size (20664) exceeds limit (8192) in 'ocrdma_dbgfs_ops_read' [-Werror,-Wframe-larger-than]
> static ssize_t ocrdma_dbgfs_ops_read(struct file *filp, char __user *buffer,
>                ^

Please fix it, not hide it.

Thanks

> 
> Increase the frame size by 20% to set.
> 
> Signed-off-by: Peng Hao <flyingpeng@tencent.com>
> ---
>  drivers/infiniband/hw/ocrdma/Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/infiniband/hw/ocrdma/Makefile b/drivers/infiniband/hw/ocrdma/Makefile
> index 14fba95021d8..a1e9fcc04751 100644
> --- a/drivers/infiniband/hw/ocrdma/Makefile
> +++ b/drivers/infiniband/hw/ocrdma/Makefile
> @@ -3,4 +3,10 @@ ccflags-y := -I $(srctree)/drivers/net/ethernet/emulex/benet
>  
>  obj-$(CONFIG_INFINIBAND_OCRDMA)	+= ocrdma.o
>  
> +ifneq ($(CONFIG_FRAME_WARN),0)
> +ifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y)
> +CFLAGS_ocrdma_stats.o = -Wframe-larger-than=22664
> +endif
> +endif
> +
>  ocrdma-y :=	ocrdma_main.o ocrdma_verbs.o ocrdma_hw.o ocrdma_ah.o ocrdma_stats.o
> -- 
> 2.27.0
> 
> 

  reply	other threads:[~2024-07-09 12:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-09 10:52 [PATCH] infiniband/hw/ocrdma: increase frame warning limit in verifier when using KASAN or KCSAN flyingpenghao
2024-07-09 12:27 ` Leon Romanovsky [this message]
2024-07-09 21:26   ` Nathan Chancellor
2024-07-10  6:02     ` Leon Romanovsky
2024-07-10 13:46       ` Hao Peng
2024-07-10 15:24         ` Nathan Chancellor

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=20240709122737.GD6668@unreal \
    --to=leon@kernel.org \
    --cc=flyingpeng@tencent.com \
    --cc=flyingpenghao@gmail.com \
    --cc=gg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    --cc=nathan@kernel.org \
    /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