Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp315876pxb; Thu, 9 Sep 2021 01:21:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxAbdnjsoPpfKMPkDtREP4QZ68HLoNDKmWfQOyp1H+YVREzgFn4eUZ4glgs6Kie63MwI2W X-Received: by 2002:a92:7302:: with SMTP id o2mr1493695ilc.44.1631175719601; Thu, 09 Sep 2021 01:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631175719; cv=none; d=google.com; s=arc-20160816; b=dwR6fm3Pv07tAmgJA607XhPA8XkTFnvd7hM7LXgDAAeJK9L7Cm+V5OSILe2wKhZjXJ bzsHoLyyrYIBjayax1UB4WAsl9a3M5t4werN6sbIz8iJswSEMVb9PrDrMA/v9+vrMM+v 5gBJiEGVFRsqTPVxH7Y2bvlR1a/aBUDMgULEMIRM7i9uuyZeOXflF/o/2mqUJzb69wuR X+Jv8Y8M5KwhkVns2W9KKgRsT0e6sqTX5ESNXC+9ihQspFRnKXckvxEGqnOnsDoGING2 Srlb6iGG5Uknc8d8CGXucJ6WDFSBwpz5ayuRA2XxYGOJgXOG0QBQrFat+ctyM0BnfNG7 OR6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=0JbimkOuGWyAmEx1FzpGof+StnC/SSj+68dFtQODG1E=; b=a3ueaeSS21C6p8PE7au8/3zkofq8vLFJiJdo9a2nHutycW8smDcqKWHb9WiYFRGTJJ GKo9QyqlN04ieAX6fAd5FFbCnIFDfHiVUX2RIZ7YTnEle6YPIglbbCvlOt66fC/3C47o Tl4ldg3GhZRHCGk6N5gMX1ldCHda6MUtCcdlK0tPew/GUVqfJbVUqa/c1PRNOeeaSaNL l+vR4mOGGSETkXKER1xmy4RfQlIKUDxcnt3cTFQfV3qslxOwSUNfhdNKtEoMvaaNqxEa pdqUoz+71YxbsEfMCLe4pA/QvlYtWYQN/kRZaCjaxIf1q7DecSkkAuYHQ4nxwlH3r4NN uhsA== 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 x13si1116524jat.3.2021.09.09.01.21.48; Thu, 09 Sep 2021 01:21:59 -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 S230250AbhIIIVi (ORCPT + 99 others); Thu, 9 Sep 2021 04:21:38 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:37951 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhIIIVh (ORCPT ); Thu, 9 Sep 2021 04:21:37 -0400 Received: from mail-wm1-f44.google.com ([209.85.128.44]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MekvT-1my8LO16EH-00aq5T; Thu, 09 Sep 2021 10:20:27 +0200 Received: by mail-wm1-f44.google.com with SMTP id e26so719355wmk.2; Thu, 09 Sep 2021 01:20:27 -0700 (PDT) X-Gm-Message-State: AOAM533UIItAzGCQjF5m2mdvmPxaTfGSnkPoOr/PZqGZmX+GNcnUri6v MOa+QO8ua6KGPKGERI9OA/jFU5WiTlwI9IA7iwY= X-Received: by 2002:a05:600c:896:: with SMTP id l22mr1514862wmp.173.1631175626890; Thu, 09 Sep 2021 01:20:26 -0700 (PDT) MIME-Version: 1.0 References: <20210909042543.1982893-1-alistair.francis@opensource.wdc.com> In-Reply-To: <20210909042543.1982893-1-alistair.francis@opensource.wdc.com> From: Arnd Bergmann Date: Thu, 9 Sep 2021 10:20:10 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] perf bench: Add support for 32-bit systems with 64-bit time_t To: Alistair Francis Cc: linux-riscv , linux-perf-users@vger.kernel.org, Linux Kernel Mailing List , Alistair Francis , Namhyung Kim , Jiri Olsa , Alexander Shishkin , Mark Rutland , Arnaldo Carvalho de Melo , Davidlohr Bueso , Darren Hart , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Atish Patra , Arnd Bergmann , Alistair Francis Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:awyyhFsU1jYtmonLl/6tOFZIx15FM7SK7uLUD8Bq2mKIcze7Aa5 VwIIHz/ZH0wL9MVr62zbI2uY0rFZu8I48ZUPUFkq+zcp2OWZTPag9QkTVl9pKs8Hr9qFhQW dsvSr+cAsqHVn5RQBt0C1qL8MX0cC8Gu6yKad53vWB5eDyLXdXjsFjVSzWhYZI1kLD1KNPB GuyuxHRs3tz6DIMijWjIA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:lxpvQd3C128=:17V+5UmY6GsGWQrIe4mqKl j7Nb7xIKnfpwtbee0sf7UGHlfQM2kYcvLIbPqT5JWqbeHUeRxuk+4fj3zIvlxifWVx3r9Rhds a6h5uYTFj/g/MhtAECv0TeQTOL9zgpnlJUnid9ITLm43W6OT54X4A2jUs1rdBw0uZ3rNGQC5K 3XNF360tmZSFiCixMz5l6UhP+gZdvJ/NNGrPGO2jbQddFD3+GMF8H1WggvWK8hXxYOhfc2y/X usJ8SkF9sSz6pr/KB2KSUVU6cHWmWw/a2i+c/UbwZedTc/425Nk/zCn1pGgCzHZ9fFYbg9RQh RIyCP1Wz5bL92EkF392/as4/9dE5ag8a8nT0qFflg9GbC5gEttV1qjbUaYHv9vGaLe74JTjmC DXzijK2snMpza+CUbbBdu2ed+C1AS9mcWA8srOmmr2xarXGqDW/VgfmnOM7zXD9031PapQmlI LX9855lxuH5I8z1OnaGx9VUPU9desyE69ZKfHkYk+C+bHj7kNQyuRAcZ81XrZdHG1e5yw/Wkq XCyMbRwAGl6yrnAciTdb3IeKQpAWWys4Wu9kcv4W+T0RfKK5MVr+WMTEoRU6H5/6lHLFlG5Sb sHzhSWjsrRi+JF6ImXMBG9Jwp7nSG7CGdwakB5F5yOCoXYbNr45HAnwCkEzxXveWQx/ZekoYb m0naUgqRlq2X980GjuB0rJ2ZzlNGV7aCGbRjOj/32TWJ42knOaDG3SSBQamKsD263BlZeRr0B Gu43PhK9PNOI0RssLmZVupNd6NsZIlXXLEq05r/7C9QO1BafCIOFSu+xkIWfWiB4qkFXHQt1M kn8lb4IJLPgpMb21Y4Ex/7vdJpB9dD66xILRrnb+pNHYDtLhJCfRH7Cqx5Fhx4YS0TuqTn6Ro afGcb7QhBLvbKu1kCV+w== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 9, 2021 at 6:25 AM Alistair Francis wrote: > > From: Alistair Francis > > Some 32-bit architectures (such are 32-bit RISC-V) only have a 64-bit > time_t and as such don't have the SYS_futex syscall. This patch will > allow us to use the SYS_futex_time64 syscall on those platforms. > > This patch does not attempt to gracefully allow 32-bit architectures > with both SYS_futex and SYS_futex_time64 to support a 64-bit time_t. > This patch only applies to 32-bit architectures with a 64-bit time_t. > > Signed-off-by: Alistair Francis Hi Alistair, I know you've made this mistake before and I've pointed it out several times. Please don't do this again, and try to fix up the ones you already broke! > +/** > + * Some newer 32-bit architectures (such as RISC-V 32-bit) don't have > + * the SYS_futex syscall and instead only have the SYS_futex_time64 call. > + * Let's ensure that those still compile and run by just using the > + * SYS_futex_time64 syscall. On these systems `struct timespec` will use a > + * 64-bit time_t so the SYS_futex_time64 call will work. > + */ > +#if !defined(SYS_futex) && defined(SYS_futex_time64) > + #define SYS_futex SYS_futex_time64 > +#endif This cannot work, as two system calls take different arguments: futex() takes a __kernel_old_timespec and futex_time64() takes a __kernel_timespec. You cannot derive anything about the ABI of the C library based on whether the macros are defined or not. Either you convert the arguments passed into the system call into the format expected by the kernel, or you pick the correct system call based on sizeof(struct timespec). Arnd