Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3615251pxj; Mon, 21 Jun 2021 02:47:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzFVsg7HvjD+cre4f+yqamDSV1A8va3HnH5pWkPHm62WjkTKlETWdlDfdOPIBHZYP4JnxU X-Received: by 2002:a05:6e02:2197:: with SMTP id j23mr2836011ila.159.1624268855004; Mon, 21 Jun 2021 02:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624268854; cv=none; d=google.com; s=arc-20160816; b=Da424sftpdaVEsai2kkfBkYojIXpKHHMo3PFvwRGsUuNoCnsd6V1SAA/LCk4WWm2/L /Vdt/pnGgDomxcDf88cyC3qhgVLIK2eFzZ9OIyCAyr5GztXDCfPmOl4WejfhltvXBeFy TVHbMY2GyiynsRLomBx2wr2x7BAQcCVZ5Op+Axv4qrKrsqUqhk7Tn/yeawq14kpU/Thp B9fqGJrtjEuMOQuf1ZCW7D8+8XdI6Vt58YMz2TP42Z4wIo5xwJ9U1X3vohF2qBt92E8F NnAyI95nF/o0l2I1EQ3XVLzjktlVuuoBrVqVJlgEIZuIa/6K00YwJSaU6PRr9WFgrBWZ eKuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=Hb21Nn6g42SJ39Koogxh1jjn42VLgf2TIzDVKkAOEw4=; b=eiyyFnBUHJQ9wr7Njem71sG1pLjAaYbRKQ56KzbbHTZ62NtYXpoFxtKIF09KK9gILA XtxNnNieEZlHSsr9p9l8MorHL5wqpN7M+cPulIgpz/LdM61CfuZYtISd4k+snWeSzKMB O+IVhvZQ3d5GidsSzi+ueumzbXIm5UMbN2A+SWlgze+SLyhJRGzs/lBpnbsMAvkTVCP2 2JKQC1o+8bnfukA09Wx7crUYBC+izL8PnAa1+XT4SEsxyXZ97dzi9WOQRE1cVYIXW2zI JKJS7BPkd2fGavk0EEwj0Bsmbs4TWTTxVqTVEor1CbbefvMn805cCWOCZhqEIUQEM/O3 p0oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=qjIZKqzu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j29si11256590ila.114.2021.06.21.02.47.22; Mon, 21 Jun 2021 02:47:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=qjIZKqzu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230411AbhFUJs2 (ORCPT + 99 others); Mon, 21 Jun 2021 05:48:28 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:50343 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230232AbhFUJsW (ORCPT ); Mon, 21 Jun 2021 05:48:22 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4G7l5p14q7z9sWl; Mon, 21 Jun 2021 19:46:06 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1624268767; bh=zDzQjEJQlnW0AJBiTTf601+r5jzUK+G3QgDwx54BkK0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=qjIZKqzuVKzDihFui4DV1KheP3BPWR56Q/6p+6qiZi+vnedd/MECR/fXTc9tK4mYx IpRIjW+7+tbXx828oIQigq98zGkLFzLdzks7imElRprN544FHncgm+IvOX1shLi6He P/6jcowPWkv0csld3wtXJcNRseiLg/6J5OYDIXTZPUnFTX+uc0nDTk+aSbo8LSv9RH nxH7t+y8JRxeZVRX6G3v7ZADUzZropfsglV42NGb32U9ibhh5SiStFHbYYLlGCrm0L 2O/HtwWgYlhRdA8sCSramN5Qs5jJ65ODMxkj4WzU4ry8DU84wtGg8rAG3CnyguPorv OCHI1jXgTb2rg== From: Michael Ellerman To: Nathan Chancellor , Nicholas Piggin , Arnd Bergmann , kernel test robot Cc: Andrew Morton , clang-built-linux@googlegroups.com, kbuild-all@lists.01.org, Kees Cook , linux-kernel@vger.kernel.org, Linux Memory Management List , linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org Subject: Re: arch/powerpc/kvm/book3s_hv_nested.c:264:6: error: stack frame size of 2304 bytes in function 'kvmhv_enter_nested_guest' In-Reply-To: References: <202104031853.vDT0Qjqj-lkp@intel.com> <1624232938.d90brlmh3p.astroid@bobo.none> Date: Mon, 21 Jun 2021 19:46:03 +1000 Message-ID: <87im273604.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: >>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>> head: d93a0d43e3d0ba9e19387be4dae4a8d5b175a8d7 >>> commit: 97e4910232fa1f81e806aa60c25a0450276d99a2 linux/compiler-clang.h: define HAVE_BUILTIN_BSWAP* >>> date: 3 weeks ago >>> config: powerpc64-randconfig-r006-20210403 (attached as .config) >>> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 0fe8af94688aa03c01913c2001d6a1a911f42ce6) >>> reproduce (this is a W=1 build): >>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross >>> chmod +x ~/bin/make.cross >>> # install powerpc64 cross compiling tool for clang build >>> # apt-get install binutils-powerpc64-linux-gnu >>> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=97e4910232fa1f81e806aa60c25a0450276d99a2 >>> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git >>> git fetch --no-tags linus master >>> git checkout 97e4910232fa1f81e806aa60c25a0450276d99a2 >>> # save the attached .config to linux build tree >>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 >>> >>> If you fix the issue, kindly add following tag as appropriate >>> Reported-by: kernel test robot >>> >>> All errors (new ones prefixed by >>): >>> >>>>> arch/powerpc/kvm/book3s_hv_nested.c:264:6: error: stack frame size of 2304 bytes in function 'kvmhv_enter_nested_guest' [-Werror,-Wframe-larger-than=] >>> long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu) >>> ^ >>> 1 error generated. >>> >>> >>> 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. 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. cheers