diff mbox series

selftests: vDSO: align stack for O2-optimized memcpy

Message ID 20240924115001.916112-1-Jason@zx2c4.com
State New
Headers show
Series selftests: vDSO: align stack for O2-optimized memcpy | expand

Commit Message

Jason A. Donenfeld Sept. 24, 2024, 11:47 a.m. UTC
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 alignnent sequence.

Fixes: ecb8bd70d51 ("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>
---
 tools/testing/selftests/vDSO/vdso_standalone_test_x86.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jason A. Donenfeld Sept. 27, 2024, 5:24 p.m. UTC | #1
Hi Shuah,

On Tue, Sep 24, 2024 at 01:47:23PM +0200, Jason A. Donenfeld wrote:
> 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 alignnent sequence.
> 
> Fixes: ecb8bd70d51 ("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>
 
Just FYI, I'm expecting that this is a patch you take through your tree
for 6.12, and hopefully before rc1, as automated testing is failing.

Jason
Shuah Khan Sept. 27, 2024, 6:19 p.m. UTC | #2
On 9/27/24 11:24, Jason A. Donenfeld wrote:
> Hi Shuah,
> 
> On Tue, Sep 24, 2024 at 01:47:23PM +0200, Jason A. Donenfeld wrote:
>> 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 alignnent sequence.

I fixed this spelling when I apply. checkpatch is good at catching
these by the way.

>>
>> Fixes: ecb8bd70d51 ("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>
>   
> Just FYI, I'm expecting that this is a patch you take through your tree
> for 6.12, and hopefully before rc1, as automated testing is failing.
> 
> Jason

Okay. Thanks for letting me know.

I will try to send this up for rc1 if at all possible.

Applied to linux-kselftest next

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/testing/selftests/vDSO/vdso_standalone_test_x86.c b/tools/testing/selftests/vDSO/vdso_standalone_test_x86.c
index 27f6fdf11969..644915862af8 100644
--- a/tools/testing/selftests/vDSO/vdso_standalone_test_x86.c
+++ b/tools/testing/selftests/vDSO/vdso_standalone_test_x86.c
@@ -131,6 +131,8 @@  asm (
 	"_start:\n\t"
 #ifdef __x86_64__
 	"mov %rsp,%rdi\n\t"
+	"and $-16,%rsp\n\t"
+	"sub $8,%rsp\n\t"
 	"jmp c_main"
 #else
 	"push %esp\n\t"