Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4324989rwd; Sun, 4 Jun 2023 02:54:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7WLv/s7uTiOunH/DzNZWBi/kMdPQ2J1NqapT3HJS8ZZ7ukXKlIw+32588FWcd58Sych8Mr X-Received: by 2002:a92:cc01:0:b0:33c:9631:3eaa with SMTP id s1-20020a92cc01000000b0033c96313eaamr14359571ilp.2.1685872495329; Sun, 04 Jun 2023 02:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685872495; cv=none; d=google.com; s=arc-20160816; b=z1tpFUttObV6GeiKcIvlzI9pZ854zPo1KVLMyj0mefpUHn+b0G80nzxeYK7MTwgShi e07Hd5oSnbzfNkLj9zLP4hEGa+vX1WC+tLT4CgNvgEB4HOxRm5iOZmJAiAi3Sulijk6D 7fg+6DgiLIFwnG3xUvEpUAP/R/j2dmGqIk657SilsMW+RkabvcejfRJN18FIr1HV9X0O w1g/WH3hK0wIoAx5k5tVyIrKk6L5PtaQWJQIH0TPx+PUWM7vrYxFFOvfQXuHu99KHFzm jR+zzNjsD951aiA8/pnwQIDhSzJUXzd6PN/yQlIbD4Dk1qzoB7QwctPsKpGCMKc1V0kO WtwA== 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=XfcdNIb0iKDc88JTEvQZP3mryRBy0lricuJYjJH51q8=; b=DncaZmtMqqFGq5BkaIyqV5Gc3/cbLod4pflLrZfAtYLnj06U7n5j5neVG3YHSBjeEA X353hq0xOj/gCvM5ncFJZTGy1KFgpgOFpvCZi8UBxjektUqVOc7iOIAatV7yK2KAUa70 xdQZzXU/98E/VGUlkm5CA2JHsWnBnQCqbO0jFkGf4B88sZ2vCEY6yBNWnVjA2vBDg3w6 CgZ0WzF6i624GaQDX1YTxkSL86DgmhC2JWAtPX/QhD4ifKRwfF/2N/MlPVUlj6Atrhc7 6q+QuPX3m9ex4AT7ANkOxQanBA3K3Q0iLlBAQo11AroUGuhr17MKxH2rTHaFhBxQt5fU DJjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=fV8hohYu; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=mZkmWbDv; 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 10-20020a63020a000000b00543ab2e61acsi380396pgc.546.2023.06.04.02.54.41; Sun, 04 Jun 2023 02:54:55 -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=fm1 header.b=fV8hohYu; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=mZkmWbDv; 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 S230061AbjFDJZL (ORCPT + 99 others); Sun, 4 Jun 2023 05:25:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjFDJZK (ORCPT ); Sun, 4 Jun 2023 05:25:10 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89A82B4; Sun, 4 Jun 2023 02:25:08 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 6173F5C00EC; Sun, 4 Jun 2023 05:25:05 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Sun, 04 Jun 2023 05:25:05 -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=fm1; t= 1685870705; x=1685957105; bh=XfcdNIb0iKDc88JTEvQZP3mryRBy0lricuJ YjJH51q8=; b=fV8hohYurmAXdy7NIRl2Iih+PmBfQOdum7I1ekGoQwAnkIF7wtP jE2wStOMgmyyFZwj2X0jUux5KkkST4/TFfRBpO3xVqnR1RMI64NX8cyZom82x6TP ZH64fXxv2uiNh5CKvR/ZOueQunPdYgXb2dUkMCWgtgconnL8F4Z7k1lV3GfDBG60 C3ecL2Mf5bD2pLHT6RHPxbr4LmSy2HbikUo1Ua0ZY09wtRH0cbuzuQz5W8cGLGot D0cTu9umThZtsu9C/VIKEpMIA+3uiATn+aYZnShXbMmwPXVZZzk/k1gWcHm1U3gj DyVjd61XGY4k/DR4Hqnb7JilGP7r7BcnxIg== 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= 1685870705; x=1685957105; bh=XfcdNIb0iKDc88JTEvQZP3mryRBy0lricuJ YjJH51q8=; b=mZkmWbDvU3WZBsJ4N17WIaevXWee0F4bGB5O+xJ7V+hOeQuLvbf j3yvNn22dRxDNJGVUUkFRQ3CL6d/N/pXaRnkLzX0hGAvzYWCsytQ76SNvrxGBl3I c0PxUkjm4J5q1lSXD8Z7t0VXnwFLll1FyDb4/ptP/Ady1ffDykXSTn5n17Qchd80 oY040w+i2YaQIy86KkzSXNlFjSRMPjyN6oFCCIg4aTwxIO1A3/949PrWkSdSJOGH sJAVjaSUNX6kMCsnuKgDl4yg6IrayHWc+kA6ElRm0NIBQ/DjBCT7yRWPZEP0n3Uo xAmzP/VbIHWA858SM4JHZCmBglw/ns204og== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeljedgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeegfeejhedvledvffeijeeijeeivddvhfeliedvleevheejleetgedukedt gfejveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8932EB60086; Sun, 4 Jun 2023 05:25:04 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-447-ge2460e13b3-fm-20230525.001-ge2460e13 Mime-Version: 1.0 Message-Id: <51e1db37-3981-4ea5-9348-b6f6b31ecc8a@app.fastmail.com> In-Reply-To: References: <68dace9e2532316ff454894697ecfd99e419a523.1685777982.git.falcon@tinylab.org> <2fccaff5-2354-4ac0-8389-1004d47d8dc9@t-8ch.de> Date: Sun, 04 Jun 2023 11:24:39 +0200 From: "Arnd Bergmann" To: "Zhangjin Wu" , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= Cc: "Willy Tarreau" , linux-kernel , linux-kselftest , linux-riscv Subject: Re: [PATCH v3 11/12] selftests/nolibc: add new gettimeofday test cases 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, Jun 4, 2023, at 10:29, =E5=90=B4=E7=AB=A0=E9=87=91 wrote: > > Sorry for missing part of your feedbacks, I will check if -nostdlib=20 > stops the linking of libgcc_s or my own separated test script forgot=20 > linking the libgcc_s manually. According to the gcc documentation, -nostdlib drops libgcc.a, but adding -lgcc is the recommended way to bring it back. > And as suggestion from Thomas' reply, > >>> Perhaps we really need to add the missing __divdi3 and __aeabi_ldivm= od and the >>> ones for the other architectures, or get one from lib/math/div64.c. > >>No, these ones come from the compiler via libgcc_s, we must not try to > reimplement them. And we should do our best to avoid depending on them > to avoid the error you got above. > > So, the explicit conversion is used instead in the patch. I think a cast to a 32-bit type is ideal when converting the clock_gettime() result into microseconds, since the kernel guarantees that the timespec value is normalized, with all zeroes in the upper 34 bits. Going through __aeabi_ldivmod would make the conversion much slower. For user supplied non-normalized timeval values, it's not obvious whether we need the full 64-bit division Arnd