linux_dsm_epyc7002/arch
Nathan Chancellor 30c44537cb KVM: PPC: Book3S HV: Workaround high stack usage with clang
commit 51696f39cbee5bb684e7959c0c98b5f54548aa34 upstream.

LLVM does not emit optimal byteswap assembly, which results in high
stack usage in kvmhv_enter_nested_guest() due to the inlining of
byteswap_pt_regs(). With LLVM 12.0.0:

arch/powerpc/kvm/book3s_hv_nested.c:289:6: error: stack frame size of
2512 bytes in function 'kvmhv_enter_nested_guest' [-Werror,-Wframe-larger-than=]
long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)
     ^
1 error generated.

While this gets fixed in LLVM, mark byteswap_pt_regs() as
noinline_for_stack so that it does not get inlined and break the build
due to -Werror by default in arch/powerpc/. Not inlining saves
approximately 800 bytes with LLVM 12.0.0:

arch/powerpc/kvm/book3s_hv_nested.c:290:6: warning: stack frame size of
1728 bytes in function 'kvmhv_enter_nested_guest' [-Wframe-larger-than=]
long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)
     ^
1 warning generated.

Cc: stable@vger.kernel.org # v4.20+
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://github.com/ClangBuiltLinux/linux/issues/1292
Link: https://bugs.llvm.org/show_bug.cgi?id=49610
Link: https://lore.kernel.org/r/202104031853.vDT0Qjqj-lkp@intel.com/
Link: https://gist.github.com/ba710e3703bf45043a31e2806c843ffd
Link: https://lore.kernel.org/r/20210621182440.990242-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-14 16:55:42 +02:00
..
alpha
arc ARCv2: save ABI registers across signal handling 2021-06-23 14:42:51 +02:00
arm ARM: dts: at91: sama5d4: fix pinctrl muxing 2021-07-14 16:55:40 +02:00
arm64 arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required 2021-06-30 08:47:17 -04:00
c6x
csky
h8300
hexagon Hexagon: change jumps to must-extend in futex_atomic_* 2021-07-11 12:53:31 +02:00
ia64 tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
m68k m68k: Add missing mmap_read_lock() to sys_cacheflush() 2021-05-14 09:50:19 +02:00
microblaze
mips MIPS: generic: Update node names to avoid unit addresses 2021-06-30 08:47:16 -04:00
nds32
nios2
openrisc openrisc: Define memory barrier mb 2021-06-03 09:00:44 +02:00
parisc
powerpc KVM: PPC: Book3S HV: Workaround high stack usage with clang 2021-07-14 16:55:42 +02:00
riscv riscv32: Use medany C model for modules 2021-06-30 08:47:21 -04:00
s390 s390/stack: fix possible register corruption with stack switch helper 2021-06-30 08:47:25 -04:00
sh
sparc
um um: Disable CONFIG_GCOV with MODULES 2021-05-22 11:40:53 +02:00
x86 KVM: nVMX: Handle split-lock #AC exceptions that happen in L2 2021-07-14 16:55:42 +02:00
xtensa
.gitignore
Kconfig