Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1880531rwd; Sun, 28 May 2023 04:22:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ55QZLHLnAiL0cJLqWeGHm543SeOrgK7OGJxKNq5xqadQdPbH9Md6GoY5A4YN7WoXhrta3R X-Received: by 2002:a05:6a20:748b:b0:110:5141:dc8d with SMTP id p11-20020a056a20748b00b001105141dc8dmr4434035pzd.25.1685272939044; Sun, 28 May 2023 04:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685272939; cv=none; d=google.com; s=arc-20160816; b=X8+UYNCAXkGRrCdTUvkPzM6pl7r6BBiDd0tI+AfSxG8TE8+9qBq6mGsfFdvYMRsegs bvqK6j/uza2aLGUeaDmk4FRZ3Gpz18PPAZ2JaPNwqV4d71yQ7H43jD0KuVxSVso2SJjn KbIjUIhaOc2tmL3ZrFjRz3Xsxh5YP2Scl06cgVKeSEQpQum91dwTWxrE/4rNwulMgGRe JQFr+Pq6A51HzAe6V/Cf6aedCjvUUyiaVXD4Y/7FpugrWTSEBTe0wbBvsZ+EnVfF5+ur NxuEqiSn45RSwh+ao+DamOxgIZMZpCi7hXUyMj6JcS/R42lzhAtYko39hv+ziTViTKh9 FxJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=znOx7JGcg4w3tgFzv54l1C2eakG6atHWgKcCb3PEGXE=; b=UfBIs9ufWCxLz1ZizbyOj+d680w7uv9/st5enB1WAV5BwYZ1Y//MUsw0+0fB5PMBTc 2lXQ+bF8HpHXGah9ptXrsqbKX6N8vjsg3p2K56h1gMRjTt/MewEATjdkTSMSOMtv7Gx5 GRDpsdDDCWEWNC+/NpJ3KTaYT7XUyXLdqyh/s08FYVfjUudxkS9jKdR2mhK2tTaGBPJn tEg06GqYaT7sL5DsI+U/VQ4JA79cq6MoBioHFcvBC3RGrKPNXj0gU37Ky8//K8n3wz6x 7TfURZA3O9Beuw935LZy5QmgV2FsLwYqs3bh5BUo+uLMmU8upXn4uZCX5oYTDF6MgPGB 1hmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a63b24b000000b0053ef4692826si5929283pgo.465.2023.05.28.04.22.03; Sun, 28 May 2023 04:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229536AbjE1LDV (ORCPT + 99 others); Sun, 28 May 2023 07:03:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjE1LDU (ORCPT ); Sun, 28 May 2023 07:03:20 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D4CDBAC; Sun, 28 May 2023 04:03:18 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 34SB35t5002033; Sun, 28 May 2023 13:03:05 +0200 Date: Sun, 28 May 2023 13:03:05 +0200 From: Willy Tarreau To: Arnd Bergmann Cc: Zhangjin Wu , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley Subject: Re: [PATCH 09/13] tools/nolibc: sys_poll: riscv: use __NR_ppoll_time64 for rv32 Message-ID: <20230528110305.GI1956@1wt.eu> References: <83ab9f47-e1ed-463c-a717-26aad6bf2b71@app.fastmail.com> <20230528082509.293250-1-falcon@tinylab.org> <20230528102947.GH1956@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 28, 2023 at 12:55:47PM +0200, Arnd Bergmann wrote: > On Sun, May 28, 2023, at 12:29, Willy Tarreau wrote: > > On Sun, May 28, 2023 at 04:25:09PM +0800, Zhangjin Wu wrote: > >> > >> * Use __kernel_timespec as timespec > >> * Use 64bit time_t based struct timeval > >> * Disable gettimeofday syscall completely for 32bit platforms > >> * And disable the gettimeofday_bad1/2 test case too > > > > When you say "disable", you mean "remap", right ? Or do you mean > > "break in 2023 code that was expected to break only in 2038 after > > clock_gettime() has been supported for a very long time, so both > time() and gettimeofday() can be trivial wrappers around that. OK, that's what I wanted to clarify. I understood "drop" in the sense of, well, "drop" :-) > Nothing really should be using the timezone argument, so I'd > just ignore that in nolibc. (it's a little trickier for /sbin/init > setting the initial timezone, but I hope we can ignore that here). Yes I'm fine with this approach. > clock_gettime() as a function call that takes a timespec argument > in turn should be a wrapper around either sys_clock_gettime64 (on > 32-bit architectures) or sys_clock_gettime_old() (on 64-bit > architectures, or as a fallback on old 32-bit kernels after > clock_gettime64 fails). Sounds good to me. > On normal libc implementations, the low-level > sys_clock_gettime64() and sys_clock_gettime_old(), whatever > they are named, would call vdso first and then fall back > to the syscall, but I don't think that's necessary for nolibc. Indeed, we don't exploit the VDSO here since it's essentially useful for performance and that's not what we're seeking. > I'd define them the same as the kernel, with > sys_clock_gettime64() taking a __kernel_timespec, and > sys_clock_gettime_old() takeing a __kernel_old_timespec. Sounds good, thanks Arnd! Willy