All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Zhangjin Wu <falcon@tinylab.org>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, thomas@t-8ch.de
Subject: Re: [PATCH v2 05/14] selftests/nolibc: add menuconfig for development
Date: Sat, 29 Jul 2023 10:22:06 +0200	[thread overview]
Message-ID: <20230729082206.GK956@1wt.eu> (raw)
In-Reply-To: <20230727132418.117924-1-falcon@tinylab.org>

Hi Zhangjin,

On Thu, Jul 27, 2023 at 09:24:18PM +0800, Zhangjin Wu wrote:
> Hi, Willy
> 
> > > On Wed, Jul 19, 2023 at 09:22:37PM +0800, Zhangjin Wu wrote:
> > > > The default DEFCONFIG_<ARCH> may not always work for all architectures,
> > > > let's allow users to tune some kernel config options with 'menuconfig'.
> > > > 
> > > > This is important when porting nolibc to a new architecture, it also
> > > > allows to speed up nolibc 'run' target testing via manually disabling
> > > > tons of unnecessary kernel config options.
> > > > 
> > > > Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
> > > > ---
> > > >  tools/testing/selftests/nolibc/Makefile | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > > 
> > > > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> > > > index 058e7be070ea..06954b4b3885 100644
> > > > --- a/tools/testing/selftests/nolibc/Makefile
> > > > +++ b/tools/testing/selftests/nolibc/Makefile
> > > > @@ -202,6 +202,9 @@ KERNEL_IMAGE  = $(objtree)/$(IMAGE)
> > > >  defconfig:
> > > >  	$(Q)$(MAKE_KERNEL) mrproper $(DEFCONFIG) prepare
> > > >  
> > > > +menuconfig:
> > > > +	$(Q)$(MAKE_KERNEL) menuconfig
> > > 
> > > What is the real benefit of this compared to just running the
> > > standard "make menuconfig" ? We should avoid adding makefile targets
> > > that do not bring value on top of that the top-level makefile does,
> > > because it will make the useful ones much harder to spot, and will
> > > tend to encourage users to use only that makefile during the tests,
> > > which is a bad practice since many targets will always be missing
> > > or work differently. It's important in my opinion that we strictly
> > > stick to what is useful to operate the tests themselves and this
> > > one doesn't make me feel like it qualifies as such.
> > 
> > Ok, get it.
> > 
> > I did like develop nolibc in tools/testing/selftests/nolibc/ without
> > changing directories frequently or specifying the "-C" option
> > unnecessary ;-) 
> >
> > Since "make menuconfig" is only required during the first porting of a new
> > architecture, so, it is ok to drop this patch.
> >
> 
> Oh, Willy, I did find this is very important again.
> 
> I just want to check and test if we need to disable vsx for 32-bit
> powerpc too, so, I plan to re-configure kernel via menuconfig to disable
> VSX in kernel side, and forcely enable vsx in application side, but it
> was very 'painful' when I was running something like this:
> 
>     $ make defconfig ARCH=ppc CROSS_COMPILE=powerpc-linux-gnu-
> 
> To do a further menuconfig, I must switch to something else:
> 
>     $ make menuconfig ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- -C ../../../../
> 
> Especially, our test is able to accept ARCH=ppc, but the top-level
> kernel still only accept powerpc, it makes the development very
> comfortable, of course, the typing of the relative or absolute path
> every time is either not a good idea.

It is "able" but that's not what ought to be used, since it's going to
be remapped to "powerpc". You're supposed to use XARCH for this one
since it's a variant (we could find other names if needed). I suspect
it just shows that the "override ARCH :=" is excessive and should not
be there. Usually when you put override in a makefile, it's going to
pop up as a bug elsewhere. Thus actually you could very well have :

   make ARCH=powerpc XARCH=ppc CROSS_COMPILE=powerpc-linux-gnu-

as the prefix for all your commands. Some will prefer to work directly
from the kernel dir:

 $ make ARCH=powerpc XARCH=ppc CROSS_COMPILE=powerpc-linux-gnu- -C tools/testing/selftests/nolibc-test defconfig
 $ make ARCH=powerpc XARCH=ppc CROSS_COMPILE=powerpc-linux-gnu- menuconfig

Others would do it from the nolibc-test dir as you did above.

> so, this doesn't simply duplicate with the one from top-level, it can
> get the right ARCH, srctree for us, and this is heavily used by our
> tinyconfig development to tune the config options very frequently, so,
> let's still add this one in the new revision?

