From patchwork Tue Nov 5 23:42:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 35663 Received: (qmail 31924 invoked by alias); 5 Nov 2019 23:48:35 -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 31683 invoked by uid 89); 5 Nov 2019 23:48:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: esa4.hgst.iphmx.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1572997690; x=1604533690; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=nyhx2+aziJfOFFdBlOWC5VOwbrhjw7387v+m996PMiY=; b=TTekvxy4z0CMwuOlFA9ikSIlj/NXXuKeNznKQVzsIaOFUSC1KIBsQsvc j//7k4FXXOHVpZooQmAeoV8GP0sAGt9wg1XdKolE5BQvgigiS3FAwixUr X8ia0J6+u9xRUQhAfIoHbhghjHTYJZBp0a5TZYOfDdGlBBoCKlYekf9In ZssCMxb8fTqS2orF5IT3kDO8dSTwXHetC6maDrwAqOA4BwqaXOmFoIqjC Q13FzSYnB1r9LSUVr7wA6vQN8rwb5ynQEIyTkEDvk2kIu/3+3YlPLPyBD 3pIPW+Mp0sF/0cNvP2/7c2kYudtN3xJdCRA+XaFbpFuscsKlQubMTFwSA g==; IronPort-SDR: qH8Eac6g1w0z816xy2mn9KWn3BrxG2kFq/tfV6Wxw0YiXXVVjTzI2QCB/RPd6T0k2QvtbbBJeT 4aTkpJWlLX2QFQ1gByqJsu+WWwTUOQ6osDTStru5Rnlwl5PZHUSm9nayyeKDf9hArX+BPFOeJB Q5BXAUzKJyqL7p3/ISmzRO/Vcp7RzB0XKzt5Ec22QIqFgpfbS0U1ppJeDeU3C5j4sQ51+Ov+gP u0xPOVhqcZ5O/9Vu4EyQyHR3IxfIXPITl+jx45tw8mNFlhcvMcgdljEJUo05DjrYrPEuscYcoS TTs= IronPort-SDR: cbKftW7HRx/BJwng1WxBZaEEhiqSv94ZFktJ3m6ozoWR+3eX0UC6jcYSjgjEO8OwF2XYGp9SwN gEJbmU5u0OryrzJ4yh/8HokiCIIvgClcuyFyHgfvt/8EnFi1+6SDToPkuZyAyq3DZYx/LuxM5C F4uv5FnIyRKLyJR18Mvc9YIPyv1kIE2c5t11pPCfxI4SC/ZWJNTY5NjZUApa3ZCi2beUrepedy N34kupZE+fshnEsDNNcTmdEy1n7HRjYcH5sdakr6ENS1V7oPFGV9Wk3ndigSCgmfibRPT/oWN5 nHFmLxiKvYytrYueQTxadpEk IronPort-SDR: VAe6CZG3a8AdROFrpD2YkcJyst7RF13AtntGlyuNp64JdklrLuonkHWxI07H0lOCRCXdpW/vlj GZXyxu855T4cyL7UIsSNik0/lz9DXABb4FtYf3URwgbD8bsUPtBAQ0oE/slZqkCUCbg3jViB2f 9cgA2hMYMCRB1bd3VjXKhtZwHKaZwdnP0rKw6b7Ul5S3AdHQbG1Xgi5detOuE1wWTcoCnFEM6U tHoGDXy9FzhC6GBIcYGKoraPQmSbF5pmjNLhZdHyyvJ1BoEh4Qz3EYMFuT1+4Em2S4Dm6Wa3Ga Xuw= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH 1/2] sysdeps: Add clock_gettime64 vDSO Date: Tue, 5 Nov 2019 15:42:48 -0800 Message-Id: <20191105234249.25626-1-alistair.francis@wdc.com> MIME-Version: 1.0 Add support for the clock_gettim64 vDSO calls. These are protected by the HAVE_CLOCK_GETTIME64_VSYSCALL define. HAVE_CLOCK_GETTIME64_VSYSCALL should be defined for 32-bit platforms (WORDSIZE == 32) that only run on the 5.1 kernel or later. WORDSIZE == 64 platforms can use #define __vdso_clock_gettime64 __vdso_clock_gettime and use the __vdso_clock_gettime syscall as they don't have a __vdso_clock_gettime64 call. * sysdeps/unix/sysv/linux/init-first.c: Add clock_gettime64 vDSO. * sysdeps/unix/sysv/linux/libc-vdso.h: Likewise. --- This was patch was runtime tested with RV32 and RV64 It was build tested using the ./scripts/build-many-glibcs.py script. I will run: $ make ; make install ; make check tests on native ARM (32-bit) with the following three confiugrations: - 4.19 Kernel and 4.19 Headers - 5.2 Kernel and 4.19 Headers - 5.2 Kernel and 5.2 Headers I should have the results later this week. sysdeps/unix/sysv/linux/init-first.c | 10 ++++++++++ sysdeps/unix/sysv/linux/libc-vdso.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c index d90ca820be0..d005d133220 100644 --- a/sysdeps/unix/sysv/linux/init-first.c +++ b/sysdeps/unix/sysv/linux/init-first.c @@ -24,6 +24,11 @@ int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *) attribute_hidden; #endif +/* vDSO symbol used on clock_gettime64 implementation. */ +#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL +int (*VDSO_SYMBOL(clock_gettime64)) (clockid_t, struct __timespec64 *) + attribute_hidden; +#endif /* vDSO symbol used on clock_getres implementation. */ #ifdef HAVE_CLOCK_GETRES_VSYSCALL int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *) @@ -52,6 +57,11 @@ __libc_vdso_platform_setup (void) = get_vdso_mangle_symbol (HAVE_CLOCK_GETTIME_VSYSCALL); #endif +#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL + VDSO_SYMBOL(clock_gettime64) + = get_vdso_mangle_symbol (HAVE_CLOCK_GETTIME64_VSYSCALL); +#endif + #ifdef HAVE_CLOCK_GETRES_VSYSCALL VDSO_SYMBOL(clock_getres) = get_vdso_mangle_symbol (HAVE_CLOCK_GETRES_VSYSCALL); diff --git a/sysdeps/unix/sysv/linux/libc-vdso.h b/sysdeps/unix/sysv/linux/libc-vdso.h index 792ac39d85a..c6d505bab39 100644 --- a/sysdeps/unix/sysv/linux/libc-vdso.h +++ b/sysdeps/unix/sysv/linux/libc-vdso.h @@ -32,6 +32,10 @@ extern int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *) attribute_hidden; #endif +#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL +extern int (*VDSO_SYMBOL(clock_gettime64)) (clockid_t, struct __timespec64 *) + attribute_hidden; +#endif #ifdef HAVE_CLOCK_GETRES_VSYSCALL extern int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *) attribute_hidden;