From patchwork Wed Aug 17 13:18:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 9285957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3663460459 for ; Wed, 17 Aug 2016 13:21:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2977529AC0 for ; Wed, 17 Aug 2016 13:21:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E1B529AC2; Wed, 17 Aug 2016 13:21:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9C61629AC0 for ; Wed, 17 Aug 2016 13:21:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1ba0kX-0001By-In; Wed, 17 Aug 2016 13:19:17 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1ba0kS-00018R-Ub for linux-arm-kernel@lists.infradead.org; Wed, 17 Aug 2016 13:19:14 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8A12DADC9; Wed, 17 Aug 2016 13:18:49 +0000 (UTC) From: Andreas Schwab To: Yury Norov Subject: Re: [PATCH 17/18] arm64:ilp32: add vdso-ilp32 and use for signal return References: <1471434403-25291-1-git-send-email-ynorov@caviumnetworks.com> <1471434403-25291-18-git-send-email-ynorov@caviumnetworks.com> X-Yow: How's the wife? Is she at home enjoying capitalism? Date: Wed, 17 Aug 2016 15:18:48 +0200 In-Reply-To: <1471434403-25291-18-git-send-email-ynorov@caviumnetworks.com> (Yury Norov's message of "Wed, 17 Aug 2016 14:46:42 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160817_061913_401372_766418B1 X-CRM114-Status: UNSURE ( 9.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, szabolcs.nagy@arm.com, catalin.marinas@arm.com, heiko.carstens@de.ibm.com, cmetcalf@ezchip.com, philipp.tomsich@theobroma-systems.com, joseph@codesourcery.com, linux-arch@vger.kernel.org, zhouchengming1@huawei.com, Prasun.Kapoor@caviumnetworks.com, agraf@suse.de, geert@linux-m68k.org, kilobyte@angband.pl, manuel.montezelo@gmail.com, arnd@arndb.de, pinskia@gmail.com, linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, bamvor.zhangjian@huawei.com, linux-arm-kernel@lists.infradead.org, maxim.kuvyrkov@linaro.org, libc-alpha@sourceware.org, Nathan_Lynch@mentor.com, linux-kernel@vger.kernel.org, schwidefsky@de.ibm.com, davem@davemloft.net, christoph.muellner@theobroma-systems.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Aug 17 2016, Yury Norov wrote: > diff --git a/arch/arm64/kernel/vdso/gettimeofday.S b/arch/arm64/kernel/vdso/gettimeofday.S > index e00b467..143b39e 100644 > --- a/arch/arm64/kernel/vdso/gettimeofday.S > +++ b/arch/arm64/kernel/vdso/gettimeofday.S > @@ -25,6 +25,16 @@ > #define NSEC_PER_SEC_LO16 0xca00 > #define NSEC_PER_SEC_HI16 0x3b9a > > +#ifdef __LP64__ > +#define PTR_REG(n) x##n > +#define OFFSET(n) n > +#define DELOUSE(n) > +#else > +#define PTR_REG(n) w##n > +#define OFFSET(n) COMPAT_##n > +#define DELOUSE(n) mov w##n, w##n > +#endif > + > vdso_data .req x6 > seqcnt .req w7 > w_tmp .req w8 > @@ -136,6 +146,8 @@ x_tmp .req x8 > /* int __kernel_gettimeofday(struct timeval *tv, struct timezone *tz); */ > ENTRY(__kernel_gettimeofday) > .cfi_startproc > + DELOUSE(0) > + DELOUSE(1) > adr vdso_data, _vdso_data > /* If tv is NULL, skip to the timezone code. */ > cbz x0, 2f > @@ -160,7 +172,7 @@ ENTRY(__kernel_gettimeofday) > mov x13, #1000 > lsl x13, x13, x12 > udiv x11, x11, x13 > - stp x10, x11, [x0, #TVAL_TV_SEC] > + stp PTR_REG(10), PTR_REG(11), [x0, #OFFSET(TVAL_TV_SEC)] > 2: > /* If tz is NULL, return 0. */ > cbz x1, 3f > @@ -182,6 +194,7 @@ ENDPROC(__kernel_gettimeofday) > /* int __kernel_clock_gettime(clockid_t clock_id, struct timespec *tp); */ > ENTRY(__kernel_clock_gettime) > .cfi_startproc > + DELOUSE(1) > cmp w0, #JUMPSLOT_MAX > b.hi syscall > adr vdso_data, _vdso_data > @@ -297,6 +310,7 @@ ENDPROC(__kernel_clock_gettime) > /* int __kernel_clock_getres(clockid_t clock_id, struct timespec *res); */ > ENTRY(__kernel_clock_getres) > .cfi_startproc > + DELOUSE(1) > cmp w0, #CLOCK_REALTIME > ccmp w0, #CLOCK_MONOTONIC, #0x4, ne > ccmp w0, #CLOCK_MONOTONIC_RAW, #0x4, ne > @@ -311,7 +325,7 @@ ENTRY(__kernel_clock_getres) > ldr x2, 6f > 2: > cbz w1, 3f > - stp xzr, x2, [x1] > + stp PTR_REG(zr), PTR_REG(2), [x1] > > 3: /* res == NULL. */ > mov w0, wzr I think this is missing: diff --git a/arch/arm64/kernel/vdso/gettimeofday.S b/arch/arm64/kernel/vdso/gettimeofday.S index 143b39e..b463c5a 100644 --- a/arch/arm64/kernel/vdso/gettimeofday.S +++ b/arch/arm64/kernel/vdso/gettimeofday.S @@ -129,7 +129,7 @@ x_tmp .req x8 .if \shift == 1 lsr x11, x11, x12 .endif - stp x10, x11, [x1, #TSPEC_TV_SEC] + stp PTR_REG(10), PTR_REG(11), [x1, #OFFSET(TSPEC_TV_SEC)] mov x0, xzr ret .endm