From: Emiliano Ingrassia <ingrassia@epigenesys.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: "linux-perf-users@vger.kernel.org"
<linux-perf-users@vger.kernel.org>,
Alistair Francis <alistair.francis@wdc.com>,
"Maciej W. Rozycki" <macro@wdc.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Bruce Ashfield <bruce.ashfield@gmail.com>,
Khem Raj <raj.khem@gmail.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Richard Purdie <richard.purdie@linuxfoundation.org>,
Palmer Dabbelt <palmer@dabbelt.com>, Jiri Olsa <jolsa@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Namhyung Kim <namhyung@kernel.org>,
linux-riscv <linux-riscv@lists.infradead.org>
Subject: Re: perf tools build broken for RISCV 32 bit
Date: Wed, 20 Jan 2021 18:56:55 +0100 [thread overview]
Message-ID: <YAhu579mXEZQc8ma@ingrassia.epigenesys.com> (raw)
In-Reply-To: <CAK8P3a1Kjy14Pxf4_1SOYA5cy1bSYhhxW9_5LefNzJ2dRTJ29g@mail.gmail.com>
Hi Arnd,
On Wed, Jan 20, 2021 at 05:03:30PM +0100, Arnd Bergmann wrote:
> On Wed, Jan 20, 2021 at 4:45 PM Emiliano Ingrassia
> <ingrassia@epigenesys.com> wrote:
> > > > > rv32 is in the unfortunate position of being the first one that has a glibc
> > > > > port, so it hits a lot of problems that other architectures do not.
> > > > > If the applications get fixed properly, then at least they will also
> > > > > work with musl-1.2 and a (will work-in-progress) glibc that will
> > > > > eventually allow building with 64-bit time_t.
> > > >
> > > > Ok, so in case of perf we probably should limit the needed patch to
> > > > riscv 32 bit architecture, unless we want to solve the problem for all
> > > > 32 bit architecture with time_t 64 bit support.
> > >
> > > No, whatever you do should be written to work on all 32-bit
> > > architectures. It would be crazy to add a special case for one
> > > architecture when it's easier to fix it properly.
> > >
> > > What was wrong with the helper function I suggested?
> >
> > Sorry, I was just trying to have a more clear picture of the problem.
> >
> > I'm totally fine with the helper function you proposed. About that,
> > should such approach be used for every time64 syscall for which is known
> > that there is no libc wrapper?
>
> We have previously discussed adding generated wrappers for every
> syscall, but my suggestion to have an inline function in one of the kernel
> headers was not very popular at the time.
>
> I think futex() is very much a special case here because this is the
> only[1] thing that gets called directly by a number of applications through
> syscall(). All the other time32 system calls have wrappers that are
> provided by any C library, which will just use the correct syscall number
> to match the arguments, or do a conversion if needed.
>
> Most of the packages that use the other __NR_* macros need them
> for something other than calling them (e.g. strace), so a wrapper does
> not help.
>
> Arnd
>
> [1] technically, there is also io_{p,}getevents, but that is usually abstracted
> through libaio, and only that needs to be fixed. I checked
> https://pagure.io/libaio/commits/master, which seems to be the upstream
> but I do not see a fix in there, so this version is currently broken on 32-bit
> architectures with musl-1.2 as well as on rv32 with glibc. Distros may
> have already fixed this in their downstream copies.
>
> Arnd
That's OK with me.
Please, when you'll propose the patch cc me so I can test and give you my review.
About this, will you also patch perf to use __kernel_futex()?
Thank you, best regards.
Emiliano
prev parent reply other threads:[~2021-01-20 17:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-14 18:38 perf tools build broken for RISCV 32 bit Emiliano Ingrassia
2021-01-14 19:16 ` Arnd Bergmann
2021-01-15 11:13 ` Emiliano Ingrassia
2021-01-18 11:35 ` Emiliano Ingrassia
2021-01-18 11:56 ` Arnd Bergmann
2021-01-18 14:25 ` Emiliano Ingrassia
2021-01-18 14:39 ` Arnd Bergmann
2021-01-18 14:53 ` Emiliano Ingrassia
2021-01-18 15:19 ` Arnd Bergmann
2021-01-18 15:33 ` Emiliano Ingrassia
2021-01-18 15:44 ` Arnd Bergmann
2021-01-18 16:34 ` Emiliano Ingrassia
2021-01-18 17:00 ` Arnd Bergmann
2021-01-18 19:58 ` Arnd Bergmann
2021-01-19 16:53 ` Emiliano Ingrassia
2021-01-19 19:47 ` Arnd Bergmann
2021-01-20 14:44 ` Emiliano Ingrassia
2021-01-20 15:29 ` Arnd Bergmann
2021-01-20 15:45 ` Emiliano Ingrassia
2021-01-20 16:03 ` Arnd Bergmann
2021-01-20 17:56 ` Emiliano Ingrassia [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YAhu579mXEZQc8ma@ingrassia.epigenesys.com \
--to=ingrassia@epigenesys.com \
--cc=acme@redhat.com \
--cc=alistair.francis@wdc.com \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@kernel.org \
--cc=bruce.ashfield@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=macro@wdc.com \
--cc=namhyung@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=raj.khem@gmail.com \
--cc=richard.purdie@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox