From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC612C71142 for ; Wed, 10 Jul 2019 13:02:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FBB920651 for ; Wed, 10 Jul 2019 13:02:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="me2oKmTp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FBB920651 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0MDOJgAqR9XKd5L6nGEEasfFL9hrE6BVga5uYD9Jp4k=; b=me2oKmTp+XKs3V jzKXT9x+S0QpAH6t6/aaMHi5O+ajxPjzDoqcTrTyZXRiRlKxpu5vLrQSMNn0hOxZchUSqTgr2A+ck 5wWC8Eyo/WKwYnbyzHNmni0ukzKb7L1A8HptnjWZZdZDQ1er9slDTWm2FO/xDe3R+4aSlVAT/8P2W UTj3olQYzdd5D7di8G7huiEyplkbvr5alFtQW0kEbueOwMst9lSXKzccIIMAVZgAgRNUZ4+2pZNtw HZBrkZ576jCgjLpCJQ+iCtQ/kuejNvYab1nU7VB1CrF0HjCQLskWV2rIIjoqyjELiRt1/LAuSQUXu gT2XvHDnE1gE5PLv3cyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hlCF9-00022U-D3; Wed, 10 Jul 2019 13:02:43 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hlCF6-000225-Io for linux-arm-kernel@lists.infradead.org; Wed, 10 Jul 2019 13:02:42 +0000 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MfqGN-1iQbak3EYz-00gD3I; Wed, 10 Jul 2019 15:02:11 +0200 From: Arnd Bergmann To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino Subject: [PATCH] vsyscall: use __iter_div_u64_rem() Date: Wed, 10 Jul 2019 15:01:53 +0200 Message-Id: <20190710130206.1670830-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:VYafebV/Q7CLTnWZ3vcfCq05iJn/NVcnt1G0HsD21yoEzIkoekE GowoTPqBzup5f7V7xMLaEhy9kYVbaCnEXVORNGnVIa8I2H78SDiMxn8HQmhjaxAcq4M75O3 n1F8e1rj/DWTM3EUk68i9Xc0Ao0x514ZBgN+xP1ILeAPJqVS+IE7IlGj8Aqn56bIoG9A/Xg UepIr9PkVYqdrblAse6ww== X-UI-Out-Filterresults: notjunk:1;V03:K0:JDc5rbPPiV4=:XAvQ8JJ5XLRK8GSkrUMuz/ HWUwAcw/PhALur/u6/ttxc3cm9gdCqtsTNP52XyBncxE2HOTgoKvR3otYj/sts/ORoquxdGsz BxR0NKAzNwmYughjAVvXKClqjgD9SEX8zpODX2NZzeOWv5JayFghv5E6qGgaoqyGUzUp2zsL3 AFfZQWAAKs9U8Doq+EnhblZnFZbJYXw8DnzdtvE0+a0EI+0oJvQPPU6CQqkYAjNkYiDj8QDQX GPT2vGHj479BaPHnNRIyBq+aXw6GOQ70W/+rZFZqFpbNf7bjKtYCMBl6OTswrpqXDQp+/coNl BZopxI79m2Xxes8/GmUJYF4p8qmEYfePM39/G1O/ErJ5kzOaAOjI8gw4OiuEwN1z53/Fu09dN nH48rqsKfJVRCo3Fh0FlcWNbVVn23+3YoQOKj8/hkTeZD7tbcwbAEEniEIIFFeKeY6ZHmFkmm UGmKiaWSa2GilVF0BbvBv/m3EQ9PF61lukpTnI2cpAaXzUdFAOciz6he839Bk8PRkm/Gg4LgQ fL+LlDYge+e1k0KnTuY/I5ckYX8WuOZHZtN87AgdBPO9qsV8jeh6AjhErOfyeMSU0hUhP0KuZ DJ4x+nwBH3akGdENlotFLEuh8ogcq2IIk+eB9ge4Krbd/CjIhHt2VKGP7uZEuQR1Qv0qwqMTP kkZ6QFe/kMFjoAGKoKyw75KK4IjiMwWixw0j5uI706+1CfzNH3T3rEvOMoYcU4flZYNW+Ztej tMj9T/hBrnPCeLPBBi8Mb8K0S8H8UPmwftlyZA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190710_060240_916478_CEF698EA X-CRM114-Status: GOOD ( 11.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Shuah Khan , linux-kernel@vger.kernel.org, Arnd Bergmann , Huw Davies , Catalin Marinas , Daniel Lezcano , Will Deacon , linux-mips@vger.kernel.org, Ralf Baechle , Russell King , clang-built-linux@googlegroups.com, Paul Burton , linux-kselftest@vger.kernel.org, Rasmus Villemoes , Dmitry Safonov <0x7f454c46@gmail.com>, Mark Salyzyn , Peter Collingbourne , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 32-bit x86 when building with clang-9, the loop gets turned back into an inefficient division that causes a link error: kernel/time/vsyscall.o: In function `update_vsyscall': vsyscall.c:(.text+0xe3): undefined reference to `__udivdi3' Use the provided __iter_div_u64_rem() function that is meant to address the same case in other files. Fixes: 44f57d788e7d ("timekeeping: Provide a generic update_vsyscall() implementation") Signed-off-by: Arnd Bergmann --- kernel/time/vsyscall.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/time/vsyscall.c b/kernel/time/vsyscall.c index a80893180826..8cf3596a4ce6 100644 --- a/kernel/time/vsyscall.c +++ b/kernel/time/vsyscall.c @@ -104,11 +104,7 @@ void update_vsyscall(struct timekeeper *tk) vdso_ts->sec = tk->xtime_sec + tk->wall_to_monotonic.tv_sec; nsec = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift; nsec = nsec + tk->wall_to_monotonic.tv_nsec; - while (nsec >= NSEC_PER_SEC) { - nsec = nsec - NSEC_PER_SEC; - vdso_ts->sec++; - } - vdso_ts->nsec = nsec; + vdso_ts->sec += __iter_div_u64_rem(nsec, NSEC_PER_SEC, &vdso_ts->nsec); if (__arch_use_vsyscall(vdata)) update_vdso_data(vdata, tk); -- 2.20.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel