Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2402180pxb; Mon, 11 Jan 2021 08:46:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHO6xOeRvkd9Els0rM3x+413Kmf+lffviFdzJyR7/TFvDCgW7MJuLcMUeOfBC/740/W9hU X-Received: by 2002:a17:906:174f:: with SMTP id d15mr269550eje.52.1610383581840; Mon, 11 Jan 2021 08:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610383581; cv=none; d=google.com; s=arc-20160816; b=D46/gX2wAlRA8PWYBUl9abhcxxkFGpC08V8UWeDb4c3/v2gPqeSFXSxqVTAusSWgSl bJfdu8AorIu6B5limkKvcwwCvs0kZG6c3XJ5lfxzmI5hEIwx4WdFmG3ANnOZmT2oiF8e WNmuMjBRzc4T7PHsJk99U82yi+QIsuiM3KuMG9uulqk+pmozRaNN7e5EZn3tzZsY7bmS vJCN2tz7HEGLIc83vTdkNY8ImoFUh1PubqMt8AAg9Ua/+Q8flEfPcwdXZKOVBCy8qhij jOxbwiU4D0GUnUfM0azXOAAcfWfVHiKAj6JHNNAKgzmli1/2iIORI1MQ8/Dcw2wf1Sxo 9SHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=QpZPRKGZABnTLy2MII22gF4FWhJySo+/NxIn33R21hI=; b=c9x6bgI3Orec3Ct5lky3j7NtZEh+Dh6hdO9exRQ55Vl6hRXzyd1S3x9qHVcroJhPu4 7fF+fWDcGX++Sdky4SNzq3/Y2LSglH3hVPbiZE4UUH3KpVEBG7SdQW25gYTyC+x7/M/0 iWzgcQ+tDcJv2mtxZXw5wcu/xCLa7IiBoLVPiig+LX2xl0UEd5s2pUmmITQhyJzoHCfc pwMjIE424/ukAcGVX+qwd2UUFfWhCl/CWB2yIqqbZtFL+G1mClSvD3Lx4dYXLdEI4pMo rslccslJEewfeik8ZKE0vjHZXg+0yi7vXe8StKpJ7UQhqVpFcO/NOCNWff9FjRSJIhKv 4NBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p17si3687ejw.23.2021.01.11.08.45.57; Mon, 11 Jan 2021 08:46:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389062AbhAKQoN (ORCPT + 99 others); Mon, 11 Jan 2021 11:44:13 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:39078 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731908AbhAKQoN (ORCPT ); Mon, 11 Jan 2021 11:44:13 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4DDzzV71Z3z9tySH; Mon, 11 Jan 2021 17:43:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 4TE2AUabVSHM; Mon, 11 Jan 2021 17:43:18 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4DDzzV67CGz9tySG; Mon, 11 Jan 2021 17:43:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A1E1F8B79D; Mon, 11 Jan 2021 17:43:24 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id zAXdc398vnxx; Mon, 11 Jan 2021 17:43:24 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1E32C8B79C; Mon, 11 Jan 2021 17:43:24 +0100 (CET) Subject: Re: [PATCH] powerpc/vdso: fix clock_gettime_fallback for vdso32 To: Andreas Schwab , linuxppc-dev@lists.ozlabs.org Cc: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linux-kernel@vger.kernel.org References: <87eeirsdr8.fsf@igel.home> From: Christophe Leroy Message-ID: Date: Mon, 11 Jan 2021 17:43:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <87eeirsdr8.fsf@igel.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 11/01/2021 à 16:18, Andreas Schwab a écrit : > 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 Fixes: d0e3fc69d00d ("powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32") > --- > arch/powerpc/include/asm/vdso/gettimeofday.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/arch/powerpc/include/asm/vdso/gettimeofday.h b/arch/powerpc/include/asm/vdso/gettimeofday.h > index 81671aa365b3..a26c12df2c9a 100644 > --- a/arch/powerpc/include/asm/vdso/gettimeofday.h > +++ b/arch/powerpc/include/asm/vdso/gettimeofday.h > @@ -106,13 +106,21 @@ int gettimeofday_fallback(struct __kernel_old_timeval *_tv, struct timezone *_tz > static __always_inline > int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) > { > +#ifndef __powerpc64__ I think we should do like x86, create a second version of clock_gettime_fallback() inside the #ifdef CONFIG_VDSO32, and move that one in a matching (non existing yet) #else > + return do_syscall_2(__NR_clock_gettime64, _clkid, (unsigned long)_ts); > +#else > return do_syscall_2(__NR_clock_gettime, _clkid, (unsigned long)_ts); > +#endif > } > > static __always_inline > int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) > { > +#ifndef __powerpc64__ Same. > + return do_syscall_2(__NR_clock_getres_time64, _clkid, (unsigned long)_ts); > +#else > return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts); > +#endif > } > > #ifdef CONFIG_VDSO32 > Christophe