From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEEFFC433E0 for ; Tue, 12 Jan 2021 01:14:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B718222DCC for ; Tue, 12 Jan 2021 01:14:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732001AbhALBOB (ORCPT ); Mon, 11 Jan 2021 20:14:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727431AbhALBOA (ORCPT ); Mon, 11 Jan 2021 20:14:00 -0500 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C462BC06179F for ; Mon, 11 Jan 2021 17:13:19 -0800 (PST) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4DFCHq17dGz9sVb; Tue, 12 Jan 2021 12:13:09 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1610413996; bh=S/7jgyEMX8jCF5ztHgwvPqBfJNWba57wkdKj3Nr9QCw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=YRh6ZWH6YuZrrwd6OqvvWNWIDNFe6gjRx+RhHgekSnr4iTmcRETBtNN8OY4l1RGWu PGaXOw/talGTPXbsb/6uL4tKQl63WmMdSvx5Zs3I3QFcTmSZi5mFKi1B2hV58SSXR6 wP1OhqQbVEXK5K2EVjzZCJlh+BZeYfGx78I1auMbIwwrVVCccgg10AQpUF9Iexmy0+ Pen36dQldkfejeM7Q4zdsef9R+hRcKAZOvbkVxoEWDIuSOWm71uWWDk5nzlqOMmd5G BprOb35vsULgTcFLTQmvQHW2p4Lx77kTryrgK1mr+ao88v54ZOaE25HWgksJA7BFP5 KJqyZAIc5YzRw== From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , schwab@linux-m68k.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2] powerpc/vdso: fix clock_gettime_fallback for vdso32 In-Reply-To: <77cb8f5e668a2f6e00ea6e90d5f4f37763957b5b.1610383963.git.christophe.leroy@csgroup.eu> References: <77cb8f5e668a2f6e00ea6e90d5f4f37763957b5b.1610383963.git.christophe.leroy@csgroup.eu> Date: Tue, 12 Jan 2021 12:13:06 +1100 Message-ID: <87v9c3j6u5.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > From: Andreas Schwab > > The second argument of __kernel_clock_gettime64 points to a struct > __kernel_timespec, with 64-bit time_t, so use the clock_gettime64 syscall > in the fallback function for the 32-bit vdso. Similarily, > clock_getres_fallback should use the clock_getres_time64 syscall, though > it isn't yet called from the 32-bit vdso. > > Signed-off-by: Andreas Schwab > [chleroy: Moved into the #ifdef CONFIG_VDSO32 block] That doesn't build for 64-bit with compat VDSO. Should I just take Andreas' version, or do you want to send a v3? cheers > Fixes: d0e3fc69d00d ("powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32") > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/vdso/gettimeofday.h | 27 +++++++++++++++----- > 1 file changed, 21 insertions(+), 6 deletions(-) > > diff --git a/arch/powerpc/include/asm/vdso/gettimeofday.h b/arch/powerpc/include/asm/vdso/gettimeofday.h > index 7a215cc5da77..3ecddd9c6302 100644 > --- a/arch/powerpc/include/asm/vdso/gettimeofday.h > +++ b/arch/powerpc/include/asm/vdso/gettimeofday.h > @@ -102,22 +102,22 @@ int gettimeofday_fallback(struct __kernel_old_timeval *_tv, struct timezone *_tz > return do_syscall_2(__NR_gettimeofday, (unsigned long)_tv, (unsigned long)_tz); > } > > +#ifdef CONFIG_VDSO32 > + > +#define BUILD_VDSO32 1 > + > static __always_inline > int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) > { > - return do_syscall_2(__NR_clock_gettime, _clkid, (unsigned long)_ts); > + return do_syscall_2(__NR_clock_gettime64, _clkid, (unsigned long)_ts); > } > > static __always_inline > int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) > { > - return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts); > + return do_syscall_2(__NR_clock_getres_time64, _clkid, (unsigned long)_ts); > } > > -#ifdef CONFIG_VDSO32 > - > -#define BUILD_VDSO32 1 > - > static __always_inline > int clock_gettime32_fallback(clockid_t _clkid, struct old_timespec32 *_ts) > { > @@ -129,6 +129,21 @@ int clock_getres32_fallback(clockid_t _clkid, struct old_timespec32 *_ts) > { > return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts); > } > + > +#else > + > +static __always_inline > +int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) > +{ > + return do_syscall_2(__NR_clock_gettime, _clkid, (unsigned long)_ts); > +} > + > +static __always_inline > +int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) > +{ > + return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts); > +} > + > #endif > > static __always_inline u64 __arch_get_hw_counter(s32 clock_mode, > -- > 2.25.0