Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3808972ybk; Tue, 19 May 2020 13:29:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRji0f75zncDxcycMtx1zqaD4t6238/bQtcmKFaRLh8NaL4TlH4IqkSnWMpw/hCDnjw5EW X-Received: by 2002:a17:906:3912:: with SMTP id f18mr919890eje.539.1589920162829; Tue, 19 May 2020 13:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589920162; cv=none; d=google.com; s=arc-20160816; b=O8pldDWYY3+zdIivyuTTDdRENlVFa/77qFglm4tSjKmvMjwB9NKANvuzfkLdhHH4oP 06jlmPi7Xa+MpOh773uDEDLHThMoZ7J/vOezOEulY0RQ75M0bgIiiE2Ud9MnauTQ76+e MXQ8CVmq9tsjEBwwyRki8hnPjUfREAfU2K0rEvBjUTejSzMMo+5Yz7+XnKtnmjsHEQhr 6O5ZThxwxcWie+Rnk5O12PSvQVy1JubesES5IkHZN1j/jk+mhJx9Z4KVgHP3OFfc1XYr Bn62J7By4CHGwpwFXrGok3DK1Iq9eFAEWVp1md6TJb56wp38ciRB05vIYK/uB5mCSgax KQ8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:from:references:cc:to:dkim-signature; bh=BEhjl2sdMOZA0+u7BxgbzxLPOF8R+jwnsLIgVIjuNrQ=; b=dSGImYjVyWEFd6Dp2Vp3JBzE7bsca1OosLS9lixrJeMOvge+vy5DYRzi3UsiBJpaxy UUePzfKJIWqipZF5JHHPRA3utp5y2vEYkBJuOrCvOCgkQ7UUsTmf548+EsZvRkz0ogie PqsQCeykef40lsVJ3ThCIARN7gadUdL6uCtD5Ymprtrc1TbKWCfoGTi0WG7EqXMq/yIp g9WVSzo6rRdmKUSiyV3aJPElMhCa6nwWAUI8RajrlNJEsn7J9p2TKcM5X0t7ySz+BH6Z DvCdJOswcPELN9DxwX+4h4+kDn1VC2abivLYrAk8vUo5YV2gWSva04tyTQHMCFVvADm9 qXHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vcfzLicS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j7si492252ejs.646.2020.05.19.13.28.57; Tue, 19 May 2020 13:29:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vcfzLicS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727070AbgESUY0 (ORCPT + 99 others); Tue, 19 May 2020 16:24:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726283AbgESUYZ (ORCPT ); Tue, 19 May 2020 16:24:25 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BFC6C08C5C0 for ; Tue, 19 May 2020 13:24:24 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id g20so266006qvb.9 for ; Tue, 19 May 2020 13:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=to:cc:references:from:autocrypt:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=BEhjl2sdMOZA0+u7BxgbzxLPOF8R+jwnsLIgVIjuNrQ=; b=vcfzLicSVcEJCTGWSvbckZ/Vd1G7w0WYemjhBFSHrKBLv+gc66U8GSb5LU8krom4d6 9E+cZn179Kvh/4YaUKu+eKgTC0y8txJTN5DUmazVIz+NtU25CnUnuNBTOjBFOmPKkJtg nlfOJ8C/lJFAYm07FuogQ5ujzs51Cc9Vh0wdcCF66w/svFGUJ265Erzur4gV+S6LUuvV 42GIrluv3U2BDhBRHBDAGjkBLDK00VAGjkOJrNS67YjS7JecJkO5nCEOn2rTkCTpgSnc DpVgmAunIi/V9oSPXhM2VIU2e+DKJfT3FpC26it4wCw9M/JwggZgqcDLy20ktPhVWkfE yNWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:autocrypt:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=BEhjl2sdMOZA0+u7BxgbzxLPOF8R+jwnsLIgVIjuNrQ=; b=MM5vTrWXN2qK/yBsPj5r5yR8I2OsPs0LfFENi2wLzxlG3e+48qRUwHgaLKQyEKEhcj V38i8Zm9liutDwgdv4zYSDc2LuLCdtv/K9NHYAEWti6AvGIKJue92F73OSjXJoK8eii+ RhZpOewAViXL/HCN4OszG7s0Bw4Ga1ZLY/VKSCt01Sg8Sc/NBaY7HwBlLfjfYIdn+ukK dtjAiwPB3JVFiG86tFqTLyNAP1tX9pEy2q23Oj1N/35OUK1CbFd/8O40e1pD9bqDD1zz Y3QhbSiI1A8AfdYGv95scg+9gyAX6J4QgXLuH6J3f6JiZdSa6VSJH7IieKUMaf7/tIRg n5NA== X-Gm-Message-State: AOAM533pJt+hJcuXBt9tPh2Ro6+t6uWh4BoVol7uGYdSQxxTCLQfV28m 7iSoskmKpMXbJNIjCEVUW/nkgg== X-Received: by 2002:a0c:f445:: with SMTP id h5mr1361198qvm.151.1589919863076; Tue, 19 May 2020 13:24:23 -0700 (PDT) Received: from [192.168.1.4] ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id i41sm702836qte.15.2020.05.19.13.24.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 May 2020 13:24:22 -0700 (PDT) To: Arnd Bergmann , Vincenzo Frascino , Russell King - ARM Linux Cc: Will Deacon , Rich Felker , Jack Schmidt , Linux ARM , Linux Kernel Mailing List , Szabolcs Nagy , Thomas Gleixner , Stephen Boyd References: From: Adhemerval Zanella Autocrypt: addr=adhemerval.zanella@linaro.org; prefer-encrypt=mutual; keydata= mQINBFcVGkoBEADiQU2x/cBBmAVf5C2d1xgz6zCnlCefbqaflUBw4hB/bEME40QsrVzWZ5Nq 8kxkEczZzAOKkkvv4pRVLlLn/zDtFXhlcvQRJ3yFMGqzBjofucOrmdYkOGo0uCaoJKPT186L NWp53SACXguFJpnw4ODI64ziInzXQs/rUJqrFoVIlrPDmNv/LUv1OVPKz20ETjgfpg8MNwG6 iMizMefCl+RbtXbIEZ3TE/IaDT/jcOirjv96lBKrc/pAL0h/O71Kwbbp43fimW80GhjiaN2y WGByepnkAVP7FyNarhdDpJhoDmUk9yfwNuIuESaCQtfd3vgKKuo6grcKZ8bHy7IXX1XJj2X/ BgRVhVgMHAnDPFIkXtP+SiarkUaLjGzCz7XkUn4XAGDskBNfbizFqYUQCaL2FdbW3DeZqNIa nSzKAZK7Dm9+0VVSRZXP89w71Y7JUV56xL/PlOE+YKKFdEw+gQjQi0e+DZILAtFjJLoCrkEX w4LluMhYX/X8XP6/C3xW0yOZhvHYyn72sV4yJ1uyc/qz3OY32CRy+bwPzAMAkhdwcORA3JPb kPTlimhQqVgvca8m+MQ/JFZ6D+K7QPyvEv7bQ7M+IzFmTkOCwCJ3xqOD6GjX3aphk8Sr0dq3 4Awlf5xFDAG8dn8Uuutb7naGBd/fEv6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yHJGxsCLU+Et0mryX8qZwqibJIzu7kUJQdQDljbRPDFd/xmGUFCQiQAncSilYOcxNU EMVCXPAQTteqkvA+gNqSaK1NM9tY0eQ4iJpo+aoX8HAcn4sZzt2pfUB9vQMTBJ2d4+m/qO6+ cFTAceXmIoFsN8+gFN3i8Is3u12u8xGudcBPvpoy4OoG Subject: Re: clock_gettime64 vdso bug on 32-bit arm, rpi-4 Message-ID: <0c2abcd1-7da8-2559-1e93-4c3bdd38dec1@linaro.org> Date: Tue, 19 May 2020 17:24:18 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/05/2020 16:54, Arnd Bergmann wrote: > Jack Schmidt reported a bug for the arm32 clock_gettimeofday64 vdso call last > month: https://github.com/richfelker/musl-cross-make/issues/96 and > https://github.com/raspberrypi/linux/issues/3579 > > As Will Deacon pointed out, this was never reported on the mailing list, > so I'll try to summarize what we know, so this can hopefully be resolved soon. > > - This happened reproducibly on Linux-5.6 on a 32-bit Raspberry Pi patched > kernel running on a 64-bit Raspberry Pi 4b (bcm2711) when calling > clock_gettime64(CLOCK_REALTIME) Does it happen with other clocks as well? > > - The kernel tree is at https://github.com/raspberrypi/linux/, but I could > see no relevant changes compared to a mainline kernel. Is this bug reproducible with mainline kernel or mainline kernel can't be booted on bcm2711? > > - From the report, I see that the returned time value is larger than the > expected time, by 3.4 to 14.5 million seconds in four samples, my > guess is that a random number gets added in at some point. What kind code are you using to reproduce it? It is threaded or issue clock_gettime from signal handlers? > > - From other sources, I found that the Raspberry Pi clocksource runs > at 54 MHz, with a mask value of 0xffffffffffffff. From these numbers > I would expect that reading a completely random hardware register > value would result in an offset up to 1.33 billion seconds, which is > around factor 100 more than the error we see, though similar. > > - The test case calls the musl clock_gettime() function, which falls back to > the clock_gettime64() syscall on kernels prior to 5.5, or to the 32-bit > clock_gettime() prior to Linux-5.1. As reported in the bug, Linux-4.19 does > not show the bug. > > - The behavior was not reproduced on the same user space in qemu, > though I cannot tell whether the exact same kernel binary was used. > > - glibc-2.31 calls the same clock_gettime64() vdso function on arm to > implement clock_gettime(), but earlier versions did not. I have not > seen any reports of this bug, which could be explained by users > generally being on older versions. > > - As far as I can tell, there are no reports of this bug from other users, > and so far nobody could reproduce it. > > - The current musl git tree has been patched to not call clock_gettime64 > on ARM because of this problem, so it cannot be used for reproducing it. So should glibc follow musl and remove arm clock_gettime6y4 vDSO support or this bug is localized to an specific kernel version running on an specific hardware? > > If anyone has other information that may help figure out what is going > on, please share. > > Arnd >