Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1020921pxb; Thu, 9 Sep 2021 18:12:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm0lv7rhn0njLsATKLdoVWvXxZQWCOKcfPCqYreXu71owaRjBbYulFzawGynrm+PH+vKQM X-Received: by 2002:a05:6638:2182:: with SMTP id s2mr2312624jaj.26.1631236356491; Thu, 09 Sep 2021 18:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631236356; cv=none; d=google.com; s=arc-20160816; b=FdKumXNgiE11B+WGpRIMb1DM3sCS0vXJrKhDqGdMHMl2DR3eUxU7owpAun3YJsDanN gYGKYszRYDedkeeyntRO1MCaFmiN1Rcr/QRtov59IgckBReETelcP1fGi2FBwHDPcnLq Ez+SBBlWKCcXgOMcPOBAGY0uxELHgQf6CPa3ir+QLRBncSZ/FlP+XC00awM+OB8FSppp U8LPoJ/ruyNdpDM0KkM8voZCwt96yeyKX5D4KypPOrDoAcs8BfX37tFj8ONFHkziQjXd xXYmFam2nBWbcqFT6fGYow+U8a1q8RoHY6EdxLWb+EgOrQeY7rxSgrydcAqJPQuP3MNd eVnQ== 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:dkim-signature; bh=H9y8H6QOl79WQKF3o6TMJOZw1Wb4+/uT/dZLumITW4A=; b=IppMgVry4JWT5EPz9ICCyS6+FCNbSh7TEygZv1L8KEEIkmTjR6nuhgUjhlBXzC8gCd CDhNd5KXCsqyKKkrN1ZcBiR7iXEQtrkwCU/pqjVhJ418F1kAK5gbXWkU0jclc2Fl6cFo x8O9dDUSgSTPDkiY1HKTLnzgnxpOc2KwXY/+Jr2QQdgfslVufR0Yx/k1Eyy27pxqwUlW 8oHkKMwIwytFo9LFTSJBgYTvRWsz2CqdyhuJYvzff1puVPivrzt/QGidFJG6SFBKlHuX GVFmTq8QI7ME6WMWYbzD7fgFdiJNLas7KApRur8p5qEFRq5Pq8pMMS/fbySUrQmNWHHf s4ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Nh2OuGSt; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 12si4555142ilx.115.2021.09.09.18.12.24; Thu, 09 Sep 2021 18:12:36 -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=@gmail.com header.s=20210112 header.b=Nh2OuGSt; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231584AbhIJBMu (ORCPT + 99 others); Thu, 9 Sep 2021 21:12:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230454AbhIJBMN (ORCPT ); Thu, 9 Sep 2021 21:12:13 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13060C0698DA; Thu, 9 Sep 2021 17:45:50 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id m11so231966ioo.6; Thu, 09 Sep 2021 17:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H9y8H6QOl79WQKF3o6TMJOZw1Wb4+/uT/dZLumITW4A=; b=Nh2OuGStj34DcE5wDIX/unXlXbeq8oW6E+c7X7QlPGDMGLbg2mFT+xeu3eWmddsnBo AnDW7/w48XY/1fC8rZ4GcABgXQDdrHofdgfGOjH22Lb7cqkDMJTQ8O5qGY8c0n7qYyW+ ZGklISa8lfV8tRiEa/bW1Cjv50VKIvO2PTVkKcVYy61GT859uVrLVUJvOIgWyRX0uyvZ 0rTeR1CdWHZrohWHZ04+jlShW6SUPPOktciMTF21fmBeb51w3ZxTwLsGEcZ9VPluTJuI NYQtCT7tL3kUl2/1XbzDJKoHi5Yp4tXIQJWr0s2Of7iFTelNGAnRBobRI9lhCsg1LnaI wRdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H9y8H6QOl79WQKF3o6TMJOZw1Wb4+/uT/dZLumITW4A=; b=7uiGig03c1JDS3eBtUIU8h0Oyl59/IM24VbCXc4HhfPZS9TL4U84m4x+o9Q1l4/yG/ r3EqVY3KjMDjZ2IJ/P1cW/hsAvxdiVizwIqfNZQXmAXbVbIGOfafrf21irSsGRhm1eR2 yqGfs7BqGbkWKrAJXqbxAz718LN5OH7xfu8JVOYVkEM6LMAvYrqe51BbXmmTP/ORwR21 4nPQ4GwsOpHjDKRRNHrs62CBNqNwN1sWVUiQ80OLdsPxTW17zXTTsbRFhIKCqMPvfnJh Nzsg90mEZ8X/6meHu1uG1cYRHOMkYyTob4b+AMYGNDyPohyB8I9fuSIinwWR1NgchWEs 5eaw== X-Gm-Message-State: AOAM530paR2W0BISN+tLEkG6+oFhLY3ahjEmhUyNVpcXDzaevYWm2RCq 8V+8hBoiLM28+11MPekP+BcgZcZTyck7nS7TgByMG7ZaJ0Q= X-Received: by 2002:a05:6638:e8f:: with SMTP id p15mr2196917jas.114.1631234749514; Thu, 09 Sep 2021 17:45:49 -0700 (PDT) MIME-Version: 1.0 References: <20210909042543.1982893-1-alistair.francis@opensource.wdc.com> In-Reply-To: From: Alistair Francis Date: Fri, 10 Sep 2021 10:45:23 +1000 Message-ID: Subject: Re: [PATCH] perf bench: Add support for 32-bit systems with 64-bit time_t To: Arnd Bergmann Cc: Alistair Francis , linux-riscv , linux-perf-users@vger.kernel.org, Linux Kernel Mailing List , Namhyung Kim , Jiri Olsa , 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 9, 2021 at 6:20 PM Arnd Bergmann wrote: > > 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). Thanks Arnd. Sorry I hadn't looked at this in a while and forgot that it's more complex. I have some patches to fix this up. I'll send them later today. Alistair > > Arnd