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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9240FC77B7C for ; Fri, 26 May 2023 10:08:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243163AbjEZKIG (ORCPT ); Fri, 26 May 2023 06:08:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbjEZKIE (ORCPT ); Fri, 26 May 2023 06:08:04 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1FA519E; Fri, 26 May 2023 03:08:02 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 34QA6Oum011800; Fri, 26 May 2023 12:06:24 +0200 Date: Fri, 26 May 2023 12:06:24 +0200 From: Willy Tarreau To: Arnd Bergmann Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , thomas@t-8ch.de Subject: Re: [PATCH 04/13] selftests/nolibc: syscall_args: use __NR_statx for rv32 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Fri, May 26, 2023 at 11:21:02AM +0200, Arnd Bergmann wrote: > On Wed, May 24, 2023, at 19:48, Zhangjin Wu wrote: > > > > > +static int test_syscall_args(void) > > +{ > > +#ifdef __NR_fstat > > + return syscall(__NR_fstat, 0, NULL); > > +#elif defined(__NR_statx) > > + return syscall(__NR_statx, 0, NULL, 0, 0, NULL); > > +#else > > +#error Neither __NR_fstat nor __NR_statx defined, cannot implement > > syscall_args test > > +#endif > > +} > > Does this need to work on old kernels? My impression was that > this is only intended to be used with the kernel that ships the > copy, so you can just rely on statx to be defined and drop > the old fallbacks (same as for pselect6_time64 as I commented). Yes, as much as possible this is desirable because the purpose is clearly to simplify the build of applications. The reason is that some applications might want to run as well on older kernels, but may miss some syscalls on the nolibc shipped with these older ones. Since the project is quite young, it lags a lot behind what each kernel supports, so it's expected that users will take the most recent nolibc version to benefit from support of syscalls that were already present in older ones. The alternative would be to take the project out of the kernel as it was before but this would likely complicate contributions. However the selftest code is clearly specific to a kernel IMHO, since its goal is to be used to check that the shipped version of nolibc works on this kernel. As such, my view on this is that as long as it doesn't require unreasonable efforts to support older kernels for the userland code, we should try. If sometimes it's a big pain, we should not insist too much, but at least making sure that only the feature in question will not work would be desirable. Thanks, Willy