1

selftests: vDSO: align stack for O2-optimized memcpy

When switching on -O2, gcc generates SSE2 instructions that assume a
16-byte aligned stack, which the standalone test's start point wasn't
aligning. Fix this with the usual alignment sequence.

Fixes: ecb8bd70d5 ("selftests: vDSO: build tests with O2 optimization")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202409241558.98e13f6f-oliver.sang@intel.com
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Jason A. Donenfeld 2024-09-24 13:47:23 +02:00 committed by Shuah Khan
parent a0474b8d59
commit 4b721fcc09

View File

@ -131,6 +131,8 @@ asm (
"_start:\n\t" "_start:\n\t"
#ifdef __x86_64__ #ifdef __x86_64__
"mov %rsp,%rdi\n\t" "mov %rsp,%rdi\n\t"
"and $-16,%rsp\n\t"
"sub $8,%rsp\n\t"
"jmp c_main" "jmp c_main"
#else #else
"push %esp\n\t" "push %esp\n\t"