Skip to content

Commit 4b721fc

Browse files
zx2c4shuahkh
authored andcommitted
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: ecb8bd7 ("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>
1 parent a0474b8 commit 4b721fc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/testing/selftests/vDSO/vdso_standalone_test_x86.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ asm (
131131
"_start:\n\t"
132132
#ifdef __x86_64__
133133
"mov %rsp,%rdi\n\t"
134+
"and $-16,%rsp\n\t"
135+
"sub $8,%rsp\n\t"
134136
"jmp c_main"
135137
#else
136138
"push %esp\n\t"

0 commit comments

Comments
 (0)