[PATCH v4 0/4] Enable orphan-handling=warn for VDSO

Joey Gouly joey.gouly at arm.com
Tue Apr 19 05:16:21 PDT 2022


Hi,

On Tue, Apr 19, 2022 at 12:10:25PM +0100, Vincenzo Frascino wrote:
> Hi Joey,
> 
> On 4/14/22 11:46 AM, Joey Gouly wrote:
> > Hi all,
> > 
> > This small series enables the orphan-handling linker flag for the VDSO.
> > This could catch subtle errors if features that use special sections are
> > introduced into the VDSO implementation.
> > 
> > Sorry for the extra version, I forgot to include Kees' and Vincenzo's 
> > reviewed-by tags. That's the only change to the patches.
> > 
> 
> The patches look fine. Could you please provide some test results with [1] or [2]?
> 
> [1] https://github.com/nlynch-mentor/vdsotest
> [2] <kernel_tree>/tools/testing/selftests/vDSO

Testing with the selftests:

$ ./vdso_test_abi
TAP version 13
1..16
[vDSO kselftest] VDSO_VERSION: LINUX_2.6.39
# The time is 1650369341.228566
ok 1
vdso_test_gettimeofday(): PASS
#
clock_id: CLOCK_REALTIME
# The time is 1650369341.229413165
ok 2
vdso_test_clock_gettime(): PASS
# The vdso resolution is 0 1
# The syscall resolution is 0 1
ok 3
vdso_test_clock_getres(): PASS
#
clock_id: CLOCK_BOOTTIME
# The time is 1524.388896408
ok 4
vdso_test_clock_gettime(): PASS
# The vdso resolution is 0 1
# The syscall resolution is 0 1
ok 5
vdso_test_clock_getres(): PASS
#
clock_id: CLOCK_TAI
# The time is 1650369341.231390753
ok 6
vdso_test_clock_gettime(): PASS
# The vdso resolution is 0 1
# The syscall resolution is 0 1
ok 7
vdso_test_clock_getres(): PASS
#
clock_id: CLOCK_REALTIME_COARSE
# The time is 1650369341.227127861
ok 8
vdso_test_clock_gettime(): PASS
# The vdso resolution is 0 4000000
# The syscall resolution is 0 4000000
ok 9
vdso_test_clock_getres(): PASS
#
clock_id: CLOCK_MONOTONIC
# The time is 1524.391519475
ok 10
vdso_test_clock_gettime(): PASS
# The vdso resolution is 0 1
# The syscall resolution is 0 1
ok 11
vdso_test_clock_getres(): PASS
#
clock_id: CLOCK_MONOTONIC_RAW
# The time is 1524.697386720
ok 12
vdso_test_clock_gettime(): PASS
# The vdso resolution is 0 1
# The syscall resolution is 0 1
ok 13
vdso_test_clock_getres(): PASS
#
clock_id: CLOCK_MONOTONIC_COARSE
# The time is 1524.389473326
ok 14
vdso_test_clock_gettime(): PASS
# The vdso resolution is 0 4000000
# The syscall resolution is 0 4000000
ok 15
vdso_test_clock_getres(): PASS
ok 16 # SKIP
vdso_test_time(): SKIP: Could not find __kernel_time
# Totals: pass:15 fail:0 xfail:0 xpass:0 skip:1 error:0

$ ./vdso_test_correctness
Warning: failed to find getcpu in vDSO
[RUN]   Testing clock_gettime for clock CLOCK_REALTIME (0)...
        1650369433.949718175 1650369433.949982211 1650369433.950033907
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock CLOCK_MONOTONIC (1)...
        1617.109425232 1617.109431840 1617.109434048
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock CLOCK_PROCESS_CPUTIME_ID (2)...
        0.039832960 0.039874448 0.039886448
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock CLOCK_THREAD_CPUTIME_ID (3)...
        0.040566320 0.040574576 0.040579552
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock CLOCK_MONOTONIC_RAW (4)...
        1617.415046976 1617.415057616 1617.415059712
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock CLOCK_REALTIME_COARSE (5)...
        1650369433.948175756 1650369433.948175756 1650369433.948175756
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock CLOCK_MONOTONIC_COARSE (6)...
        1617.110521230 1617.110521230 1617.110521230
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock CLOCK_BOOTTIME (7)...
        1617.113039789 1617.113044493 1617.113046269
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock CLOCK_REALTIME_ALARM (8)...
        1650369433.955192243 1650369433.955196547 1650369433.955199811
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock CLOCK_BOOTTIME_ALARM (9)...
        1617.114074714 1617.114079690 1617.114083210
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock CLOCK_SGI_CYCLE (10)...
[OK]    No such clock.
[RUN]   Testing clock_gettime for clock CLOCK_TAI (11)...
        1650369433.956495555 1650369433.956498307 1650369433.956500003
[OK]    Test Passed.
[RUN]   Testing clock_gettime for clock invalid (-1)...
[OK]    No such clock.
[RUN]   Testing clock_gettime for clock invalid (-2147483648)...
[OK]    No such clock.
[RUN]   Testing clock_gettime for clock invalid (2147483647)...
[OK]    No such clock.
[SKIP]  No vDSO, so skipping clock_gettime64() tests
[RUN]   Testing gettimeofday...
        1650369433.958323 1650369433.958397 1650369433.958470
[OK]    timezones match: minuteswest=0, dsttime=0
[RUN]   Testing getcpu...
[OK]    CPU 0: syscall: cpu 0, node 0

$ ./vdso_test_gettimeofday
The time is 1650369462.312523

$ ./vdso_test_clock_getres
clock_id: CLOCK_REALTIME [PASS]
clock_id: CLOCK_BOOTTIME [PASS]
clock_id: CLOCK_TAI [PASS]
clock_id: CLOCK_REALTIME_COARSE [PASS]
clock_id: CLOCK_MONOTONIC [PASS]
clock_id: CLOCK_MONOTONIC_RAW [PASS]
clock_id: CLOCK_MONOTONIC_COARSE [PASS]

$ ./vdso_test_getcpu
Could not find __vdso_getcpu


So there was 2 potential issues:
- vdso_test_time(): SKIP: Could not find __kernel_time
- Could not find __vdso_getcpu

I'm not sure what these are, maybe they don't work on arm64 or it's a kernel config issue.

Thanks,
Joey



More information about the linux-arm-kernel mailing list