I'm not *fundamentally* opposed to menuconfig, I just think that it's
appearing at the wrong place. Why not oldconfig, allmodconfig, randconfig,
allnoconfig etc then ? There is nothing in the test directory that is
supposed to be used interactively, either it's run in a batch for cross-
arch testing, or you use it to validate your kernel when you're working
on it. It feels strange that one would want to configure their kernel
from this sub-dir.

> But I plan to merge the mrproper targets here to save another patch,
> what about your idea?
> 
>     menuconfig mrproper:
> 	$(Q)$(MAKE_KERNEL) $@

Please no. Someone doing that in hope to clean only the result of
the tests would in fact ruin their config:

  $ make -C tools/testing/selftests/nolibc-test mrproper

This is another reason for not encouraging users to develop from
within that dir.

Willy

  reply	other threads:[~2023-07-29  8:22 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 13:16 [PATCH v2 00/14] selftests/nolibc: add minimal kernel config support - part1 Zhangjin Wu
2023-07-19 13:17 ` [PATCH v2 01/14] selftests/nolibc: allow report with existing test log Zhangjin Wu
2023-07-19 13:19 ` [PATCH v2 02/14] selftests/nolibc: add macros to enhance maintainability Zhangjin Wu
2023-07-22 12:20   ` Willy Tarreau
2023-07-25 12:37     ` Zhangjin Wu
2023-07-19 13:20 ` [PATCH v2 03/14] selftests/nolibc: print running log to screen Zhangjin Wu
2023-07-22 12:29   ` Willy Tarreau
2023-07-25 12:46     ` Zhangjin Wu
2023-07-19 13:21 ` [PATCH v2 04/14] selftests/nolibc: fix up O= option support Zhangjin Wu
2023-07-19 13:22 ` [PATCH v2 05/14] selftests/nolibc: add menuconfig for development Zhangjin Wu
2023-07-22 12:35   ` Willy Tarreau
2023-07-25 13:51     ` Zhangjin Wu
2023-07-27 13:24       ` Zhangjin Wu
2023-07-29  8:22         ` Willy Tarreau [this message]
2023-07-29 13:54           ` Zhangjin Wu
2023-07-19 13:23 ` [PATCH v2 06/14] selftests/nolibc: add mrproper " Zhangjin Wu
2023-07-22 12:36   ` Willy Tarreau
2023-07-19 13:24 ` [PATCH v2 07/14] selftests/nolibc: defconfig: remove mrproper target Zhangjin Wu
2023-07-22 12:46   ` Willy Tarreau
2023-07-25 14:04     ` Zhangjin Wu
2023-07-19 13:26 ` [PATCH v2 08/14] selftests/nolibc: string the core targets Zhangjin Wu
2023-07-22 12:57   ` Willy Tarreau
2023-07-25 14:20     ` Zhangjin Wu
2023-07-29  7:53       ` Willy Tarreau
2023-07-29  9:54         ` Zhangjin Wu
2023-07-29 17:15           ` Willy Tarreau
2023-07-29 17:44             ` Zhangjin Wu
2023-07-19 13:27 ` [PATCH v2 09/14] selftests/nolibc: allow quit qemu-system when poweroff fails Zhangjin Wu
2023-07-22 13:02   ` Willy Tarreau
2023-07-25 14:59     ` Zhangjin Wu
2023-07-29  8:04       ` Willy Tarreau
2023-07-19 13:28 ` [PATCH v2 10/14] selftests/nolibc: allow customize CROSS_COMPILE by architecture Zhangjin Wu
2023-07-19 13:29 ` [PATCH v2 11/14] selftests/nolibc: customize CROSS_COMPILE for 32/64-bit powerpc Zhangjin Wu
2023-07-19 13:30 ` [PATCH v2 12/14] selftests/nolibc: add tinyconfig target Zhangjin Wu
2023-07-22 13:07   ` Willy Tarreau
2023-07-25 15:13     ` Zhangjin Wu
2023-07-19 13:31 ` [PATCH v2 13/14] selftests/nolibc: tinyconfig: add extra common options Zhangjin Wu
2023-07-19 13:32 ` [PATCH v2 14/14] selftests/nolibc: tinyconfig: add support for 32/64-bit powerpc Zhangjin Wu
2023-07-22 13:17   ` Willy Tarreau
2023-07-25 16:04     ` Zhangjin Wu

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=20230729082206.GK956@1wt.eu \
    --to=w@1wt.eu \
    --cc=arnd@arndb.de \
    --cc=falcon@tinylab.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=thomas@t-8ch.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.