Skip to content

Commit ecb8bd7

Browse files
chleroyzx2c4
authored andcommitted
selftests: vDSO: build tests with O2 optimization
Without -O2, the generated code for testing chacha function is awful. GCC even implements rol32() as a function of 20 instructions instead of just using the rotlwi instruction. ~# time ./vdso_test_chacha TAP version 13 1..1 ok 1 chacha: PASS real 0m 37.16s user 0m 36.89s sys 0m 0.26s Several other selftests directory add -O2, and the kernel is also always built with optimisation active. Do the same for vDSO selftests. With this patch the time is reduced by approximately 15%. ~# time ./vdso_test_chacha TAP version 13 1..1 ok 1 chacha: PASS real 0m 32.09s user 0m 31.86s sys 0m 0.22s Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 18efd0b commit ecb8bd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/vDSO/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TEST_GEN_PROGS += vdso_test_getrandom
1414
TEST_GEN_PROGS += vdso_test_chacha
1515
endif
1616

17-
CFLAGS := -std=gnu99
17+
CFLAGS := -std=gnu99 -O2
1818

1919
ifeq ($(CONFIG_X86_32),y)
2020
LDLIBS += -lgcc_s

0 commit comments

Comments
 (0)