Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp451752rdb; Thu, 19 Oct 2023 08:57:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0F6CWXRblCFiVJhEpPbfD6Cp5zYPNg+OF0wuec/Fkd6zaoUFKZ1eJt3YGW5lrDESXBeYT X-Received: by 2002:a05:6a20:9184:b0:17b:77d3:207c with SMTP id v4-20020a056a20918400b0017b77d3207cmr2894510pzd.17.1697731053323; Thu, 19 Oct 2023 08:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697731053; cv=none; d=google.com; s=arc-20160816; b=mP4Pij1+QgOTjPOK7AlAlwSCWy1sw/EeoiVGSqf2fDgp3oumyhGbiUO8olP/jplUz7 WPu5c4TpNv3O6T6kosqUdonwIH4fAdHAImpjaKjL4/X1+OO1XT+DvEl6XSrey4KBSMAT ONMwh4GnruAI2b67ef0X+bcWqYswLO9DjosfzLD+7QxvlEVhuKQR0l2kk14MVBRUFP/M dne06SxdFzLZnsY3a/JKjTOKcXnuScxph+uIZbXaMfWxQXIjjkXH9qjs1Ju2WYTZtAUM vpUJU3KG6m2TmiNCxH7iBt/zjWCz8tRwZoeyvuvo1K4uUIaeX7cGyQrbV9HdJJ0j6LWT wScw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=frEz1n++2YxbRSi9ZSQyCnxD5FcnRpSkgnsDtb+QUWs=; fh=C4vNCE5m6eP9shijWy4llmpXn4+x9muPfps/vklRqik=; b=zTmtridjArUjIJHIVqS5JqIZdj7eIg7p5HRaQzhhabrn5QqusB9YN1Rm44MuErCqky 1SYqvGQqvBPdRXgJxrl1d/+n4f4QkhEyKJbbSJByG0AmDex8cBcKWVFAkdDHRl/qwTOC GgAhDkzmlrE/hK6k3QI0DgR7PdP67/Wv/IjI5DkQeO1gZzheYLs63w6oi+HyX+7chp/u /6fHimZpsqNnlO1q4K4naEpmfMUgQBE80hacLLK9fvCnTM2BKhZaNAOH31iwwFOSlAJS nblpNcKed2wvfvm6hrBUa5joZvnWbAeRRecRMwduun7kmOCayIYTJPcbSYbi73X4L45x zETA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RDaKFfQE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id ck28-20020a056a02091c00b005aa833a5337si4800953pgb.600.2023.10.19.08.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 08:57:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RDaKFfQE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C451B8087CA3; Thu, 19 Oct 2023 08:56:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346384AbjJSP4J (ORCPT + 99 others); Thu, 19 Oct 2023 11:56:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235441AbjJSP4G (ORCPT ); Thu, 19 Oct 2023 11:56:06 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DB3A106; Thu, 19 Oct 2023 08:56:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32F47C433CA; Thu, 19 Oct 2023 15:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697730963; bh=UdTLJEWjQLLbDTfkJJrqOSkrPFt3tUV8K30G7Qw7fHE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RDaKFfQEqVlYYZxhyDmpBy3qGGGZtmxpAdGXPA/9qSuTBgNgPzDJz/QMIb47NzO6n meCy2xfdT29X7i5Ns9X6gThQnxZzRu0K+bFldhIbskVNg2R+0o82hu56yrxI9vSB94 t1PEK0SOSnDiiS33daoKearQ1I3JajQaip6qgE4pLq06pj551afIUREXxwpz4oPKt4 S8hvWeVcGRjK6JUQl1mKU3nGaIfMFZw2nmv0meXLoHr+NlWtk0Odjv8QyepSGe7rGj ISgesdES0lJxpCRT5qmji/cU3XaAzrOC4QN3Eg1nRmUKWJ6cT1RhfvPsClBlCkMZgg gBNMao2FqR7FQ== Date: Thu, 19 Oct 2023 08:56:00 -0700 From: Nathan Chancellor To: Arnd Bergmann Cc: Alexander Potapenko , Geert Uytterhoeven , Hamza Mahfooz , linux-kernel@vger.kernel.org, Rodrigo Siqueira , Harry Wentland , Alex Deucher , stable@vger.kernel.org, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Nick Terrell , Nick Desaulniers , Tom Rix , Andrew Morton , Masami Hiramatsu , Randy Dunlap , Kees Cook , Zhaoyang Huang , Li Hua , Rae Moar , rust-for-linux@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] lib/Kconfig.debug: disable FRAME_WARN for kasan and kcsan Message-ID: <20231019155600.GB60597@dev-arch.thelio-3990X> References: <20231018182412.80291-1-hamza.mahfooz@amd.com> <22580470-7def-4723-b836-1688db6da038@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22580470-7def-4723-b836-1688db6da038@app.fastmail.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 19 Oct 2023 08:56:25 -0700 (PDT) On Thu, Oct 19, 2023 at 02:53:01PM +0200, Arnd Bergmann wrote: > On Thu, Oct 19, 2023, at 12:04, Alexander Potapenko wrote: > > So the remaining option would be to just increase the frame size every > > time a new function surpasses the limit. > > That is clearly not an option, though we could try to > add Kconfig dependencies that avoid the known bad combinations, > such as annotating the AMD GPU driver as > > depends on (CC_IS_GCC || CLANG_VERSION >=180000) || !(KASAN || KCSAN) This would effectively disable the AMDGPU driver for allmodconfig, which is somewhat unfortunate as it is an easy testing target. Taking a step back, this is all being done because of a couple of warnings in the AMDGPU code. If fixing those in the source is too much effort (I did note [1] that GCC is at the current limit for that file even with Rodrigo's series applied [2]), couldn't we just take the existing workaround that this Makefile has for this file and its high stack usage and just extend it slightly for clang? diff --git a/drivers/gpu/drm/amd/display/dc/dml2/Makefile b/drivers/gpu/drm/amd/display/dc/dml2/Makefile index 66431525f2a0..fd49e3526c0d 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dml2/Makefile @@ -58,7 +58,7 @@ endif endif ifneq ($(CONFIG_FRAME_WARN),0) -frame_warn_flag := -Wframe-larger-than=2048 +frame_warn_flag := -Wframe-larger-than=$(if $(CONFIG_CC_IS_CLANG),3072,2048) endif CFLAGS_$(AMDDALPATH)/dc/dml2/display_mode_core.o := $(dml2_ccflags) $(frame_warn_flag) That would address the immediate concern of the warning breaking builds with CONFIG_WERROR=y while not raising the limit for other files in the kernel (just this one file in AMDGPU) and avoiding disabling the whole driver. The number could be lower, I think ~2500 bytes is the most usage I see with Rodrigo's series applied, so maybe 2800 would be a decent limit? Once there is a fix in the compiler, this expression could be changed to use clang-min-version or something of that sort. [1]: https://lore.kernel.org/20231017172231.GA2348194@dev-arch.thelio-3990X/ [2]: https://lore.kernel.org/20231016142031.241912-1-Rodrigo.Siqueira@amd.com/ Cheers, Nathan