Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1880530rwd; Sun, 28 May 2023 04:22:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5l0HutqFktaBnNzA4dKC7kjIVuOdLkE0fqg6/QnDruL7oZ5XPyJ/zpRuA6hbgUYZe6ABtn X-Received: by 2002:a17:90b:fc4:b0:256:5174:f58b with SMTP id gd4-20020a17090b0fc400b002565174f58bmr3933017pjb.46.1685272938969; Sun, 28 May 2023 04:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685272938; cv=none; d=google.com; s=arc-20160816; b=by5eaB61kI2pMuHoFflR9RR01rXwVvLhyvl3G/kzyBFE0incF6pclGNUesPpZzxl0e xuEvbzHf+h637E7i3OVV4dRPE8cJzzxx+/k4IkE6wWxfhMg1rv65r1nPHSN+g3KsUy41 3iGk6oKIb731f+aql73qLpfYU/nNT/4oYMOdBXjXyKrFjXi7qgGmcq7uYh5EB0xygIO9 c/YZJiAoK4vrfTzzL1j5EzCcNpCfzZJmdJ1PdSCvA02v2Biv0F1Sv6Oe12mDnf4O3LAw 1ZP8YIHRjk1BDB/L6h+VxHT36CQw9cgxCATHJnDW5uCnzr/S7YOZBLBdYpGJ7/gpnqTx 4G/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=1x43zMiuvtYxd7dVtv6VinrR59ld5ADzgde8ibsMU+U=; b=Pw/ZXzvv+oLCZFtK9aVFo0lXcAZyMWG064JfJgXIRxspt1BompFcPEyfSSS6bt7Hyd FUe/UE7iZMGv9K1SJyCnSjXTUDBH8y0wVAw2QkMo6EiEgHFgZskxNHcua706uElgnYnR /QWUH9aNvcK3FHK6sfLzfqKvCQ4TdjqcAg2U74F85D2y5Ee8MIW4pC1cayBqZOGsXlJM XZ25Zyza9hoarsuuvw5ATe1RPIKLcKLQaRUJMbm+WGXX56u8HL0ZVewcx2nBcPmP4z3b U9D+TgE4MAUYVDIFFi1NdsbKgoYWnGSW1Bio9SPTdFc6FVbRA2cxYCqVDYQPTqkso4SL rUnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=eL8OT1LO; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=BlJsWmQ6; 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 lt22-20020a17090b355600b0024686879af0si1358204pjb.169.2023.05.28.04.22.03; Sun, 28 May 2023 04:22:18 -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; dkim=pass header.i=@arndb.de header.s=fm3 header.b=eL8OT1LO; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=BlJsWmQ6; 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 S229528AbjE1K4W (ORCPT + 99 others); Sun, 28 May 2023 06:56:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjE1K4T (ORCPT ); Sun, 28 May 2023 06:56:19 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4238BA4; Sun, 28 May 2023 03:56:12 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 517163200094; Sun, 28 May 2023 06:56:08 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Sun, 28 May 2023 06:56:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1685271367; x=1685357767; bh=1x 43zMiuvtYxd7dVtv6VinrR59ld5ADzgde8ibsMU+U=; b=eL8OT1LOKiZn+jz23Z keOq+NyHaFzxihqmBPQ8ZT9VLgimNw2IwwXx2IDfchHBxumm9IA3yx+QR2SSwF94 PzifSYBG1XP+orpS72ibCrwry2IyRxwK2bqfDrCM1ZdbwOTdqkRkw4w/3Im49mBV c6HWx0yE2JmXucxadsTHspWEdXxmMD1DA/Ekv865ZOyKasK0uBdb9+WyiMcJrrB+ TWSVsE8lGBTdUb5njIb+GnFau1l1AKjakgl9vJVIEVpzYAomaEOXyw8qH1P4fO5f 4y1YbeHrg+M8EIL7w1JF+8teKf8+/AQmiesBDltMMAL+MwXNwUgl+PIXl4MAeXjA d9WA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1685271367; x=1685357767; bh=1x43zMiuvtYxd 7dVtv6VinrR59ld5ADzgde8ibsMU+U=; b=BlJsWmQ6VCi+oO8Nt0A5GqYUOn2m/ 7Wn029Riq4eSe8dq9jsAoIZ5vWmZWQtYtUPIkUHnk/FRPTr89AULQeFcW+JeSy6m l3Nq0oi+mmV97C1uxYrta5ZORz+40UcrmS5Lhyu/ksiawsXOrwcsW0n9H+BBbHhJ udvm1vtlpp0wpaaQ3I3xDgmgm6ZDFdfvBBpTI9bTShyq70AzdnWCGl1w8fJqjZZs kZWoqbzF4j7neObEeu8CIhEkU0YB2WdzEPzHtwR62LhU+4BaystGTbXk+SknfQqM 8f5ZxX59OX32yKbj3e5PRKQwUBR2vljvB9akV6RYoFJlDqP/XjwDK5XGg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekfedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 46218B60086; Sun, 28 May 2023 06:56:07 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-441-ga3ab13cd6d-fm-20230517.001-ga3ab13cd Mime-Version: 1.0 Message-Id: In-Reply-To: <20230528102947.GH1956@1wt.eu> References: <83ab9f47-e1ed-463c-a717-26aad6bf2b71@app.fastmail.com> <20230528082509.293250-1-falcon@tinylab.org> <20230528102947.GH1956@1wt.eu> Date: Sun, 28 May 2023 12:55:47 +0200 From: "Arnd Bergmann" To: "Willy Tarreau" , "Zhangjin Wu" Cc: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , 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 Content-Type: text/plain X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE, T_SPF_TEMPERROR 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: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. 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). 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). 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. 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. Arnd