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=-0.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 75E7DC432C0 for ; Thu, 28 Nov 2019 15:42:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 416C42178F for ; Thu, 28 Nov 2019 15:42:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=goldelico.com header.i=@goldelico.com header.b="aT4eqKsQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726634AbfK1PmK (ORCPT ); Thu, 28 Nov 2019 10:42:10 -0500 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.82]:16821 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbfK1PmK (ORCPT ); Thu, 28 Nov 2019 10:42:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1574955728; s=strato-dkim-0002; d=goldelico.com; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=nIftciHtdIZW58XYe32SJEVSKmd/d/4nuYbsUj5SOW4=; b=aT4eqKsQjooGlWu4T6PVkQr6dH6MsdWCkVplXu52Fd+oY9e69v2hFeHKensb0S/k43 OqJnrNoFPIGt5zq9FvfhX73aYzP4VLLaR9+ZxOBHJ9ZI6eXXa7IHy+F6RD+aqH0wUl/4 C8ZabKa5q/l+0sT+USRNWFZW8//w+gNXoUrcE+8JvPXDjfqKRQHuBtgUWMnjvVpyG6Rn EcGHz0FAXHChegSR4LbQ68hZ/mx7RG7rnWc8MSOF6eJju3O5BkAIzEcJrmwU2cqxcW/E jn/LaMPyNHU1+3+GDIJKtSGU4wZBV+24kJm+Hu21Jn8RYR2/V3bjliQL8QITkY0hfXoD GzSQ== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj4Qpw9iZeHmAiw43upSE=" X-RZG-CLASS-ID: mo00 Received: from imac.fritz.box by smtp.strato.de (RZmta 45.0.2 DYNA|AUTH) with ESMTPSA id y07703vASFg1Kot (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Thu, 28 Nov 2019 16:42:01 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: MIPS: bug: gettimeofday syscall broken on CI20 board From: "H. Nikolaus Schaller" In-Reply-To: <64ee0c3e-9a54-f86a-daf5-32d54454b8ad@arm.com> Date: Thu, 28 Nov 2019 16:42:01 +0100 Cc: Maarten ter Huurne , MIPS Creator CI20 Development , Ralf Baechle , Paul Burton , linux-mips@vger.kernel.org, Linux Kernel Mailing List , Discussions about the Letux Kernel Content-Transfer-Encoding: quoted-printable Message-Id: <3B85F0EB-DEB4-478B-8745-B44C991D82F4@goldelico.com> References: <18788C50-F29B-4BD7-89F6-B056FF490214@goldelico.com> <7b6275c7-ab2b-a647-6bf7-d5e1c4523c98@arm.com> <4807842.gtHLO0kk0V@hyperion> <01D75E67-EC2E-4C74-B9BB-752773C481A9@goldelico.com> <64ee0c3e-9a54-f86a-daf5-32d54454b8ad@arm.com> To: Vincenzo Frascino X-Mailer: Apple Mail (2.3124) Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org > Am 28.11.2019 um 15:01 schrieb Vincenzo Frascino = : >=20 >>>=20 >>=20 >> What still does not fit into the picture is the errno =3D 1 i.e. = EPERM. >> Maybe I have to study the libc code that tries to read the ELF = symbols >> you have mentioned. It may fail for unknown reasons. >>=20 >=20 > This is what I was going to suggest next. It might be that something = is not > working there. >=20 > Let us know your findings. Well, my findings are that the gettimeofday() function in glibc-2.24 = (used by Debian Stretch) is simple: > #include > #include >=20 > #undef __gettimeofday >=20 > #ifdef HAVE_GETTIMEOFDAY_VSYSCALL > # define HAVE_VSYSCALL > #endif > #include >=20 > /* Get the current time of day and timezone information, > putting it into *tv and *tz. If tz is null, *tz is not filled. > Returns 0 on success, -1 on errors. */ > int > __gettimeofday (struct timeval *tv, struct timezone *tz) > { > return INLINE_VSYSCALL (gettimeofday, 2, tv, tz); > } > libc_hidden_def (__gettimeofday) > weak_alias (__gettimeofday, gettimeofday) > libc_hidden_weak (gettimeofday) >=20 but the macro INLINE_VSYSCALL is not immediately understandable. So I have no idea how to patch the kernel to check why that sets errno. And patching libc is beyond my range of experience. It is only clear that your kernel patch did break it for MIPS (at least for CI20) but for obvious reasons not for ARM. BTW: kernel v5.4 works with Debian Jessie, i.e. glibc-2.19. Maybe it triggers a fallback. BR and thanks, Nikolaus