Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1760836rwd; Sun, 28 May 2023 01:58:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4h3j0s+NxUT10FRkaa4nV61erv3InDUkqsKg4XUBZDR+VGPNZHZnjPzHeYJduOFbAoNrht X-Received: by 2002:a17:902:c94f:b0:1ac:750e:33f4 with SMTP id i15-20020a170902c94f00b001ac750e33f4mr8970345pla.32.1685264293462; Sun, 28 May 2023 01:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685264293; cv=none; d=google.com; s=arc-20160816; b=RsEcsf96Ub7qH3W1F8JddHF4ujlBKSeHmjqRF2HgRAg1ofv1P1nSn4iW56jPgfxsJa r7xc5ITRsSctp1zITOy+IB+Fg3rfmjrLQbEXWuejPwyjB5W8PL7AtyDVFCLiVQb92F2o Rpd/bh8knO3mgyjBnxBppJRkCqdNxqYsq+YQZNNFKI+ySLOQJx/c3Isje9AC7FwGidPI 4Iu/l81RbfjlOPVQuiXHj85VUSzz/xi8dYkk0eydr9llalIWGpnFIpnQNbUrcOHLaSgK SovU52Nq52DSbStxM0vFL+YGZ6S7IcDOKs0XZBHq4d8J7D15d3lAoLk2n7ecGx/wSJjh sjWw== 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=dbKqJffHV3+pecTgDfQClj4wiqdZaANtKaFkt+SsH/g=; b=HJtwZ9PZ3NWUqjIRpz0JQ7mvt/Wt1HdRhQGHoGbYvRRVIUN9V5F79JGZjlosv/fvUD Ucrz3vxyNHlXaxRUdX7udpanmB9H0nzaqK34EddLS7XmC3CEevFHxgfTxrkVnQbipZrI kN72FRruzFuRwtLaOA95qXwKBLqmp9bd0l7Pq50tSSDd4T9VaHO2kgRIuj2+k9WAHNwg AsBA69lNs16L6THEv02h+qoGNNAcehqcQuCuZ0InZJ3d5tkLSX+cZfRCiEgKW4H59lyk 3xVqz03UoKo0zCoDjtTrLd55oFVyxtf/nXP9MSzuhNVlObLkK6AUsJjvn+/B5CyBYZ2D zikA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=Tv2E3uUr; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=hG00OSxu; 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 c24-20020a170902b69800b001adb9d5e1d2si7499955pls.130.2023.05.28.01.58.00; Sun, 28 May 2023 01:58:13 -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=Tv2E3uUr; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=hG00OSxu; 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 S229498AbjE1Isu (ORCPT + 99 others); Sun, 28 May 2023 04:48:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjE1Iss (ORCPT ); Sun, 28 May 2023 04:48:48 -0400 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A628C7; Sun, 28 May 2023 01:48:46 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id C1A2032007F9; Sun, 28 May 2023 04:48:42 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Sun, 28 May 2023 04:48:43 -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= 1685263722; x=1685350122; bh=dbKqJffHV3+pecTgDfQClj4wiqdZaANtKaF kt+SsH/g=; b=Tv2E3uUrtLBy2QKoeONeldiMNdpg6aLqu8QF/rrkSiRLOT5cjz0 2fLEpW8vyASR9mA3Mzhiwn5BKVclmpDPSvvdUz1pqLqc+UlLvp+7EeoDWvZxeOky NuvYJ28OhKIEpaiWcNzX9px7nKR1cSuyM7JsuaufiR86tRSF/jCtD2Si3oAWgiiQ e5vgjq3f5m7XAMidY7sVwI3AthMTozE72BYNJVL4iW/WBlU5s+iJTKPHm0aNd2HN NcU+WiDRDFT1ATeGVcD1pbiLzAaVnldpvkK/J1qdaTM904TPIV2+omWuF3bLE63B I+jevwj+8OG9bndinGMoQWxSMvU5qv0cM/Q== 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= 1685263722; x=1685350122; bh=dbKqJffHV3+pecTgDfQClj4wiqdZaANtKaF kt+SsH/g=; b=hG00OSxux0WIwOwHpOeMTe5riqTGkenybsGeCByKaiWIvN62/9/ NvHEYkxgZhltRf4xLvurXskOkmxEkcAEAdKFXGiXldB1NUZShjGuWTwP8kaELdXl G8KbzNVfqBkxkyerJOjeicPbkOleoOJ6t9KDYIucpJE885ydoD9O/Cf6dS7NJL/n g4JCMrrFxRjcwyv4+QOk/cT9Ddgc8AUG+/PSX1GGzJ1hVzCSHsc5odl6KnUzzGgk BVLU7xg5kMhguVjlin6maI6NJ2LohbyRLT7a1IGXMeUOe+UhgRLKZazZ6TW8rIF0 tUNOFS4b8Uk7W142wq100n/IiEVL+Hzc7Fg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekfedgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeegfeejhedvledvffeijeeijeeivddvhfeliedvleevheejleetgedukedt gfejveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id F404DB60086; Sun, 28 May 2023 04:48:41 -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: <9e4064fc-f0c5-4dd3-941f-344d2150e1cd@app.fastmail.com> In-Reply-To: <20230528082509.293250-1-falcon@tinylab.org> References: <83ab9f47-e1ed-463c-a717-26aad6bf2b71@app.fastmail.com> <20230528082509.293250-1-falcon@tinylab.org> Date: Sun, 28 May 2023 10:48:21 +0200 From: "Arnd Bergmann" To: "Zhangjin Wu" , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , "Willy Tarreau" Cc: 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 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 10:25, Zhangjin Wu wrote: >> On Fri, May 26, 2023, at 09:15, Thomas Wei=3DC3=3D9Fschuh wrote: > * Use __NR_*time64 for all 32bit platforms > * Use __NR_pselect6/ppoll/clock_gettime only for 64bit platforms > * New sizeof tests added to verify off_t, time_t, timespec, itimerspec= ... > > CASE_TEST(sizeof_time_t); EXPECT_EQ(1, 8, =20 > sizeof(time_t)); break; > CASE_TEST(sizeof_timespec); EXPECT_EQ(1, 16, =20 > sizeof(struct timespec)); break; > #ifdef NOLIBC > CASE_TEST(sizeof_itimerspec); EXPECT_EQ(1, 32, =20 > sizeof(struct itimerspec)); break; > #endif > CASE_TEST(sizeof_timeval); EXPECT_EQ(1, 16, =20 > sizeof(struct timeval)); break; > CASE_TEST(sizeof_itimerval); EXPECT_EQ(1, 32, =20 > sizeof(struct itimerval)); break; > CASE_TEST(sizeof_off_t); EXPECT_EQ(1, 8, =20 > sizeof(off_t)); break; > > > @Arnd, the above timeval/itimerval definitions are used to override th= e ones > from linux/time.h to avoid such error: > > error: redefinition of =E2=80=98struct timeval=E2=80=99 > > nolibc/sysroot/riscv/include/types.h:225:8: error: redefinition of=20 > =E2=80=98struct timeval=E2=80=99 > 225 | struct timeval { > | ^~~~~~~ > In file included from nolibc/sysroot/riscv/include/types.h:11, > from nolibc/sysroot/riscv/include/nolibc.h:98, > from nolibc/sysroot/riscv/include/errno.h:26, > from nolibc/sysroot/riscv/include/stdio.h:14, > from=20 > tools/testing/selftests/nolibc/nolibc-test.c:12: > nolibc/sysroot/riscv/include/linux/time.h:16:8: note: originally=20 > defined here > 16 | struct timeval { > > @Arnd, As you commented in another reply, is it time for us to update > include/uapi/linux/time.h together and let it provide time64 timeval/i= timerval > instead of the old ones? perhaps some libc's are still using them. It's hard to know if anything is using it until we try. On the other hand, we also know that anything still relying on it is going to be increasingly broken on 32-bit architectures over as we get closer to y2038, so we can just try removing these here to see what happens. > Or perhaps we can add a switch like __ARCH_WANT_TIME32_SYSCALLS, add a > __ARCH_WANT_TIME32_STRUCTS and simply bind it with __ARCH_WANT_TIME32_= SYSCALLS? I don't like that idea: __ARCH_WANT_TIME32_SYSCALLS tells us that an architeture still provides those syscalls for compatibility, so that is architecture specific, but __ARCH_WANT_TIME32_STRUCTS is not something that is an architecture specific decision at all, it's only needed for old source code. > About the above ugly override code, What's your suggestion in v2? ;-) Can you maybe just remove the "#include " from all include/uapi/ and nolibc headers so it just never gets seen? Unfortunately I see the header contains a few other definitions, which might have to get moved out of the way, possibly to linux/time_types.h. Arnd