Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: vDSO: skip getrandom test if architecture is unsupported

If the getrandom test compiles for an arch, don't exit fatally if the
actual cpu it's running on is unsupported.

Suggested-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

+6 -1
+6 -1
tools/testing/selftests/vDSO/vdso_test_getrandom.c
··· 104 104 const char *version = versions[VDSO_VERSION]; 105 105 const char *name = names[VDSO_NAMES][6]; 106 106 unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR); 107 + size_t ret; 107 108 108 109 if (!sysinfo_ehdr) { 109 110 printf("AT_SYSINFO_EHDR is not present!\n"); ··· 116 115 printf("%s is missing!\n", name); 117 116 exit(KSFT_FAIL); 118 117 } 119 - if (vgrnd.fn(NULL, 0, 0, &vgrnd.params, ~0UL) != 0) { 118 + ret = vgrnd.fn(NULL, 0, 0, &vgrnd.params, ~0UL); 119 + if (ret == -ENOSYS) { 120 + printf("unsupported architecture\n"); 121 + exit(KSFT_SKIP); 122 + } else if (ret) { 120 123 printf("failed to fetch vgetrandom params!\n"); 121 124 exit(KSFT_FAIL); 122 125 }