Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1905921rwb; Fri, 5 Aug 2022 09:39:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR49gsRkAZmHD6XQJOVgB5Rv4NipVdLUhlWYL4VF78JHwxgVUC9bxxgf3GjYoTcc1oHxWhRO X-Received: by 2002:a63:8543:0:b0:41b:f0b2:ab0 with SMTP id u64-20020a638543000000b0041bf0b20ab0mr6358475pgd.248.1659717549024; Fri, 05 Aug 2022 09:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659717549; cv=none; d=google.com; s=arc-20160816; b=OrSBUiKdoWm2AsjHlKLHMm7pvodzszzu1BZLacUNFJMRR2oQkiimOsvcwlPGDOIpIJ vWlYmsMn9VfJ5fgMYTyYdOCpicZpLJ4U0YChTTWQgy1BqMKRqxQ1wYBxYm+2J/PTxOZs Xc25H3zKhXCyX+h0LzsgulzCv3LdCKS8Z/MjqXplodfCixT46LIQZLZWfkOH5OlPlIml n91U95McGmRrRrUjeqGGUnl78TsNFbipFsL64mFb/gN8umORS+pB4vGRy9k5sGlXxmkY VFo82qcoOG1TxCy+5yOJhzy0SeViXns49jWJ0hs+upciJKZg8euO7lHHtQhZi02jX75w 8rEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cTmkRgbK1iDjr3PMJHz1QEgmNYm9EHuzreIquzeMYuQ=; b=ygJgStCRDB3JPY27pbO9lE1xG+1U2R3yWRJjjdHLVXY2X9gH7x/BMQwbvNsIW0pSKU orVxiOjLnpfKX63ThTVGpFo60oBIyQN96tusQkLQYHA1ROwPTUojiKsZRdZbOREcWEY3 aUkSqAdRK/43zi2yhQi5f0LmWOkx15YRp79CVrNHk/h0km7uz7TLgP8vIMLXT39yhQeV OKzmFf0quDGXqZiA/+OKywCXSHrnVwH5Xq3dJXAhLGpobcfQ2RQXMUjhivIHi+3b9wh3 HDEgU/q24u9rdWU0K2pMwdQ2HbovasvIWgLCbjj2PbXwa5HoYpMN5lZAdTgCYBN14w/U c8BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S1Zay7+A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c186-20020a6335c3000000b003f5f3fc0d1fsi4016529pga.57.2022.08.05.09.38.53; Fri, 05 Aug 2022 09:39:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S1Zay7+A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240901AbiHEQRK (ORCPT + 99 others); Fri, 5 Aug 2022 12:17:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbiHEQRG (ORCPT ); Fri, 5 Aug 2022 12:17:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B482C1902B for ; Fri, 5 Aug 2022 09:17:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D66A161775 for ; Fri, 5 Aug 2022 16:17:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E3B0C433D7 for ; Fri, 5 Aug 2022 16:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659716223; bh=8grFLuwlQy0Ot8AOJ3yQKp3FjPtqCsWnDxEz8xLu22U=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=S1Zay7+AGgZcUCq7wrx5A/C0aep+dKgB5hcEjFtW4tftu/80/B6Q8OcvcwNhq+Otu o222N5h+m/UXeaeDBok542Ri8zeZAGBgaLJ+Y31oeXxv6WUrdkg5fE5gyoBtFjQtmk slz8VGRuiJsttzZCXh9Z0zJADXe35fRHrOy/k/qhXYgTTneYaN95kk+9Al5yDGJa6w 7yBzHnwUTcOdXpHxuzYOeTY70INSOjkjzzKg/g7OxKzY1RXLJ0KNZiLIBF+/1WJDjV Qyd4zMIPm7hw9L2O/QptByvsMheDELqbCm0et8wP2oNga9unCv5w1R9iOgczug9GBK SAZ8bzhOxoZvQ== Received: by mail-ej1-f47.google.com with SMTP id a7so5893936ejp.2 for ; Fri, 05 Aug 2022 09:17:03 -0700 (PDT) X-Gm-Message-State: ACgBeo1w1IHBk7kyavxtf1DkdsURl99cRPjCCMouqBaw/JNffI4Of2mi xq0ZgDBFID3rV3Y/uu+DYhEb2yZd5uMjd5/H32s= X-Received: by 2002:a17:907:28d6:b0:731:5d0:4401 with SMTP id en22-20020a17090728d600b0073105d04401mr1753624ejc.765.1659716221514; Fri, 05 Aug 2022 09:17:01 -0700 (PDT) MIME-Version: 1.0 References: <9fb73284-7572-5703-93d3-f83a43535baf@amd.com> In-Reply-To: <9fb73284-7572-5703-93d3-f83a43535baf@amd.com> From: Arnd Bergmann Date: Fri, 5 Aug 2022 18:16:45 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: mainline build failure for x86_64 allmodconfig with clang To: Harry Wentland Cc: Nathan Chancellor , "Siqueira, Rodrigo" , clang-built-linux , David Airlie , "Pan, Xinhui" , Linux Kernel Mailing List , amd-gfx list , =?UTF-8?Q?Christian_K=C3=B6nig?= , dri-devel , Alex Deucher , Linus Torvalds , "Sudip Mukherjee (Codethink)" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 5, 2022 at 5:32 PM Harry Wentland wrote: > > I do notice that these files build with a non-configurable > > -Wframe-large-than value: > > > > $ rg frame_warn_flag drivers/gpu/drm/amd/display/dc/dml/Makefile > > 54:frame_warn_flag := -Wframe-larger-than=2048 > > Tbh, I was looking at the history and I can't find a good reason this > was added. It should be safe to drop this. I would much rather use > the CONFIG_FRAME_WARN value than override it. > > AFAIK most builds use 2048 by default anyways. I'm fairly sure this was done for 32-bit builds, which default to a lower warning limit of 1024 bytes and would otherwise run into this problem when 64-bit platforms don't. With the default warning limit, clang warns even more about an i386 build: display/dc/dml/dcn20/display_rq_dlg_calc_20.c:1549:6: error: stack frame size (1324) exceeds limit (1024) in 'dml20_rq_dlg_get_dlg_reg' display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c:1550:6: error: stack frame size (1324) exceeds limit (1024) in 'dml20v2_rq_dlg_get_dlg_reg' display/dc/dml/dcn30/display_rq_dlg_calc_30.c:1742:6: error: stack frame size (1484) exceeds limit (1024) in 'dml30_rq_dlg_get_dlg_reg' display/dc/dml/dcn31/display_rq_dlg_calc_31.c:1571:6: error: stack frame size (1548) exceeds limit (1024) in 'dml31_rq_dlg_get_dlg_reg' display/dc/dml/dcn21/display_rq_dlg_calc_21.c:1657:6: error: stack frame size (1388) exceeds limit (1024) in 'dml21_rq_dlg_get_dlg_reg' display/dc/dml/dcn32/display_rq_dlg_calc_32.c:206:6: error: stack frame size (1276) exceeds limit (1024) in 'dml32_rq_dlg_get_dlg_reg' display/dc/dml/dcn31/display_mode_vba_31.c:2049:13: error: stack frame size (1468) exceeds limit (1024) in 'DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation' display/dc/dml/dcn20/display_mode_vba_20v2.c:1145:13: error: stack frame size (1228) exceeds limit (1024) in 'dml20v2_DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation' display/dc/dml/dcn20/display_mode_vba_20.c:1085:13: error: stack frame size (1340) exceeds limit (1024) in 'dml20_DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation' display/dc/dml/dcn31/display_mode_vba_31.c:3908:6: error: stack frame size (1996) exceeds limit (1024) in 'dml31_ModeSupportAndSystemConfigurationFull' display/dc/dml/dcn21/display_mode_vba_21.c:1466:13: error: stack frame size (1308) exceeds limit (1024) in 'DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation' display/dc/dml/dcn20/display_mode_vba_20v2.c:3393:6: error: stack frame size (1356) exceeds limit (1024) in 'dml20v2_ModeSupportAndSystemConfigurationFull' display/dc/dml/dcn20/display_mode_vba_20.c:3286:6: error: stack frame size (1468) exceeds limit (1024) in 'dml20_ModeSupportAndSystemConfigurationFull' display/dc/dml/dcn21/display_mode_vba_21.c:3518:6: error: stack frame size (1228) exceeds limit (1024) in 'dml21_ModeSupportAndSystemConfigurationFull' display/dc/dml/dcn30/display_mode_vba_30.c:1906:13: error: stack frame size (1436) exceeds limit (1024) in 'DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation' display/dc/dml/dcn30/display_mode_vba_30.c:3596:6: error: stack frame size (2092) exceeds limit (1024) in 'dml30_ModeSupportAndSystemConfigurationFull' > > I do note that commit 1b54a0121dba ("drm/amd/display: Reduce stack size > > in the mode support function") did have a workaround for GCC. It appears > > clang will still inline mode_support_configuration(). If I mark it as > > 'noinline', the warning disappears in that file. > > That'd be the best quick fix. I guess if we split out functions to fix > stack usage we should mark them as 'noinline' in the future to avoid > agressive compiler optimizations. While splitting out sub-functions can help reduce the maximum stack usage, it seems that in this case it makes the actual problem worse: I see 2168 bytes for the combined dml32_ModeSupportAndSystemConfigurationFull(), but marking mode_support_configuration() as noinline gives me 1992 bytes for the outer function plus 384 bytes for the inner one. So it does avoid the warning (barely), but not the problem that the warning tries to point out. Arnd