Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2344861pxb; Mon, 11 Jan 2021 07:22:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxd3fYavgNys6sFGd8zsOBkDNOCm2cz/ZUe/pgnj5M6JF2ZfddzSSiKHkmkjZe4jUMPEsgt X-Received: by 2002:a17:906:2b50:: with SMTP id b16mr10899762ejg.255.1610378522733; Mon, 11 Jan 2021 07:22:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610378522; cv=none; d=google.com; s=arc-20160816; b=CT59yi92vPkcRK41q54kGLjJ3MOm7ghFWOOoRzXIMYvXqQp9ExllIIyn7Sd/lZv7s3 SDMJXN9LQ3HuR8NwX+74g3b0lWu1STrvF/tawRdVSJC3o+h2x/0bZQqxNHFg/zIW9E9Z 5UIXGF3EI4G2joi8sN7kUJ2hunoK/VLu4/vSZXzXUIlR9yF1DS3y4gQWzOlog3QilSCK L8Jr2PhfLjMLkuYNum7a2ouILoaNO0YOy9CUwB/zxL1Yb2TJGDOhgoKEsPwndTZmA/SR S8clFXdtNvzwc3qdhLNLoGZhMlCiyHElUloT1QbCRdR7kGycwhcPUeCupi+ssvviz5UM D/Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:date:cc :subject:to:from; bh=BKVYEeWs02HtqD+IeA3oSt0uBIwGew26VOsyj+4ZIH8=; b=oaaGhWQLaajUJRpEeJC17iZPwCX7ermJFO423fV5EEXsyV6Oq5NYEcudyOJ51/vPj8 VJOo4Ve3IgUoZLdvXk8NV50MvahSJX0nVEVTKhCGw1F1gYFwHtfuViqIEAQMsT2QoZWb DT9uZGZoLzV1GQVZ1YBaw10PqBB7mVICbrHzV/WvyexOa09sUAIUrJeCRqe0TSe61bwR fA/Mgh+KqqPrn+Da2p/dJwhkMbzYFyBqPlCcQxVOR5Doy0rXU+yWMzsDBE+5w1tfG0nJ JuGKnZC5pTFWsGvnaQcso/Ug18Yc1tvQshkAjxf/VEfuhXGv4w+/gUUOt9VlzG099rio KMnA== 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 ce20si47376edb.138.2021.01.11.07.21.39; Mon, 11 Jan 2021 07:22:02 -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 S1730343AbhAKPUC (ORCPT + 99 others); Mon, 11 Jan 2021 10:20:02 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:55242 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727614AbhAKPUB (ORCPT ); Mon, 11 Jan 2021 10:20:01 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4DDy651Fmqz1qskT; Mon, 11 Jan 2021 16:18:53 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4DDy646j31z1tYWW; Mon, 11 Jan 2021 16:18:52 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id S1jEDPKn3m5i; Mon, 11 Jan 2021 16:18:51 +0100 (CET) X-Auth-Info: +4ZBp6oP5UHBQbz30gRFNPVk3E+f0nOqHIQmb61qUoCy/249mUINCdfQGZyGGjep Received: from igel.home (ppp-46-244-179-249.dynamic.mnet-online.de [46.244.179.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 11 Jan 2021 16:18:51 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id 666492C352E; Mon, 11 Jan 2021 16:18:51 +0100 (CET) From: Andreas Schwab To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc/vdso: fix clock_gettime_fallback for vdso32 CC: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy , linux-kernel@vger.kernel.org X-Yow: Yow! Did something bad happen or am I in a drive-in movie?? Date: Mon, 11 Jan 2021 16:18:51 +0100 Message-ID: <87eeirsdr8.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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__ + 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__ + 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 -- 2.30.0 -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."