Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2196278rwd; Fri, 26 May 2023 03:15:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7WGo/Sc1SodsAKSKJx0lUjlj+HHxMUxhTMf8MRE8htlB2wmuEh0NnmJZLporLYq7uo/Ipi X-Received: by 2002:aa7:888b:0:b0:63c:1be4:5086 with SMTP id z11-20020aa7888b000000b0063c1be45086mr2488447pfe.6.1685096124691; Fri, 26 May 2023 03:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685096124; cv=none; d=google.com; s=arc-20160816; b=0IzT02B5zoJyvqSwiLIfrW6sXRR2KaSXh5bo0Burk0f+pI2wCMjX3LyHiGX1xul1SM sK0kF51+5Vd9fk1Z4LojAHZKaKGpUHkSCdJS2O/0T203cboD487mxt6FjPV+f/pwIUom E+ZwQqYIry7K/PN4buwCNC7eLUIiUfJPyMPKM1D9uRS5n+GlEb04n67WW/HagOvpkFLb dJEHbLkHtcqz14Tr4QbuJqpeFYA61XTyOWSDSvVUBpL2kH8jVxV61aLXwCfsSCCuc8bl +3vMgGX0VGYCm0rA38xR/fkWhBY/yYh2aQvhnnTjVoJc2crJIMDytMcOtbOke5jnUNIs GD6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=VQuY/hL2S/RS8GNDFwVDAwplsazM8ODjSL8HxOJd4/M=; b=txoR+SLcKyXZPppEL1d7+zyJN5oobj9q1N1QQ2MPHlqhXv/HO8qqlbOOi5IbbQ3Qwd 3FlcPiWMiPLN/E+w/yJ9CqZi3wpaNH/2ZhivMDNGWqs5s1hheA8te1YAuIomdBDvCOwW aQ/jRRW3fc7VnlIhD7EoOK5oUnra+ev7o8w2dYbGOoCN54FzA4DsIDV96fESDjznQph3 GQUjswNmnRQFhuJyisujP6szJXuE2ABzDPXUfhJbqlYn7c9ueH1rcVXCxpCI6bQisqk4 SpnaaDorMyrpfjzdWbGyr7xMvhieeSzJRMXV8iXc8jcVAx4isfEaZK0NinQbyOCOScIr woRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b="nwK6/l/Q"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=lJ+afdWV; 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 x71-20020a63864a000000b00513973cb8b8si3369529pgd.202.2023.05.26.03.15.09; Fri, 26 May 2023 03:15:24 -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="nwK6/l/Q"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=lJ+afdWV; 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 S235889AbjEZJgD (ORCPT + 99 others); Fri, 26 May 2023 05:36:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243450AbjEZJf3 (ORCPT ); Fri, 26 May 2023 05:35:29 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ADDD1A4; Fri, 26 May 2023 02:35:11 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C87AF5C02A7; Fri, 26 May 2023 05:35:10 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Fri, 26 May 2023 05:35:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding: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= 1685093710; x=1685180110; bh=VQuY/hL2S/RS8GNDFwVDAwplsazM8ODjSL8 HxOJd4/M=; b=nwK6/l/Qae+SBdLMMpC8B/2CiUB+2CFgiCiftBPiwUx1JwLIBhI 2Zx1jckJ3DX8WZWAh8rhOwF5ufG1TFkxNHAFtHJBI45m4b2jUp9TMb7GvUmedRq9 RYRUUkLm2hK5qadBAGJUZf+H/n5tD0HT7/Gdoy5CkK9kguBQlk4IzX7ZwMCed4ZW Y9MeJQ/eEpSK+paOQl4XrrN6cdBwrUmsF5OjnEYsGSpHKlvTKO5lbhUYww2u9QY/ xN7psVe7Vd6wiK6hMpntz85UqmLcHdDxoibcgvnLkC2NanKn9oOnRmeNX8IuPTVq 6rV6eMoORCWGKxlv5Y6jWDxZMLzMSvgRDRw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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= 1685093710; x=1685180110; bh=VQuY/hL2S/RS8GNDFwVDAwplsazM8ODjSL8 HxOJd4/M=; b=lJ+afdWVNY+5p1btQimqvgioXqVzsADLAjA8v/L0UM8MgNRC2AN dUAxU5T3Vu4pR4tVzWC4JGhjPF2D6vYIEoxnXoVwnFfm0WV/QftbQfD7oXIklg4S cPMu2dgkiriEq3qQXTmvoaC09McuCpVmZ7plxdbonHSXcxQa5oo+2L5koof/Tbqv /TK8yMfBCdo/eMpK3CFCSyFeCGfH7IHTvnDvSYVUEmuGhQREhV9gGOuD7m5kkwRz OPhq0FKBj5lfzfUH+5z8Y6vzwbvsS26Zr2BGb6tUhMY9DfZlkxSf73BfIH7kVQiI VVCQeSEELgJwFKJzd3BgIadGNQFX9s13lSA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejledgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeegfeejhedvledvffeijeeijeeivddvhfeliedvleevheejleetgedukedt gfejveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 89C20B60086; Fri, 26 May 2023 05:35:10 -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: <83ab9f47-e1ed-463c-a717-26aad6bf2b71@app.fastmail.com> In-Reply-To: <78d91061-1bcd-4031-89e1-706c3f49d762@t-8ch.de> References: <78d91061-1bcd-4031-89e1-706c3f49d762@t-8ch.de> Date: Fri, 26 May 2023 11:34:46 +0200 From: "Arnd Bergmann" To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , "Zhangjin Wu" Cc: "Willy Tarreau" , 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;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Fri, May 26, 2023, at 09:15, Thomas Wei=C3=9Fschuh wrote: > On 2023-05-25 01:57:24+0800, Zhangjin Wu wrote: >> rv32 uses the generic include/uapi/asm-generic/unistd.h and it has no >> =20 >> +/* needed by time64 syscalls */ >> +struct timespec64 { >> + time64_t tv_sec; /* seconds */ >> + long tv_nsec; /* nanoseconds */ >> +}; > > A question to you and Willy, as it's also done the same for other type= s: > > What is the advantage of custom definitions over using the one from the > kernel (maybe via a typedef). > > From linux/time_types.h: > > struct __kernel_timespec { > __kernel_time64_t tv_set; > long long tv_nsec; > }; I agree the __kernel_* types are what we should be using when interacting with system calls directly, that is definitely what they are intended for. I would go further here and completely drop support for 32-bit time_t/off_t and derived types in nolibc. Unfortunately, the kernel's include/uapi/linux/time.h header still defines the old types, this is one of the last remnants the time32 syscalls definitions in the kernel headers, and this already conflicts with the glibc and musl definitions, so anything that includes this header is broken on real systems. I think it makes most sense for nolibc to just use the linux/time_types.h header instead and use something like #define timespec __kernel_timespec #define itimerspec __kernel_itimerspec typedef __kernel_time64_t time_t; /* timeval is only provided for users, not compatible with syscalls */ struct timeval { __kernel_time64_t tv_sec; __s64 tv_nsec; }; so we can drop all the fallbacks for old 32-bit targets. This also allows running with CONFIG_COMPAT_32BIT_TIME disabled. Arnd