From patchwork Tue Dec 17 21:47:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 181913 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6349451ile; Tue, 17 Dec 2019 13:48:00 -0800 (PST) X-Google-Smtp-Source: APXvYqwDhym9DHtM3g0IkBvEd0I6e5oh5jfq1fm2EqvxvGUYeaJhX6yg0sHIOv861aQOKlVn5T0P X-Received: by 2002:aca:7244:: with SMTP id p65mr2752652oic.50.1576619280343; Tue, 17 Dec 2019 13:48:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576619280; cv=none; d=google.com; s=arc-20160816; b=feo72Oy2Y+mpWK69Qgt+5+jy+fQreSdQ/yef5R09w03AfrFnZIRmZhdXxfZv/yFtT1 ZBUbXwNIlka+27pivCFRUDFRWfU05VwrGwk3xtmhTvy6LCQRa0A1LgIP9SB8oZvfuC++ GPhODHjyn/fAYYDBAzy/cb8ZW+1Hs5Togw9rd6tUs9HV9G5w6mAiVI5xD66S+57PrfDY 1pehBnTmo/XxVEzIUxhuth9b4CRrjiOsvpXtyg+mQPwT+DhdKo0+Lp1BgYN4m9oni6lK e5FD2WVxTpnqIxRYeX9WPnAXEGNY+e2fczNUpFCGLGQOcIue7yHqub96a+PyV9sa7eSy QG+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-subscribe:list-unsubscribe :list-id:precedence:mailing-list:dkim-signature:domainkey-signature; bh=kIHlcsXGLCcPQnKGQWbOLUsjqn84Fl8/BNjdtDz1aCY=; b=UaMeOXkrREhxixtBSVNJOYT4E6mBq26WtXUAwu12/IT73/YqzUA7yX8Yrj1UNw+8Hp nGL5YxIfHd3sGp7w/gLTjy7tiGoM7hna/laTudqKQ0MqrzXQAOjbraxKgbxNDB1csZ7Y BjtvsNYWpAVNvhEzQtqBlBQ8k3O51F6r3XgrmnANx3yhVXAvB9WzP+UWE6rHJJ142zQ3 +bxwQWfFu/ica/UA5MARchScmKaxV5N9KbKaMwCVW3YHmjmhJ/0NvjZxEjiDggcgCymT z1gEXvrdT0lik3WKjftf9ZGFSG1kNKsiMzwihwuQwSn7XXjU6Pw8sUi7/+dPAtJc6dWP 3nZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=iDxJfOu6; dkim=pass header.i=@linaro.org header.s=google header.b=RCovwVcM; spf=pass (google.com: domain of libc-alpha-return-108164-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108164-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q18si12964932otc.189.2019.12.17.13.48.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2019 13:48:00 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-108164-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=iDxJfOu6; dkim=pass header.i=@linaro.org header.s=google header.b=RCovwVcM; spf=pass (google.com: domain of libc-alpha-return-108164-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108164-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=f0dkkPcCeECtydZqVFUSGv7AxhmrI8yaMTjJhg1HOV45XLJ3sUCu7 MR2OqnHXALS6zqbDdMR2gM+Wi0bnAMqhYIxMgrkylZhwUm8RHpPmwVK6/Zw9LnX9 GTVuOczPIuu8NZw2+Bp416BAT/BZ1zdXPLB6miFwX/Km1YG0OMTNiA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=s9+6BQuaDd60knysckFoueYlUow=; b=iDxJfOu6fv+2K4JwdgwaHwjsFgtR cWoy+KeF9+tgneRnFwNqrmAaDvHogHYeyinB5y7pIz5KsTeKbcpMKpWj66kpzMy5 1Tn06++3OFSBQhys+JsWE/noDStgijnj9VuQRSuBD6M9OaUzGFk0JKX6GqyN8aS5 EwpeVhOZ48D6+bk= Received: (qmail 109476 invoked by alias); 17 Dec 2019 21:47:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 109410 invoked by uid 89); 17 Dec 2019 21:47:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=1822, inline_vsyscall, sysdepvdsoh, INLINE_VSYSCALL X-HELO: mail-pl1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=kIHlcsXGLCcPQnKGQWbOLUsjqn84Fl8/BNjdtDz1aCY=; b=RCovwVcMEAdhEO/9+gBaZVDgWLqCbHNJQfZsa14AIY8JA2igAJmiiZRm5NCNSP2QvL OUQWtrZTRDq+tUZZhYRlxn2b4/9RuAlHnWdBrD+6B1iJ18MCKNUnc+xr+2UarFxXChs6 lMTeHvfyJZNqfK1mdC5UeF4qNFKcZPhtXOYu90FoPWAnJHOZWNAiQToNoKDfUITSMUpi xlGHGF2NdK31jpAbmURzVkeanHelYU0BXdNpcnj/gCrUFtuNiijDw6+wCdHc2beGs+0Z TnUwk2aBUoHXvmdzHbPbAJTOjNXlqBTBAot6JzaeJOhRLWtvXkRYOYrToObuRa9BXSG1 NRPw== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 01/16] linux: Fix vDSO macros build with time64 interfaces Date: Tue, 17 Dec 2019 18:47:13 -0300 Message-Id: <20191217214728.2886-1-adhemerval.zanella@linaro.org> Changes from previous version: - Reinstate syscall fallback on INLINE_VSYSCALL, it simplifies when the macro is used multiple times (as for clock_gettime and clock_getres). -- As indicated on libc-help [1] the ec138c67cb commit broke 32-bit builds when configured with --enable-kernel=5.1 or higher. The scenario 10 from [2] might also occur in this configuration and INLINE_VSYSCALL will try to use the vDSO symbol and HAVE_CLOCK_GETTIME64_VSYSCALL does not set HAVE_VSYSCALL prior its usage. Also, there is no easy way to just enable the code to use one vDSO sysmbo since the macro INLINE_VSYSCALL is redefined if HAVE_VSYSCALL is set. Instead of adding more pre-processor handling and making the code even more convoluted, this patch removes the requirement of defining HAVE_VSYSCALL before including sysdep-vdso.h to enable vDSO usage. The INLINE_VSYSCALL is now expected to be issued inside a HAVE_*_VSYSCALL check, since it will try to use the internal vDSO pointers. Both clock_getres and clock_gettime vDSO code for time64_t were removed since there is no vDSO setup code for the symbol (an architecture can not set HAVE_CLOCK_GETTIME64_VSYSCALL). Checked on i686-linux-gnu (default and with --enable-kernel=5.1), x86_64-linux-gnu, aarch64-linux-gnu, and powerpc64le-linux-gnu. I also checked against a build to mips64-linux-gnu and sparc64-linux-gnu. [1] https://sourceware.org/ml/libc-help/2019-12/msg00014.html --- .../unix/sysv/linux/aarch64/gettimeofday.c | 4 -- sysdeps/unix/sysv/linux/clock_getres.c | 36 +++++++++++------- sysdeps/unix/sysv/linux/clock_gettime.c | 38 +++++++++++-------- sysdeps/unix/sysv/linux/getcpu.c | 9 +---- .../unix/sysv/linux/powerpc/gettimeofday.c | 4 -- sysdeps/unix/sysv/linux/powerpc/time.c | 4 -- sysdeps/unix/sysv/linux/sched_getcpu.c | 15 +++----- sysdeps/unix/sysv/linux/sysdep-vdso.h | 34 +---------------- sysdeps/unix/sysv/linux/x86/gettimeofday.c | 4 -- sysdeps/unix/sysv/linux/x86/time.c | 8 ++-- 10 files changed, 58 insertions(+), 98 deletions(-) -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c index 7e772e05ce..143c5c1507 100644 --- a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c +++ b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c @@ -22,10 +22,6 @@ #include #include - -#ifdef HAVE_GETTIMEOFDAY_VSYSCALL -# define HAVE_VSYSCALL -#endif #include /* Used as a fallback in the ifunc resolver if VDSO is not available diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c index 9497f78787..52671fa641 100644 --- a/sysdeps/unix/sysv/linux/clock_getres.c +++ b/sysdeps/unix/sysv/linux/clock_getres.c @@ -20,9 +20,6 @@ #include #include -#ifdef HAVE_CLOCK_GETRES_VSYSCALL -# define HAVE_VSYSCALL -#endif #include #include #include @@ -32,23 +29,34 @@ int __clock_getres64 (clockid_t clock_id, struct __timespec64 *res) { #ifdef __ASSUME_TIME64_SYSCALLS -# ifndef __NR_clock_getres_time64 - return INLINE_VSYSCALL (clock_getres, 2, clock_id, res); + /* 64 bit ABIs or Newer 32-bit ABIs that only support 64-bit time_t. */ +# ifdef __NR_clock_getres_time64 + return INLINE_SYSCALL_CALL (clock_getres_time64, clock_id, res); # else - return INLINE_SYSCALL (clock_getres_time64, 2, clock_id, res); +# ifdef HAVE_CLOCK_GETRES_VSYSCALL + return INLINE_VSYSCALL (clock_getres, 2, clock_id, res); +# else + return INLINE_SYSCALL_CALL (clock_getres, clock_id, res); +# endif # endif #else + int r; + /* Old 32-bit ABI with possible 64-bit time_t support. */ # ifdef __NR_clock_getres_time64 - int ret = INLINE_SYSCALL (clock_getres_time64, 2, clock_id, res); - if (ret == 0 || errno != ENOSYS) - return ret; + r = INLINE_SYSCALL_CALL (clock_getres_time64, clock_id, res); + if (r == 0 || errno != ENOSYS) + return r; # endif + /* Fallback code that uses 32-bit support. */ struct timespec ts32; - int retval = INLINE_VSYSCALL (clock_getres, 2, clock_id, &ts32); - if (! retval && res) +# ifdef HAVE_CLOCK_GETRES_VSYSCALL + r = INLINE_VSYSCALL (clock_getres, 2, clock_id, &ts32); +# else + r = INLINE_SYSCALL_CALL (clock_getres, clock_id, &ts32); +# endif + if (r == 0) *res = valid_timespec_to_timespec64 (ts32); - - return retval; + return r; #endif } @@ -60,7 +68,7 @@ __clock_getres (clockid_t clock_id, struct timespec *res) int retval; retval = __clock_getres64 (clock_id, &ts64); - if (! retval && res) + if (retval == 0 && res != NULL) *res = valid_timespec64_to_timespec (ts64); return retval; diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c index 875c4fe905..e895812704 100644 --- a/sysdeps/unix/sysv/linux/clock_gettime.c +++ b/sysdeps/unix/sysv/linux/clock_gettime.c @@ -21,10 +21,6 @@ #include #include #include "kernel-posix-cpu-timers.h" - -#ifdef HAVE_CLOCK_GETTIME_VSYSCALL -# define HAVE_VSYSCALL -#endif #include #include @@ -34,22 +30,34 @@ int __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp) { #ifdef __ASSUME_TIME64_SYSCALLS -# ifndef __NR_clock_gettime64 -# define __NR_clock_gettime64 __NR_clock_gettime -# define __vdso_clock_gettime64 __vdso_clock_gettime + /* 64 bit ABIs or Newer 32-bit ABIs that only support 64-bit time_t. */ +# ifdef __NR_clock_gettime64 + return INLINE_SYSCALL_CALL (clock_gettime64, clock_id, tp); +# else +# ifdef HAVE_CLOCK_GETTIME_VSYSCALL + return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); +# else + return INLINE_SYSCALL_CALL (clock_gettime, clock_id, tp); +# endif # endif - return INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp); #else -# if defined HAVE_CLOCK_GETTIME64_VSYSCALL - int ret64 = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp); - if (ret64 == 0 || errno != ENOSYS) - return ret64; + int r; + /* Old 32-bit ABI with possible 64-bit time_t support. */ +# ifdef __NR_clock_gettime64 + r = INLINE_SYSCALL_CALL (clock_gettime64, clock_id, tp); + if (r == 0 || errno != ENOSYS) + return r; # endif + /* Fallback code that uses 32-bit support. */ struct timespec tp32; - int ret = INLINE_VSYSCALL (clock_gettime, 2, clock_id, &tp32); - if (ret == 0) +# ifdef HAVE_CLOCK_GETTIME_VSYSCALL + r = INLINE_VSYSCALL (clock_gettime, 2, clock_id, &tp32); +# else + r = INLINE_SYSCALL_CALL (clock_gettime, clock_id, &tp32); +# endif + if (r == 0) *tp = valid_timespec_to_timespec64 (tp32); - return ret; + return r; #endif } diff --git a/sysdeps/unix/sysv/linux/getcpu.c b/sysdeps/unix/sysv/linux/getcpu.c index fdd27203af..efb4bb7627 100644 --- a/sysdeps/unix/sysv/linux/getcpu.c +++ b/sysdeps/unix/sysv/linux/getcpu.c @@ -18,20 +18,15 @@ #include #include #include - -#ifdef HAVE_GETCPU_VSYSCALL -# define HAVE_VSYSCALL -#endif #include int __getcpu (unsigned int *cpu, unsigned int *node) { -#ifdef __NR_getcpu +#ifdef HAVE_GETCPU_VSYSCALL return INLINE_VSYSCALL (getcpu, 3, cpu, node, NULL); #else - __set_errno (ENOSYS); - return -1; + return INLINE_SYSCALL_CALL (getcpu, cpu, node, NULL); #endif } weak_alias (__getcpu, getcpu) diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c index 18d8f7cb7a..c40793fe64 100644 --- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c +++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c @@ -17,10 +17,6 @@ #include #include - -#ifdef HAVE_GETTIMEOFDAY_VSYSCALL -# define HAVE_VSYSCALL -#endif #include static int diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c index 80a4c73416..f2b4c76be8 100644 --- a/sysdeps/unix/sysv/linux/powerpc/time.c +++ b/sysdeps/unix/sysv/linux/powerpc/time.c @@ -18,10 +18,6 @@ #include #include - -#ifdef HAVE_TIME_VSYSCALL -# define HAVE_VSYSCALL -#endif #include static time_t diff --git a/sysdeps/unix/sysv/linux/sched_getcpu.c b/sysdeps/unix/sysv/linux/sched_getcpu.c index 65dd9fdda7..68ba7f3734 100644 --- a/sysdeps/unix/sysv/linux/sched_getcpu.c +++ b/sysdeps/unix/sysv/linux/sched_getcpu.c @@ -18,22 +18,17 @@ #include #include #include - -#ifdef HAVE_GETCPU_VSYSCALL -# define HAVE_VSYSCALL -#endif #include int sched_getcpu (void) { -#ifdef __NR_getcpu unsigned int cpu; - int r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL); - - return r == -1 ? r : cpu; + int r = -1; +#ifdef HAVE_GETCPU_VSYSCALL + r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL); #else - __set_errno (ENOSYS); - return -1; + r = INLINE_SYSCALL_CALL (getcpu, &cpu, NULL, NULL); #endif + return r == -1 ? r : cpu; } diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h index cf614fbf8b..76a211e39b 100644 --- a/sysdeps/unix/sysv/linux/sysdep-vdso.h +++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h @@ -20,17 +20,14 @@ # define SYSDEP_VDSO_LINUX_H #include +#include #ifndef INTERNAL_VSYSCALL_CALL # define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ funcptr (args) #endif -#ifdef HAVE_VSYSCALL - -# include - -# define INLINE_VSYSCALL(name, nr, args...) \ +#define INLINE_VSYSCALL(name, nr, args...) \ ({ \ __label__ out; \ __label__ iserr; \ @@ -59,31 +56,4 @@ sc_ret; \ }) -# define INTERNAL_VSYSCALL(name, err, nr, args...) \ - ({ \ - __label__ out; \ - long v_ret; \ - \ - __typeof (__vdso_##name) vdsop = __vdso_##name; \ - PTR_DEMANGLE (vdsop); \ - if (vdsop != NULL) \ - { \ - v_ret = INTERNAL_VSYSCALL_CALL (vdsop, err, nr, ##args); \ - if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err) \ - || INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS) \ - goto out; \ - } \ - v_ret = INTERNAL_SYSCALL (name, err, nr, ##args); \ - out: \ - v_ret; \ - }) -#else - -# define INLINE_VSYSCALL(name, nr, args...) \ - INLINE_SYSCALL (name, nr, ##args) -# define INTERNAL_VSYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL (name, err, nr, ##args) - -#endif /* USE_VSYSCALL && defined HAVE_VSYSCALL */ - #endif /* SYSDEP_VDSO_LINUX_H */ diff --git a/sysdeps/unix/sysv/linux/x86/gettimeofday.c b/sysdeps/unix/sysv/linux/x86/gettimeofday.c index 190127d31e..8015c40210 100644 --- a/sysdeps/unix/sysv/linux/x86/gettimeofday.c +++ b/sysdeps/unix/sysv/linux/x86/gettimeofday.c @@ -18,10 +18,6 @@ #include #include - -#ifdef HAVE_GETTIMEOFDAY_VSYSCALL -# define HAVE_VSYSCALL -#endif #include static int diff --git a/sysdeps/unix/sysv/linux/x86/time.c b/sysdeps/unix/sysv/linux/x86/time.c index 4a03c46d21..85a9fc8a08 100644 --- a/sysdeps/unix/sysv/linux/x86/time.c +++ b/sysdeps/unix/sysv/linux/x86/time.c @@ -18,16 +18,16 @@ #include #include - -#ifdef HAVE_TIME_VSYSCALL -# define HAVE_VSYSCALL -#endif #include static time_t time_vsyscall (time_t *t) { +#ifdef HAVE_TIME_VSYSCALL return INLINE_VSYSCALL (time, 1, t); +#else + return INLINE_SYSCALL_CALL (time, t); +#endif } #ifdef SHARED From patchwork Tue Dec 17 21:47:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 181912 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6349310ile; Tue, 17 Dec 2019 13:47:49 -0800 (PST) X-Google-Smtp-Source: APXvYqxgtYIWIdshHBNr9k96r+Cy3lJ247/Y1Yh3csgUCJN2lFo3vPcRfu4eBQcoAqooxsdJEb9+ X-Received: by 2002:aca:75d7:: with SMTP id q206mr2960140oic.9.1576619269112; Tue, 17 Dec 2019 13:47:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576619269; cv=none; d=google.com; s=arc-20160816; b=NP+kvs72dDFLp/LPDEr3LhwdTbjpkCN0gvYop3EvaBkyv01UhHdN7j6g5hexJt21ux 17zkxFiBqeC/VlfYNTUk9gyHerfxsr0pA4hWDunNDcL4qm0gjGhBJ5fzIToo3LHfZHZL LpJff+xw1Kiu+o7JjraHiZc89Nuw3gvwzxKpnq51JydbKg+HFRlS6bhWnNI3znqcZy0I Z2yveXV8KdnCy35TvEFI6t4+cMQDaEGC/Fl4lyxZcaLrenhzm1LaCWQdBfD4DC6H7cdB B/rgM+AHmtMYPvlRxg6nNftYMdlMT5qr6Y6XjSF4npC+WOQMC7Wz531jvKmkeQBgZyUN xcPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=iRjQ0sA/OnfmKy+PFVG+M8ot9pfoVgRJ7S+g+jG2lUk=; b=CddOxldRB1dN4ck8oHiNMD4zRauVVKDnD98eGNEvZgI9Fzb9iMZFzxapoQguvtmbGG YNM1j6IY+lnFjApW8RTYZT92VOllpwVqqdGbw9rhO8ZqMrf7z4m/3N52y80b5FhoFRCK a5wdx7IplfzKanbJmW6WrX+nWWXh2TFRNp5/jUNimzV+MegiiS0ZT3TFzN4vHMB+fMCV KgqV0mMI8wvNSEnwkOn9PWxqElmKKx8crz3Q8MoHxbIRn8EXmaV8aawg3u9yYy0DHBwc Gldz5uPFdU9UsnjZyCd+n589ew8zU4cVQR8XyIewIK01n7EkRRqWpgWmILNfnjr/SzIe fX2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=t9EkdYvR; dkim=pass header.i=@linaro.org header.s=google header.b=AvrgwmtJ; spf=pass (google.com: domain of libc-alpha-return-108163-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108163-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z11si13488091oic.119.2019.12.17.13.47.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2019 13:47:49 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-108163-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=t9EkdYvR; dkim=pass header.i=@linaro.org header.s=google header.b=AvrgwmtJ; spf=pass (google.com: domain of libc-alpha-return-108163-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108163-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=GvrhFPqjBC6+2dWzem9n4g0hm7BteHK 0n6qpHGkJ2e9s7SRof56WFbM1qystDtniWeCwPCUfamrTCwIDjn5dOXtS/Uvf1IF ItS7wKSGwvjeWNZ25sJQVQ/Q1IlivfFiIVkXoEHZnMjnmg4MyR2/ig7l46L0GGB7 uffdTo3cKFVI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=63AzUM/oCo7JwKqxdiZN3WwbQqk=; b=t9Ekd YvRFZB561MQHaapmTApbrRwP3OpNqkGfO+iBvNVeRO6B1ywnHsLW5fvrM5QB+W3n FUHbOYOTsPfEa/T0Ql9aqM5pmF/unmgYCui8ntXFLHltX1hJZnrJlUBWMkuakJDg fQRd2pWI6wMDiBcNy+9PXbG6oxbuyJQ1eJe42c= Received: (qmail 109376 invoked by alias); 17 Dec 2019 21:47:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 109365 invoked by uid 89); 17 Dec 2019 21:47:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:__vdso_ X-HELO: mail-pg1-f194.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=iRjQ0sA/OnfmKy+PFVG+M8ot9pfoVgRJ7S+g+jG2lUk=; b=AvrgwmtJcDDQJtORmHFRgrx5pAOqM9IOAnnnGYhIZw0fFJ7LA6T65y4ofAnbf9Hcb+ IwqtaRSPVCEMJgZNBCZnZ5QK4q2t+Mb+lUv6q8Pzx/AcAXLSg5aj7+9c/GBytVTKlFom Don3q/r03PIz1AX/vXr/GsA6QkIntXvXI8i2fuMmz3uP7v/Qu45NQQJDiAZe4OeqlYCA tlSP87PnvxfY+UPrTzz8dJyxJvlK9AFjWKmQ9mhJn7J1feir+Hw+LWAF28fTKPW28aEW cNarznHaNK4KVi3c++C2XijY4WXCBHoN4CLs/3rr3BmKrODyGUacbM2969AIi0SXinuw v/qw== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 02/16] x86: Make x32 use x86 time implementation Date: Tue, 17 Dec 2019 18:47:14 -0300 Message-Id: <20191217214728.2886-2-adhemerval.zanella@linaro.org> In-Reply-To: <20191217214728.2886-1-adhemerval.zanella@linaro.org> References: <20191217214728.2886-1-adhemerval.zanella@linaro.org> Changes from previous version: - Remove unused x32 gettimeofday.c. -- This is the only use of auto-generation syscall which uses a vDSO plus IFUNC and the current x86 generic implementation already covers the expected semantic. Checked on x86_64-linux-gnu-x32. --- sysdeps/unix/sysv/linux/x86_64/x32/gettimeofday.c | 1 - sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list | 1 - 2 files changed, 2 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/gettimeofday.c -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/gettimeofday.c b/sysdeps/unix/sysv/linux/x86_64/x32/gettimeofday.c deleted file mode 100644 index cd342f33ad..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/x32/gettimeofday.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list index 786c884232..58ea31d1fd 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list @@ -2,4 +2,3 @@ personality EXTRA personality Ei:i __personality personality posix_fadvise64 - fadvise64 Vi:iiii posix_fadvise posix_fadvise64 -time - time:__vdso_time@LINUX_2.6 Ei:P time From patchwork Tue Dec 17 21:47:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 181914 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6349625ile; Tue, 17 Dec 2019 13:48:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwuxRhnvVHh4TaUCBT3CH/SFhALAhK8e2bcQZqQq5Yc4K51+BZdQWTECboTnLinej5EXeA5 X-Received: by 2002:aca:1103:: with SMTP id 3mr2904839oir.171.1576619289969; Tue, 17 Dec 2019 13:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576619289; cv=none; d=google.com; s=arc-20160816; b=bu1xWW2VVbYP6hLwUnvQadk/ODpL5KDqVy2OfLPlvBU6M2l/RiLvDKjaIpxfvLHnWz 1CGLD7RyJafWDwJKRoqQoeGYqX1RMnOt6yTdUE873VgtVHHmCjqkFljvd7bTUyQtoFl8 ec5AvZl84J3VMyHMLkdKIxx0/AadHrfylhyFjuscJWry4qJhPTIiBqc9uL9z82LSJvj6 wo701pVNFF+w45nTzfIN5iswhKE4AdHymPJYQXoyYbjAQC2M31uPBYyBatJZ4H8Kv9E/ beHHsV1Imvtvo8G1fslm/iNMC7RFOA5XjIadwoWwMAvd3iuES0jSjuEOngHbB+JX1meT kUXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=jhofP24iy+EIsWqORv9KnFvA524I9prsM9/VYL+ZFL0=; b=z6UxrbkFxfLhX6sDgqA8RxxXnPN6WjLBDylnt5KKO9S2Vd4/V71FI2ozIwHWaUB6cq OZFOVsYDEcVQVsOQ2l7QsoLsEQf2A0gqStMGUoKOErjzwdZYstq7r3t+ybnRaYJ9p6wV tQHXU4jetuUkRkP4z3tNFL0b98jFfMlGfYoWAgXzK/hS2fnGPRahBWgSv3GFOCIgY5BS 2D2iRoD4rS4aHGyaTcgcjBwPqBz2PwBJ6i1O/ml/tQSNWFMvoqKNw9G0hqy5NF0JYyH3 FLgo3i0twechLuAxL7/dg0O5ncdmRGdGkmS2LWgVgIe4AhPrn4DP7ymOAmhcysLt+Xi/ 80XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=pqJnzbBi; dkim=pass header.i=@linaro.org header.s=google header.b=Z+wLbZJJ; spf=pass (google.com: domain of libc-alpha-return-108165-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108165-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 194si2118053oii.2.2019.12.17.13.48.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2019 13:48:09 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-108165-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=pqJnzbBi; dkim=pass header.i=@linaro.org header.s=google header.b=Z+wLbZJJ; spf=pass (google.com: domain of libc-alpha-return-108165-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108165-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=lTc3uzRc+5ziFNdlJDFNmyCOPSqveC2 WKClsfopmNUmRTGZMrbspEL1YmJMzsiiL7pixpACh+bGB9zhtMLtc9+RbYbBJyZK CzBBFSfrz4cNDepdJWvQEIQ0DAxskQZaTBatT3cj1KfyEbb5H72oWVA8bbYuSMWK /oyknZxftUVs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=TTozQ/otqIR+N9gLRGWzZEx6gxc=; b=pqJnz bBi0cYVgxLCzOMwbMSVxGh5fZZBplM1rpZrxYtK6VK45o2pAvYEKMENq0cY7Terw CeTp/zPh8Ixq5cms4qB8wNP8aIiPylmtUuOq+vuZA69urPOkJBN08Urg79kaAdFu O1Ar3b77Kg6yze77eHCMZS9jfv03TYycjtd2Ok= Received: (qmail 109673 invoked by alias); 17 Dec 2019 21:47:41 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 109625 invoked by uid 89); 17 Dec 2019 21:47:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-HELO:sk:mail-pj X-HELO: mail-pj1-f65.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=jhofP24iy+EIsWqORv9KnFvA524I9prsM9/VYL+ZFL0=; b=Z+wLbZJJC322wqgvd5kzOPKu3051tcBRDYJR5A/+MoqpbbdvciRNrY1h7i7TksLvHc x1mOP/xASX7PNiE35aeb9zQLe22EmGgNiLdyjsesB8A2wBdBCIWfOJweOqDHyJYlsHeY BnduzXMQd3BLzT6I+lifsVDD2ypxP+so1q8esKgUeKFf/PdQUKRbP5qkIt2s0TFoyYFO SQlqthfqZfNxqbDEeguwWv/YFpvijBZ+o1y4+JNj5tC8EdXzcRH6N5cWfwAILw5mcKfQ /GQbVK9+cM2WDitF7hVUhiIozZA74MA3i9wKEfAfZ2jx+CYq5EhbhPXbmNxsH1JDd5p3 AH7g== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 03/16] Remove vDSO support from make-syscall.sh Date: Tue, 17 Dec 2019 18:47:15 -0300 Message-Id: <20191217214728.2886-3-adhemerval.zanella@linaro.org> In-Reply-To: <20191217214728.2886-1-adhemerval.zanella@linaro.org> References: <20191217214728.2886-1-adhemerval.zanella@linaro.org> The auto-generated vDSO call shows some issues: - It requires sync the auto-generated C file with current glibc implementation; - It still uses symbol redirections hacks where libc-symbols.h provide macros that uses compiler builtins (libc_ifunc_redirected for instance); - It does not handle all required compiler handling (inhibit_stack_protector on iFUNC resolver). - No architecure uses it. Checked with a build against all major ABIs. --- sysdeps/unix/make-syscalls.sh | 45 +---------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) -- 2.17.1 diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh index fe24bbc78f..c07626677f 100644 --- a/sysdeps/unix/make-syscalls.sh +++ b/sysdeps/unix/make-syscalls.sh @@ -149,14 +149,6 @@ emit_weak_aliases() echo "$calls" | while read file srcfile caller syscall args strong weak; do - vdso_syscall= - case x"$syscall" in - *:*@*) - vdso_syscall="${syscall#*:}" - syscall="${syscall%:*}" - ;; - esac - case x"$syscall" in x-) callnum=_ ;; *) @@ -233,10 +225,9 @@ while read file srcfile caller syscall args strong weak; do if test $shared_only = t; then # The versioned symbols are only in the shared library. echo "shared-only-routines += $file" - test -n "$vdso_syscall" || echo "\$(objpfx)${file}.os: \\" + echo "\$(objpfx)${file}.os: \\" else object_suffixes='$(object-suffixes)' - test -z "$vdso_syscall" || object_suffixes='$(object-suffixes-noshared)' echo "\ \$(foreach p,\$(sysd-rules-targets),\ \$(foreach o,${object_suffixes},\$(objpfx)\$(patsubst %,\$p,$file)\$o)): \\" @@ -268,40 +259,6 @@ while read file srcfile caller syscall args strong weak; do echo ' ) | $(compile-syscall) '"\ \$(foreach p,\$(patsubst %$file,%,\$(basename \$(@F))),\$(\$(p)CPPFLAGS))" - if test -n "$vdso_syscall"; then - # In the shared library, we're going to emit an IFUNC using a vDSO function. - # $vdso_syscall looks like "name@KERNEL_X.Y" where "name" is the symbol - # name in the vDSO and KERNEL_X.Y is its symbol version. - vdso_symbol="${vdso_syscall%@*}" - vdso_symver="${vdso_syscall#*@}" - vdso_symver=`echo "$vdso_symver" | sed 's/\./_/g'` - cat <'; \\ - echo '#undef ${strong}'; \\ - echo '#define vdso_ifunc_init()'; \\ - echo '__ifunc (__redirect_${strong}, ${strong},'; \\ - echo ' get_vdso_symbol ("${vdso_symbol}"), void,'; \\ - echo ' vdso_ifunc_init)'; \\ -EOF - # This is doing "hidden_def (${strong})", but the compiler - # doesn't know that we've defined ${strong} in the same file, so - # we can't do it the normal way. - cat < X-Patchwork-Id: 181915 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6349860ile; Tue, 17 Dec 2019 13:48:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxrQ0K9/AwHoI5IAtnlq8qHCa3QkYna9g0fs0MOGedym8h8iWWBfCAh/LoJEzLryXTT5QwI X-Received: by 2002:a9d:6c01:: with SMTP id f1mr38430289otq.133.1576619303602; Tue, 17 Dec 2019 13:48:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576619303; cv=none; d=google.com; s=arc-20160816; b=ZZINXgTyZq0c//qcQ6+3GtAVg1W1KV+WuS4tPQPakE+HHPaY3Gjpoif/abfKver9Jy RN5MbBM6fp2fxKpBLeWnn0QNyq24g10ziST7H6YImWZ9Mlqu3H70PMetoWdX5r5f2SyN 06y8WjfqyBEABDR8ZeTsLSBcmIQeNsUZsVgIdnNA41cUe8j0wO9CoxdFhRXjdsusaMnU Hrm763s1Otcckl8ay1mwA4CUJIcwxWRLEeYWIOPwgCWZTMMijfKKssOQAXmfQpiu3tUp byVfV4K+KEpe2K7KqVrsfrqcC/+iw2pCxQSAbur095qj7PwX0eMsAMTw5Mk5whRJ9s3B uI8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=NUQAsUcV48k34hRw3/1PawKagDwE4erEMipNDJq7Lcw=; b=SSJP/wWn9iHdQOsumpaF1NX4fIjOmA/XvXGMRf98L45K99ViNaQu7QN03NYoQQGme6 wIQNqR2jNNUJuqefMCEFyowSKiCVlpCqDcXlAyUNtr4efS0VnC33VHWROidrQ7grieYn 9Ptx09cr3gVbSidBfI6Biw2tKWR91BSHx54hf5gBaEglqggZOdu7zgPM6FfrZ4QOT7Pl Cc37BRmZMwPSTELO3ZT9gmDQvelD8cfeZN62upqJtR92yzyzr+WRRL42vQ6zAu/yrxgp RVPow9V/MRSWIiATHxfvcioNifShoF4weKbMGbejvnuBj98XGcaqIZhpXhLY/y8xS7UU urtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qvGgEjCU; dkim=pass header.i=@linaro.org header.s=google header.b=uHqllbLC; spf=pass (google.com: domain of libc-alpha-return-108166-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108166-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g9si12674688otq.68.2019.12.17.13.48.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2019 13:48:23 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-108166-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qvGgEjCU; dkim=pass header.i=@linaro.org header.s=google header.b=uHqllbLC; spf=pass (google.com: domain of libc-alpha-return-108166-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108166-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=u0wmNfEkIrlOuFWlh/rBKHiCrFnl0X3 JGeX5t376OGCiViaXvAL1/w8QuIHnRgdQB9aFeqP9o6WR3gtzVxNna/ODVQzW1kW JlKwiS7XvDmLSENqJgJ6VNjYTPfbGDaYmJ3jqpH1lNxuIPfTjF5GHVrJeDjsTeyA bOPrAmEkUGKM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=LeLk8kpMuF+xQzEVZHP+JwR11LE=; b=qvGgE jCUi0O5ibOVX2tfgnTDLP4qX8rl+5R6ZCJqCS/BSHSiYSthJPwFkMjqAFANg9uHt +y0Wt63k/bjUZTFoGmh9H/vlVrjR/tjT7cccG/HOMdNQcoIFhkqeBsAd2RprFzEG 0UTtPpgHR2b+vPW0fqcMAIXGW9bov3DROx9K4M= Received: (qmail 109852 invoked by alias); 17 Dec 2019 21:47:42 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 109806 invoked by uid 89); 17 Dec 2019 21:47:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=5.3 X-HELO: mail-pg1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=NUQAsUcV48k34hRw3/1PawKagDwE4erEMipNDJq7Lcw=; b=uHqllbLCY8n1oYh/P78jwaZm58dmsft8qI3tQbM+S9zZjL1LqX4Bt1hHcmCxoARVqJ w0pDIw/+1VfFm1XCCSG7poQFZAXWx9SgMk47e5dIZP9saPJRvDq9ryzJ8WBFZjJneebI rXclrCilBzMrTEudFqu2G8FWJvRUfUVKdJDx7XjSET+ilckNpHfQos42tbAGUiOEKoN5 y4HLVKM8X7EraVxrtN9A5iuNjVoKXBcvYXfeA2nE3o7SQHxYDDSQvXzjmzaiQDfdd5Eo IwuI9QvwP2dDObv+3q3UfD/5QeUerZwYbYZeL/P2OaJYgiJ2dqG7TlOeocWqKEAB7HiU twfQ== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 04/16] linux: Update x86 vDSO symbols Date: Tue, 17 Dec 2019 18:47:16 -0300 Message-Id: <20191217214728.2886-4-adhemerval.zanella@linaro.org> In-Reply-To: <20191217214728.2886-1-adhemerval.zanella@linaro.org> References: <20191217214728.2886-1-adhemerval.zanella@linaro.org> Add the missing time and clock_getres vDSO symbol names on x86. For time, the iFUNC already uses expected name so it affects only the static build. The clock_getres is a new implementation added on Linux 5.3 (f66501dc53e72). Checked on x86-linux-gnu and i686-linux-gnu. --- sysdeps/unix/sysv/linux/i386/sysdep.h | 2 ++ sysdeps/unix/sysv/linux/x86/time.c | 4 ---- sysdeps/unix/sysv/linux/x86_64/sysdep.h | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index 7066ddc214..b2e750d490 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -315,6 +315,8 @@ struct libc_do_syscall_args /* List of system calls which are supported as vsyscalls. */ # define HAVE_CLOCK_GETTIME_VSYSCALL "__vdso_clock_gettime" # define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday" +# define HAVE_TIME_VSYSCALL "__vdso_time" +# define HAVE_CLOCK_GETRES_VSYSCALL "__vdso_clock_getres" /* Define a macro which expands inline into the wrapper code for a system call. This use is for internal calls that do not need to handle errors diff --git a/sysdeps/unix/sysv/linux/x86/time.c b/sysdeps/unix/sysv/linux/x86/time.c index 85a9fc8a08..67188a2ceb 100644 --- a/sysdeps/unix/sysv/linux/x86/time.c +++ b/sysdeps/unix/sysv/linux/x86/time.c @@ -23,11 +23,7 @@ static time_t time_vsyscall (time_t *t) { -#ifdef HAVE_TIME_VSYSCALL return INLINE_VSYSCALL (time, 1, t); -#else - return INLINE_SYSCALL_CALL (time, t); -#endif } #ifdef SHARED diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h index 475b7d991a..965fd4b851 100644 --- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h +++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -376,7 +376,9 @@ /* List of system calls which are supported as vsyscalls. */ # define HAVE_CLOCK_GETTIME_VSYSCALL "__vdso_clock_gettime" # define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday" +# define HAVE_TIME_VSYSCALL "__vdso_time" # define HAVE_GETCPU_VSYSCALL "__vdso_getcpu" +# define HAVE_CLOCK_GETRES_VSYSCALL "__vdso_clock_getres" # define SINGLE_THREAD_BY_GLOBAL 1 From patchwork Tue Dec 17 21:47:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 181916 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6349997ile; Tue, 17 Dec 2019 13:48:33 -0800 (PST) X-Google-Smtp-Source: APXvYqx2C77DUwoqF2Sf7CYAg2SxHgMlXVl7BdQLjxGAI2Tg1pN4/Ekldv07ZH1BDg2o5bPLcdsU X-Received: by 2002:a05:6830:1442:: with SMTP id w2mr1600446otp.143.1576619313201; Tue, 17 Dec 2019 13:48:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576619313; cv=none; d=google.com; s=arc-20160816; b=ulY++hnrj6DOMsLuOnww3hp4+CGW0cL8Oj5aOfwWVw7j20lXwd/XxhpgffO4KhqrPm V7AA5JifsiMKl3+2X2AzjFpNSX5KkWqGFO6JHY5BCtQkS7HhrzVYJ1VQL6fbt6XYWcDB sXyxMOvL0YTlptptnF0klpAz6SxBfPfVC+nVogCjO3yRGjRXjtS0Gq8deshHnNPz3sJB zkYLeos0WShmDo4hPz4hfl9ULxrA+MJH4XpFCwQL2weoR3r2LWYYw+uV11LurF1lmls7 6wstgPZNFKf6CVq3mSNwfhYFxtC4EhwhXz5hcMzc2+pkcpz2U+3cPzHv74+bz0WuRGI8 kJ2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=R6YfmEhYhDYV1EwEVtsdvXCEyOTQdgGb7QiEqPpbF04=; b=YbWhgKBrgNkGhFSGU9ST0GUKsYLprNyYETXpXQtuyD47S/o2zg6bCb/XlHzwDSuMQ2 hR/WQ++EKXJprPyxERqz7QGGFvc/udmPkfdZnRPMNz319qc9gEqU2dnlcSW0/+VfwXZ0 lR/6miPvXkk+03xBV0W75Ka4ZukmRORrhyxf0gyhOR1NB6qXpgF/LmhxDM22BJZLUjBH hIhhMpjPPDf6HPhqSmIIZ/mC12jw7K55RslxdB7XFfOmUyX/aLJi25xRGR0hs8vT/KLD qVJba5twAqgSmqqoCUY33qs+t0AJoPkEcvxrKTcav/vZkxx2uXu7eOdLQ+aEok0/rGOs EUlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=nApsBWJt; dkim=pass header.i=@linaro.org header.s=google header.b="eKyw1jB/"; spf=pass (google.com: domain of libc-alpha-return-108167-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108167-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id p3si12894498otk.154.2019.12.17.13.48.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2019 13:48:33 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-108167-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=nApsBWJt; dkim=pass header.i=@linaro.org header.s=google header.b="eKyw1jB/"; spf=pass (google.com: domain of libc-alpha-return-108167-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108167-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=yPHWk2DQP6tj/tveo6Eoo7SLhkjYV8O cJy9unXE46G4a3OvBvZv7PBz6xz//qJZOPKcyl9/Ob82E6tamHm3PjWpj6cAk+by gB9Hy0CFFwxblSwcYSgnDoBISwusnqD+svP1+sISjDPcNmAS1UkPxXDcSw4YvCuH DeqeuDoRAbgA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=DBA7BTL/WRXCVT5A0up9ZG8ptcc=; b=nApsB WJtTxjCLyl4KvbvQuJRcDfSU3cUnEQV65bH/q/9eOc0ci11aZ2U+KZacilkJi6nj 4N3iTM1U7u0Mo5rCu9PleEkO1Go+KN2jc0Mhhrqt54Zf7mPX7JSqmW0yRYl7mWnH FxvP7szRmOBY0KIo5qX1nbZ8oPbi6IFieF/Kh8= Received: (qmail 110050 invoked by alias); 17 Dec 2019 21:47:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 109976 invoked by uid 89); 17 Dec 2019 21:47:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-pl1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=R6YfmEhYhDYV1EwEVtsdvXCEyOTQdgGb7QiEqPpbF04=; b=eKyw1jB/NJuGoESpvjX2576X+rdQxpO8Q7tMZ+zwFOvY/CIgwqQZDng/7dOo+pMczB iHukt54T7hb6F11OHn/txO0A6+OtuE9BUzns0bUbdLGkygv91Rh6brwl3MvsH7b1HUTo P/5EcZsJkEsRqXACE0C/boA4huqzoygWSWk0+E3cfORvufK+OPs/ZqLUbpX+4flkKUzZ 0rW596/S/xubMghaKVjyprCxETOzc0ev1k1LjuepnzSFvANRnvYTqubvM9bn4mZ3A2cm ZJEzSJ6acTgK9GHTy/ZoJS1b6sxRVW6ixuzm8UHRSorhM0QcI3yCHSKGNdU5mRFywozG NEBg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 05/16] linux: Update mips vDSO symbols Date: Tue, 17 Dec 2019 18:47:17 -0300 Message-Id: <20191217214728.2886-5-adhemerval.zanella@linaro.org> In-Reply-To: <20191217214728.2886-1-adhemerval.zanella@linaro.org> References: <20191217214728.2886-1-adhemerval.zanella@linaro.org> The clock_getres is a new implementation added on Linux 5.4 (abed3d826f2f). Checked with a build against mips-linux-gnu and mips64-linux-gnu. --- sysdeps/unix/sysv/linux/mips/sysdep.h | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/mips/sysdep.h b/sysdeps/unix/sysv/linux/mips/sysdep.h index 82a3cf9f3d..c2bec03806 100644 --- a/sysdeps/unix/sysv/linux/mips/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/sysdep.h @@ -22,6 +22,7 @@ /* List of system calls which are supported as vsyscalls. */ #define HAVE_CLOCK_GETTIME_VSYSCALL "__vdso_clock_gettime" #define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday" +#define HAVE_CLOCK_GETRES_VSYSCALL "__vdso_clock_getres" #ifndef __ASSEMBLER__ From patchwork Tue Dec 17 21:47:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 181917 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6350139ile; Tue, 17 Dec 2019 13:48:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxzQMlQwHrcUhHOkPx6+zQM/1ELme9c8BL2/JTJDr9IcEmEJayDcxmFqSPQdFp5cFGjMkvJ X-Received: by 2002:a05:6830:1bf1:: with SMTP id k17mr39606319otb.101.1576619323165; Tue, 17 Dec 2019 13:48:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576619323; cv=none; d=google.com; s=arc-20160816; b=KbYkfj25dzWRtvNgwAMx3Bs3NgUrMkBWD2Bsv78weNpeolzQjzci/nLgsp9RfRrkI1 kp0wRQEIJJbH5fsm10m7ydCMhgIzAzTzm9ZHbxqZX5EGEB1nn8+CTCrw6j8fEd/uorGy rOlA0g3t/JZtufmGC4jPOt/fQQKdNzZmscaG2ZQMF46hcV6udv9igEExOE0HFtUfQcgE X/tUSZaosUr0reoeAIL40bH4Z8CicGoZhzZGa7lTlFfwpjmbGnmCES6U4YvJFQSNEeCI VLrXaOZF6jJM8E2IGlNZaqhtDHzjnsPA5yrM0SzJhrs4U4/e/wrFLmCj59NTnnfjgoZJ OKVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=IIuAdZVF2aJgLYlG8U70B93H4H5XyR7ZjkbmnZah82w=; b=je83s/AjYw8eRRM8aiz2FL2AlC8cVBGjTVWW9ILhElvbfEDNo1VDNLWx349CEcBZRe 1KDv+77Gmjefl9G6IM4fl6w/jlHtjA3S3niBFGZtYAMcuubIJ4nY3yxSQlCExFQLjRc8 wvxZIJ+nshmalfheeibkaMbOy9f2zmNQl49+Hsil1zbmyv7jDq9qYxFf+zDOKxWsj35e 42ja/lGB0aWST3VjdlXo0yePDEZsWX1zR0yw+E+yFfbp1kXjy1JAGosQRrO/q49zUWFw gV5p4aTc7z8dnBNjn4J87o5gFA7ntBAf3G7eoayufntuSKZSYho3Yi7ExReqRF6goiBA ffiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TSivZAkD; dkim=pass header.i=@linaro.org header.s=google header.b=CGGZos12; spf=pass (google.com: domain of libc-alpha-return-108168-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108168-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u30si14295617otj.268.2019.12.17.13.48.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2019 13:48:43 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-108168-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TSivZAkD; dkim=pass header.i=@linaro.org header.s=google header.b=CGGZos12; spf=pass (google.com: domain of libc-alpha-return-108168-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108168-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=Z8ZJznCuME2OyAjj7cIjC/16QPQ7Pi9 P2XO8tlO0wZtQRgNW65211jfnAyvQ9Jp5zLK0jgI8j2YeIICdcGgZo6RPB64CY8e t2JnxUZfbA1/4VLwnW1UX/Qu4xwaOmg8vmy8zJ+1fyk2rDXD67C1FGBG/d1dSwrt HUtExb6MBSKA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=doqqrwj4k32e2QcT9kKA/au5FUs=; b=TSivZ AkDELaA4rGuadnA6k7wz4msOWfVHMNCJKIXQMJJQdJ5d+zD9mitxtbHgiXdbUfQM D8mrQkbzTlPBHKiOD+vkPxNs/Gb43FgqpT6InLe2wssymZXndK927+AHcZXKkeEi iJwswgHsCCo0e0GvLOXmSZjHG//xfQFIM9SlA8= Received: (qmail 110447 invoked by alias); 17 Dec 2019 21:47:47 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 110382 invoked by uid 89); 17 Dec 2019 21:47:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=consolidate, Consolidate X-HELO: mail-pj1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=IIuAdZVF2aJgLYlG8U70B93H4H5XyR7ZjkbmnZah82w=; b=CGGZos12QW4k1XaRxPreMlHLdMrKL3LJQUTBdtnGKK34/dX0b/IhpzHcF9MGQDQZS/ Oim2Kg6LVBA51YMemOjys1AbPok7NpviuuMBvoZza4dnsWJRqsKFVmdYlTEFk2MRCL+L 2E9p0f8HSR7Z4GPu2mlcKNW60yawn7SlRulrr36JAe51rd3ywt4+xapPTdd2Mytu3i8R trVwnTbkTvjxqzNF4bfFBV9XCutyXF+KeOGkaX5pFtaLsY0yxPGxYVgoHUDfvJ7oV/cr oeEvHhklAFpC4wrrDejmE7vx4l+iBZdmtdVrUBYb+IgvwOwByvXvkEct9Tj39nLVAtm+ GHpw== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 06/16] linux: Consolidate Linux gettimeofday Date: Tue, 17 Dec 2019 18:47:18 -0300 Message-Id: <20191217214728.2886-6-adhemerval.zanella@linaro.org> In-Reply-To: <20191217214728.2886-1-adhemerval.zanella@linaro.org> References: <20191217214728.2886-1-adhemerval.zanella@linaro.org> The IFUNC bypass to vDSO is used when USE_IFUNC_GETTIMEOFDAY is set. Currently aarch64, powerpc*, and x86 defines it. Otherwise the generic implementation is used, which calls clock_gettime. Checked on aarch64-linux-gnu, powerpc64le-linux-gnu, powerpc64-linux-gnu, powerpc-linux-gnu-power4, x86_64-linux-gnu, and i686-linux-gnu. --- .../unix/sysv/linux/aarch64/gettimeofday.c | 38 +------------ sysdeps/unix/sysv/linux/gettimeofday.c | 57 +++++++++++++++++++ .../unix/sysv/linux/powerpc/gettimeofday.c | 35 +----------- sysdeps/unix/sysv/linux/x86/gettimeofday.c | 33 +---------- 4 files changed, 63 insertions(+), 100 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/gettimeofday.c -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c index 143c5c1507..f28260c8e9 100644 --- a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c +++ b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c @@ -16,39 +16,5 @@ License along with the GNU C Library; if not, see . */ -/* Get the current time of day and timezone information, - putting it into *tv and *tz. If tz is null, *tz is not filled. - Returns 0 on success, -1 on errors. */ - -#include -#include -#include - -/* Used as a fallback in the ifunc resolver if VDSO is not available - and for libc.so internal __gettimeofday calls. */ -static int -__gettimeofday_vsyscall (struct timeval *restrict tv, void *restrict tz) -{ - if (__glibc_unlikely (tz != 0)) - memset (tz, 0, sizeof *tz); - - return INLINE_VSYSCALL (gettimeofday, 2, tv, tz); -} - -#ifdef SHARED -# include -# include - -# define INIT_ARCH() -libc_ifunc (__gettimeofday, - (get_vdso_symbol (HAVE_GETTIMEOFDAY_VSYSCALL) - ?: __gettimeofday_vsyscall)) - -#else -int -__gettimeofday (struct timeval *restrict tv, void *restrict tz) -{ - return __gettimeofday_vsyscall (tv, tz); -} -#endif -weak_alias (__gettimeofday, gettimeofday) +#define USE_IFUNC_GETTIMEOFDAY +#include diff --git a/sysdeps/unix/sysv/linux/gettimeofday.c b/sysdeps/unix/sysv/linux/gettimeofday.c new file mode 100644 index 0000000000..600da6b468 --- /dev/null +++ b/sysdeps/unix/sysv/linux/gettimeofday.c @@ -0,0 +1,57 @@ +/* gettimeofday - set time. Linux version. + Copyright (C) 2019 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* Some architecture might optimize the gettimeofday by setting the plt direct + to vDSO symbol by using a IFUNC. */ +#ifdef USE_IFUNC_GETTIMEOFDAY +# include +# include +# include + +# ifdef SHARED +# include + +static int +__gettimeofday_syscall (struct timeval *restrict tv, void *restrict tz) +{ + if (__glibc_unlikely (tz != 0)) + memset (tz, 0, sizeof *tz); + return INLINE_SYSCALL_CALL (gettimeofday, tv, tz); +} + +# undef INIT_ARCH +# define INIT_ARCH() \ + void *vdso_gettimeofday = get_vdso_symbol (HAVE_GETTIMEOFDAY_VSYSCALL) +libc_ifunc (__gettimeofday, + vdso_gettimeofday ? VDSO_IFUNC_RET (vdso_gettimeofday) + : (void *) __gettimeofday_syscall) + +# else +int +__gettimeofday (struct timeval *restrict tv, void *restrict tz) +{ + if (__glibc_unlikely (tz != 0)) + memset (tz, 0, sizeof *tz); + + return INLINE_VSYSCALL (gettimeofday, 2, tv, tz); +} +# endif +weak_alias (__gettimeofday, gettimeofday) +#else /* USE_IFUNC_GETTIMEOFDAY */ +# include