Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp381709pxb; Wed, 22 Sep 2021 04:29:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydQUJuvIwkz4KoAek04U0TAuinBjpSt0m93rP96hCr/6a86VE6i8ANSPRFweRdBXSf5RGh X-Received: by 2002:a05:6e02:12ca:: with SMTP id i10mr17907200ilm.201.1632310168606; Wed, 22 Sep 2021 04:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632310168; cv=none; d=google.com; s=arc-20160816; b=okXXXVMdF8JGvsUf/oIOcEExVPtelvoKUZCUJkDtA1VbVW8gtcF4MgtZwOI6maepnr 3RCAe48jCnSq/J+X3JZySKjCQ2VdslIDlq96j90VABWHrbZPOL4Fh1galmx8Zqfrspuy UtkbMELLZGp5NEg35Rz0YJLQm/KbSW/eVN91ElKSxh2qBWVKB/eGB+aNu6zRvScCppH5 412r93gsoMI6BZgrSl3y96zA5faJvs5IvY0WZgElbvzxYkGOruLgGnGiPcFxNuAwwNlc RxyA3m+GDlBb2UebpdcNM/sIkLetmIh8dJWVxxWNey+lpHEdSZ2UKYRwrFOB8YJhlXII rYfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=NgUYA0gBVl9sk4GQZSg4plszAHC31B6Yuu63Q/aTr5A=; b=e689QyQYV5F/+h5tfp78O5ba3UhBiUVzMEQkNjDp679Hs2Kkcycx5qQZ5mQMJFwZCW emEjEtn4H2k+M/5DaYjKoeb4qpNFHEgVhWHp/enm2RMNtZH0/upgKYyDC/YVcPkIHY4h aPO+832swbuJQnytEVVRccyZt7yFexsj5mx6QRNUunaoYssQg+h+W3I1Pv8RxOC321so W9UrxHg+a/TF/2HS/RZpn4sGYWr6HyfZnmlQ5QAkEpz6M/ainLcS1GkPhdujby3W2O12 8Inc/y6pNLyQHGertnGJh2MKtFp84uAG17CWPcl3w/YnMSiT5zKQzD2SSiOAaL3xfuwX SQ6w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si2197254jac.111.2021.09.22.04.29.16; Wed, 22 Sep 2021 04:29:28 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235670AbhIVL3o convert rfc822-to-8bit (ORCPT + 99 others); Wed, 22 Sep 2021 07:29:44 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:54689 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235422AbhIVL3n (ORCPT ); Wed, 22 Sep 2021 07:29:43 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.97]) with ESMTPSA (Nemesis) id 1Mf0Ru-1n3yru1oWQ-00gY3D; Wed, 22 Sep 2021 13:28:12 +0200 Received: by mail-wr1-f48.google.com with SMTP id t8so5778316wrq.4; Wed, 22 Sep 2021 04:28:12 -0700 (PDT) X-Gm-Message-State: AOAM5331qTdk/wBgbOmEdQ2DwA/D/XUOXqQkyfwtcoka3Obj6KA8mdFG rE7Z52jJJseEXexGUnAa/ykL37DWvBcr9dC1jCQ= X-Received: by 2002:adf:f481:: with SMTP id l1mr10127682wro.411.1632310091979; Wed, 22 Sep 2021 04:28:11 -0700 (PDT) MIME-Version: 1.0 References: <20210917061040.2270822-1-alistair.francis@opensource.wdc.com> <20210917061040.2270822-2-alistair.francis@opensource.wdc.com> <72990864-5ec6-1f73-efd9-61b667a172dd@collabora.com> <9db8c79a-f704-84ce-360b-84335f926a48@collabora.com> In-Reply-To: <9db8c79a-f704-84ce-360b-84335f926a48@collabora.com> From: Arnd Bergmann Date: Wed, 22 Sep 2021 13:27:55 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/2] perf bench: Add support for 32-bit systems with 64-bit time_t To: =?UTF-8?Q?Andr=C3=A9_Almeida?= Cc: Arnd Bergmann , Alistair Francis , Linux Kernel Mailing List , Alistair Francis , linux-riscv , Namhyung Kim , Jiri Olsa , linux-perf-users@vger.kernel.org, Alexander Shishkin , Mark Rutland , Arnaldo Carvalho de Melo , Davidlohr Bueso , Darren Hart , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Atish Patra , Alistair Francis Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:oKhwyJ++5qnKLB6p9FS+cu930Y5F9WXu9M133KWxH5o4nnddAFw rGKInGG6tM1zE9NKRl6acRsqMXT1EFfuorv4PVM7fcyePALDt6Hlh2eiitcR88zqOVIQ8CG vpTcA7RcCwACytMxhm7KGVASJBFZ50NYE+1A0UqfnK/BtXOLXdlqg4nFFdONyH7GIEaczYL xab4rcZ3XqXs9ciJng+PA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:lKpsXYQVrnU=:Oz8wML5xCK4WnlSzkb4BHx 3ZfPvaFlfHHqDD5X5HtTH9ZnCCnYIu9k+eeAS4W1xV3orN43eCL4qzW89bYUeWRXY+UKg8vMp IITMKNbzZWlp3m/QLx1jnnx7nw9mSVIXCfWpWQ4gW/VWQ9c2x/1KOLDhID5RarbgTfSpIjofP hVplTfNSymacFvho43p74m+lu2UoeI9mYt6aoOhCG93I9D/DWTON4GgdFQN1Wka3r8Pf22U/x LSwTS+w05WEYazzZ88D2ylWBEzLMQ1JY0hMKK5BvwQTYbcWxpLYzs+RNMkXDSg/xSm6U9VyBS bPUGiAp7NP+o5fNofOIZ6E/4oaqlN14iyV1VW8uCtziqqSb34qOwn1cdqa7SciqBpsQv8Krbn ElPWabW8i4t40T8Sf8nl1O+i+uQ75UDJ0DlYrps4zoK79YTtEsT3QgadhhFCHZKlAMNZ2Hvw9 ZlUhQvKOXubqDy9OwuG4qirK6ujPL0FyZguXeKlBjwDAbQRbpwx6LxJASeh9hZyB3j6socMHe NsPU4l97HAJ2Jv54V0i1Tg9LfQsKbQcUQThi90eMT89PCfeItICpYJFrPJY1pF/8+SsH4frsy ynjuAlOo92I03/dqwjkrF/KaOk4L4Zyfjf3mZXGr8t+fbg26iHHVPpvOnacGodUd21GxmQsJU lfY2NL7cgRV4Uq0lWgtXGkt3/WRGpV0VQxiXerNw3xMXnfKxXtM9Y9aeq9qm1F3l3BFOoIHT2 z2JzcYmy8JQrCFqLEKDImCjmbOUUz4PC8RLOgT9JvcLmjK9qaQeEAMCH+MxMHjzmKSm2qn8l3 lk2fBWG8+llYK+YK8fAtHBEVzBAwDVKp/MdeZ+6q8MnyIediOHp4GBHBLH+kmdAZJzLBEHCHE eLpE+ojuF9n5rMxr2VFQ== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2021 at 1:06 AM André Almeida wrote: > Às 05:08 de 21/09/21, Arnd Bergmann escreveu: > > On Tue, Sep 21, 2021 at 12:47 AM André Almeida > > wrote: > >> > >> #if defined(__i386__) || __TIMESIZE == 32 > >> # define NR_gettime64 __NR_clock_gettime64 > >> #else > >> # define NR_gettime64 __NR_clock_gettime > >> #endif > >> > >> struct timespec64 { > >> long long tv_sec; /* seconds */ > >> long long tv_nsec; /* nanoseconds */ > >> }; > >> > >> int gettime64(clock_t clockid, struct timespec64 *tv) > >> { > >> return syscall(NR_gettime64, clockid, tv); > >> } > >> > >> Then we can just use &timeout at __NR_futex_time64 for 32bit arch and at > >> __NR_futex for 64bit arch. > > > > This is still broken when you disable CONFIG_COMPAT_32BIT_TIME, > > which disables all system calls that take time32 arguments. > > > > Oh, I think my point was confusing then. My suggestion was to use only > the futex entry points that accepts time64, and to always use > clock_gettime that uses time64, for all platforms. Then it will work if > we disable CONFIG_COMPAT_32BIT_TIME. Yes, that would be ok. It does require using at least linux-5.1, but we perf is already sort-of tied to the kernel version. Arnd