From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3672DC4743C for ; Mon, 21 Jun 2021 11:55:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 818E2610C7 for ; Mon, 21 Jun 2021 11:55:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 818E2610C7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E9AB86B006E; Mon, 21 Jun 2021 07:55:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E71AD6B0070; Mon, 21 Jun 2021 07:55:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D39B46B0072; Mon, 21 Jun 2021 07:55:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A04216B006E for ; Mon, 21 Jun 2021 07:55:31 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 18C621AB4E for ; Mon, 21 Jun 2021 11:55:31 +0000 (UTC) X-FDA: 78277576062.17.53FA7FC Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by imf29.hostedemail.com (Postfix) with ESMTP id 54CF81438 for ; Mon, 21 Jun 2021 11:55:30 +0000 (UTC) Received: from mail-wm1-f47.google.com ([209.85.128.47]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1M6UVr-1ltLeD2eQz-006sem for ; Mon, 21 Jun 2021 13:55:28 +0200 Received: by mail-wm1-f47.google.com with SMTP id l7-20020a05600c1d07b02901b0e2ebd6deso10514709wms.1 for ; Mon, 21 Jun 2021 04:55:28 -0700 (PDT) X-Gm-Message-State: AOAM532t+mfTesiZf0D1lUm4LyQgQBPNUqDpUmr4l35nTFDXuYsdHzhR fyYG/qxXLET1wxbVrWj4uRtO/mEXjMWjlLlbxU8= X-Google-Smtp-Source: ABdhPJwhA2TM2PcFJQYCB+5Xx/XGY7m3KHuH6Z6RgJYL0awTBlZGuL5U6Qz/NGecGMIJ16WwJfYhY5QqBMGyQv9kk+c= X-Received: by 2002:a1c:c90f:: with SMTP id f15mr26864111wmb.142.1624276527837; Mon, 21 Jun 2021 04:55:27 -0700 (PDT) MIME-Version: 1.0 References: <202104031853.vDT0Qjqj-lkp@intel.com> <1624232938.d90brlmh3p.astroid@bobo.none> <87im273604.fsf@mpe.ellerman.id.au> In-Reply-To: <87im273604.fsf@mpe.ellerman.id.au> From: Arnd Bergmann Date: Mon, 21 Jun 2021 13:53:10 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: arch/powerpc/kvm/book3s_hv_nested.c:264:6: error: stack frame size of 2304 bytes in function 'kvmhv_enter_nested_guest' To: Michael Ellerman Cc: Nathan Chancellor , Nicholas Piggin , kernel test robot , Andrew Morton , clang-built-linux , kbuild-all@lists.01.org, Kees Cook , Linux Kernel Mailing List , Linux Memory Management List , linuxppc-dev , kvm-ppc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:Gh8fsxlR7cBx5DsVTPFT9yRtNWdwtK9Bokh1SXDknGKLmzOltBB G4bQZy4QxTuFvpm+/65zh3j2hdbPzRsjnjUgpHcLxTbocsPlUoF1fWAHuYHakvjUxq1tCOZ 9e6gE3k7Lq1KUr9jhW2mdEGa13Rr2RbM1kmbB7QRgEabCt4wbbNLUDSLWNGCY10BUt4zCt0 hRcmo5bK5OHbcXh61/HfQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:hQ3beAWzzRk=:z4hFJbyGjgE8ZC4hp4DBLa e+IQrJeMJHTWnTAYzQ0VUllTHwbSOM6qCzv619NQo7o135vwkvcv/oo1Wb7c7yfrR7Mq7GjdJ daOsgsLCG3u57hNTG+5O+MP3wTqlp8dGYkmWMP5dB6Me285wp2Fsy0gSdDvyGJVee5E94cnWl p41EPCio/a510WSMP0wG+twwTU6e5GwtQexT4Wi4aTnm4d10LZsbRTZ7WyZnTXdiuUaS2GsfQ yYVqG2wb2kiHXM0uAu6Ma9ApoUEc7tBznotqzROmps0EA/d6ku3POFaiKRwvOHqrDaWDGPX8L fiv8FNsVp4xMXTBbtbHkNKgRNUxHBY4weaXsUPxMKYCtgZ0OJcDnCfoKUQOEK8PEpvkqdA7zE mOEBOTmlT3TjP/6u6JbNLPnboIVDwTGwfubp07Sxn9fxD5I9Cax6Pkz6ekhJX6yXm2S/EQBZS 0Z+z6OMboj0FlPWU2IG+Kwh+qM7wsAX1WUzeWphctcidg6Vbau4bhkCUJV+5xV5r5Ki9BJjVO E+B5elbm61n3JzTLRcj4Ys= Authentication-Results: imf29.hostedemail.com; dkim=none; spf=none (imf29.hostedemail.com: domain of arnd@arndb.de has no SPF policy when checking 212.227.17.24) smtp.mailfrom=arnd@arndb.de; dmarc=none X-Stat-Signature: 864eynfj8zf9ftxoda878socp4j1sm5e X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 54CF81438 X-HE-Tag: 1624276530-504750 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jun 21, 2021 at 11:46 AM Michael Ellerman wrote: > Nathan Chancellor writes: > > On 6/20/2021 4:59 PM, Nicholas Piggin wrote: > >> Excerpts from kernel test robot's message of April 3, 2021 8:47 pm: > >>> > >>> vim +/kvmhv_enter_nested_guest +264 arch/powerpc/kvm/book3s_hv_nested.c > >> > >> Not much changed here recently. It's not that big a concern because it's > >> only called in the KVM ioctl path, not in any deep IO paths or anything, > >> and doesn't recurse. Might be a bit of inlining or stack spilling put it > >> over the edge. > > > > It appears to be the fact that LLVM's PowerPC backend does not emit > > efficient byteswap assembly: > > > > https://github.com/ClangBuiltLinux/linux/issues/1292 > > > > https://bugs.llvm.org/show_bug.cgi?id=49610 > > > >> powerpc does make it an error though, would be good to avoid that so the > >> robot doesn't keep tripping over. > > > > Marking byteswap_pt_regs as 'noinline_for_stack' drastically reduces the > > stack usage. If that is an acceptable solution, I can send it along > > tomorrow. > > Yeah that should be OK. That's fine with me as well. > Can you post the before/after disassembly when > you post the patch? > > It should just be two extra function calls, which shouldn't be enough > overhead to be measurable. The thing I remember is that the 'before' code here is some seriously bad output from llvm, and it would be helpful to have someone get the compiler to emit the correct powerpc byteswap instructions and avoid the excessive stack spilling. The warning here is just a symptom of a missed optimization and the same thing probably happens elsewhere on powerpc, even if it doesn't exceed the stack warning limit. Arnd