mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 14:24:11 +08:00
a6e23fb8d3
Running vdso_test_correctness on s390x (aka s390 64 bit) emits a warning:
Warning: failed to find clock_gettime64 in vDSO
This is caused by the "#elif defined (__s390__)" check in vdso_config.h
which the defines VDSO_32BIT.
If __s390x__ is defined also __s390__ is defined. Therefore the correct
check must make sure that only __s390__ is defined.
Therefore add the missing !defined(__s390x__). Also use common
__s390x__ define instead of __s390X__.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Fixes: 693f5ca08c
("kselftest: Extend vDSO selftest")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
93 lines
2.0 KiB
C
93 lines
2.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* vdso_config.h: Configuration options for vDSO tests.
|
|
* Copyright (c) 2019 Arm Ltd.
|
|
*/
|
|
#ifndef __VDSO_CONFIG_H__
|
|
#define __VDSO_CONFIG_H__
|
|
|
|
/*
|
|
* Each architecture exports its vDSO implementation with different names
|
|
* and a different version from the others, so we need to handle it as a
|
|
* special case.
|
|
*/
|
|
#if defined(__arm__)
|
|
#define VDSO_VERSION 0
|
|
#define VDSO_NAMES 1
|
|
#define VDSO_32BIT 1
|
|
#elif defined(__aarch64__)
|
|
#define VDSO_VERSION 3
|
|
#define VDSO_NAMES 0
|
|
#elif defined(__powerpc64__)
|
|
#define VDSO_VERSION 1
|
|
#define VDSO_NAMES 0
|
|
#elif defined(__powerpc__)
|
|
#define VDSO_VERSION 1
|
|
#define VDSO_NAMES 0
|
|
#define VDSO_32BIT 1
|
|
#elif defined (__s390__) && !defined(__s390x__)
|
|
#define VDSO_VERSION 2
|
|
#define VDSO_NAMES 0
|
|
#define VDSO_32BIT 1
|
|
#elif defined (__s390x__)
|
|
#define VDSO_VERSION 2
|
|
#define VDSO_NAMES 0
|
|
#elif defined(__mips__)
|
|
#define VDSO_VERSION 0
|
|
#define VDSO_NAMES 1
|
|
#define VDSO_32BIT 1
|
|
#elif defined(__sparc__)
|
|
#define VDSO_VERSION 0
|
|
#define VDSO_NAMES 1
|
|
#define VDSO_32BIT 1
|
|
#elif defined(__i386__)
|
|
#define VDSO_VERSION 0
|
|
#define VDSO_NAMES 1
|
|
#define VDSO_32BIT 1
|
|
#elif defined(__x86_64__)
|
|
#define VDSO_VERSION 0
|
|
#define VDSO_NAMES 1
|
|
#elif defined(__riscv__) || defined(__riscv)
|
|
#define VDSO_VERSION 5
|
|
#define VDSO_NAMES 1
|
|
#if __riscv_xlen == 32
|
|
#define VDSO_32BIT 1
|
|
#endif
|
|
#elif defined(__loongarch__)
|
|
#define VDSO_VERSION 6
|
|
#define VDSO_NAMES 1
|
|
#endif
|
|
|
|
static const char *versions[7] = {
|
|
"LINUX_2.6",
|
|
"LINUX_2.6.15",
|
|
"LINUX_2.6.29",
|
|
"LINUX_2.6.39",
|
|
"LINUX_4",
|
|
"LINUX_4.15",
|
|
"LINUX_5.10"
|
|
};
|
|
|
|
static const char *names[2][7] = {
|
|
{
|
|
"__kernel_gettimeofday",
|
|
"__kernel_clock_gettime",
|
|
"__kernel_time",
|
|
"__kernel_clock_getres",
|
|
"__kernel_getcpu",
|
|
"__kernel_clock_gettime64",
|
|
"__kernel_getrandom",
|
|
},
|
|
{
|
|
"__vdso_gettimeofday",
|
|
"__vdso_clock_gettime",
|
|
"__vdso_time",
|
|
"__vdso_clock_getres",
|
|
"__vdso_getcpu",
|
|
"__vdso_clock_gettime64",
|
|
"__vdso_getrandom",
|
|
},
|
|
};
|
|
|
|
#endif /* __VDSO_CONFIG_H__ */
|