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: 14702 Received: (qmail 109966 invoked by alias); 17 Aug 2016 13:19:03 -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 109255 invoked by uid 89); 17 Aug 2016 13:19:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=BAYES_50, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=2516, req, clockid_t, *res X-HELO: mx2.suse.de From: Andreas Schwab To: Yury Norov Cc: , , , , , , , , , , , , , , , , , , , , , , , , , , , 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 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