From: "Thomas Weißschuh" <thomas@t-8ch.de>
To: Zhangjin Wu <falcon@tinylab.org>
Cc: w@1wt.eu, arnd@arndb.de, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v1 00/22] selftests/nolibc: add minimal kernel config support
Date: Tue, 18 Jul 2023 17:19:50 +0200 [thread overview]
Message-ID: <67eb70d4-c9ff-4afc-bac7-7f36cc2c81bc@t-8ch.de> (raw)
In-Reply-To: <20230718134323.14819-1-falcon@tinylab.org>
On 2023-07-18 21:43:23+0800, Zhangjin Wu wrote:
> Hi, Willy, Thomas
>
> I have prepared the powerpc + powerpc64 support together with the
> tinyconfig for them, still have some questions for more discussion.
>
> > On Wed, Jul 12, 2023 at 01:18:26AM +0800, Zhangjin Wu wrote:
> [...]
> >
> > Reading the beginning of the sentence made me immediately think that it's
> > what doc is for. You know, if you give a fish to a hungry man he eats one
> > day, if you teach him to fish he eats every day. Knowing what to download
> > from where is much more instructive than running "make download" or even
> > worse, "make" and having the downloads secretly succeed (or fail). If you
> > think the doc is hard to find I'm also fine with a patch for makefile
> > and/or nolibc-test passing a pointer to its location as a reminding
> > comment for example.
> >
>
> The whole tinyconfig support for every architecture is 'huge', I plan to
> send them one by one, if required, will document them with the required
> bios and/or toolchain.
Which part is huge?
This is surprising.
> The first architectures plan to support are powerpc + powerpc64, powerpc does
> require extra kernel config options even with defconfig, so, it is a very good
> first example, and the extconfig target will be added together.
Are you planning to do powerpc and tinyconfig support in one series?
Splitting it would be better in my opinion.
> The left question from me is that if is it ok to just use tinyconfig instead of
> defconfig after we enable tinyconfig for a new architecture, I mean just add a
> new DEFCONFIG_<ARCH>=tinyconfig line for the new architecture, don't use the
> 'defconfig' any more, let's take a look at the powerpc/powerpc64 lines below:
>
> # default kernel configurations that appear to be usable
> DEFCONFIG_i386 = defconfig
> DEFCONFIG_x86_64 = defconfig
> DEFCONFIG_x86 = defconfig
> DEFCONFIG_arm64 = defconfig
> DEFCONFIG_arm = multi_v7_defconfig
> DEFCONFIG_mips = malta_defconfig
> DEFCONFIG_powerpc = tinyconfig
> DEFCONFIG_powerpc64 = tinyconfig
> DEFCONFIG_riscv = defconfig
> DEFCONFIG_s390 = defconfig
> DEFCONFIG_loongarch = defconfig
> DEFCONFIG = $(DEFCONFIG_$(XARCH))
>
> Of course, we need to customize the EXTCONFIG for them (about ~5 options for
> all of the architectures):
>
> # extra kernel configs by architecture
> EXTCONFIG_powerpc = $(addprefix -e ,COMPAT_32BIT_TIME PPC_PMAC PPC_OF_BOOT_TRAMPOLINE SERIAL_PMACZILOG SERIAL_PMACZILOG_TTYS SERIAL_PMACZILOG_CONSOLE)
> EXTCONFIG_powerpc64 = $(addprefix -e ,PPC64 CPU_LITTLE_ENDIAN PPC_POWERNV HVC_OPAL)
> EXTCONFIG_XARCH = $(EXTCONFIG_$(XARCH))
These could also be put into dedicated config files. Then they don't
clutter the makefile and it's easier to maintain.
nolibc.config: Generic configs on top of tinyconfig
nolibc.arm64.config: Arch-specific configs for arm64
Also the extra parameter could also be passed via command line arguments to make.
This way we don't have to modify the configuration options at all.
The user can provide a config (or we use a tinyconfig) and everything
required by nolibc-test is enabled on top when building.
make CONFIG_COMPAT_32BIT_TIME=y ...
tools/testing/selftests/wireguard/qemu/ seems to be doing something
similar as nolibc-test.
> The extra common options (based on default kernel tinyconfig) are also required
> to make nolibc-test.c passes without failures (~2 skips are procfs related, so,
> procfs is not added) are minimal:
>
> # extra kernel configs shared among architectures
> EXTCONFIG_COMMON = -e BLK_DEV_INITRD --set-str INITRAMFS_SOURCE $(CURDIR)/initramfs
> EXTCONFIG_COMMON += -e BINFMT_ELF
> EXTCONFIG_COMMON += -e PRINTK -e TTY
>
> Compare to defconfig, tinyconfig not only allows test all of the nolibc
> functions, but also is faster (around ~1-2 minutes, defconfig may cost ~30
> minutes and even more) and brings us with smaller image size.
>
> To only test nolibc itself, I do think tinyconfig with the above
> extconfig support is enough, even if we need more, we can update the
> EXTCONFIG_COMMON and EXTCONFIG_<ARCH> in the future.
IMO tinyconfig is enough, defconfig doesn't seem to be necessary then.
> I have prepared tinyconfig for all of the supported architectures
> locally, If you agree with only reserve the DEFCONFIG_<ARCH>=tinyconfig
> line, I will send a series of patchset to add tinyconfig for every
> architecture with it, at last, it will become:
>
> # default kernel configurations that appear to be usable
> DEFCONFIG_i386 = tinyconfig
> DEFCONFIG_x86_64 = tinyconfig
> DEFCONFIG_x86 = tinyconfig
> DEFCONFIG_arm64 = tinyconfig
> DEFCONFIG_arm = tinyconfig
> DEFCONFIG_mips = tinyconfig
> DEFCONFIG_powerpc = tinyconfig
> DEFCONFIG_powerpc64 = tinyconfig
> DEFCONFIG_riscv = tinyconfig
> DEFCONFIG_s390 = tinyconfig
> DEFCONFIG_loongarch = tinyconfig
> DEFCONFIG = $(DEFCONFIG_$(XARCH))
>
> So, perhaps it is better to simply use tinyconfig as the default DEFCONFIG, and
> therefore there is no need to add powerpc and powerpc64 specific lines:
>
> # default kernel configurations that appear to be usable
> DEFCONFIG_i386 = defconfig
> DEFCONFIG_x86_64 = defconfig
> DEFCONFIG_x86 = defconfig
> DEFCONFIG_arm64 = defconfig
> DEFCONFIG_arm = multi_v7_defconfig
> DEFCONFIG_mips = malta_defconfig
> DEFCONFIG_riscv = defconfig
> DEFCONFIG_s390 = defconfig
> DEFCONFIG_loongarch = defconfig
> DEFCONFIG = $(or $(DEFCONFIG_$(XARCH)),tinyconfig)
>
> To support tinyconfig for a new architecture, we can simply remove the
> 'DEFCONFIG_<ARCH> = defconfig' line and get the core options from
> defconfig to customize the EXTCONFIG_ARCH, with tinyconfig, it is very
> fast and easy to verify the run target for a new architecture.
>
> At last, we will have many EXTCONFIG_<ARCH> lines and only a DEFCONFIG line:
>
> # default kernel configurations that appear to be usable
> DEFCONFIG = $(or $(DEFCONFIG_$(XARCH)),tinyconfig)
>
> Or at last, we remove the above line and the defconfig target and only reserve
> a tinyconfig target:
>
> tinyconfig:
> $(Q)$(MAKE_KERNEL) tinyconfig prepare
>
> Welcome your suggestion.
Looks fine to me either way.
> > > > And I think that helping the user
> > > > prepare certain steps or iterate over architectures *is* useful. When
> > > > you do it in two layers (the script replacing the user, the makefile
> > > > doing the build job), it remains easy and convenient to use, and you
> > > > can pick only what you need (e.g. "please build musl for me"). And if
> > > > something goes wrong, it's simple for the user to takeover and complete
> > > > that failed task by changing an arch name, a directory or anything, and
> > > > have their tools ready. Let's just never make that automatic for the
> > > > sake of everyone's health!
> > >
> > > Ok, the revision will align with the original Makefile and remove the automatic
> > > parts and no change about the OUTPUT.
> >
> > Just check that you can force it from your script on the make command
> > line. If you see that it's not possible, we should do something because
> > I don't want to force you to make distclean all the time if not needed.
> > But if you find that passing certain options (O=, OUTPUT= or anything
> > else) does the job, it only needs to be documented.
>
> Yeah, I have used objtree intead of srctree to fix up the O= argument
> support, it fills my requirement to build kernel for every architecture
> in their own output directory.
>
> Best regards,
> Zhangjin
>
> >
> > Thanks,
> > Willy
next prev parent reply other threads:[~2023-07-18 15:19 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-25 16:10 [PATCH v1 00/22] selftests/nolibc: add minimal kernel config support Zhangjin Wu
2023-06-25 16:12 ` [PATCH v1 01/22] selftests/nolibc: add test for -include /path/to/nolibc.h Zhangjin Wu
2023-06-25 16:13 ` [PATCH v1 02/22] selftests/nolibc: print result to the screen too Zhangjin Wu
2023-06-25 16:14 ` [PATCH v1 03/22] selftests/nolibc: allow use x86_64 toolchain for i386 Zhangjin Wu
2023-06-25 16:15 ` [PATCH v1 04/22] selftests/nolibc: add menuconfig target for manual config Zhangjin Wu
2023-06-25 16:19 ` [PATCH v1 05/22] selftests/nolibc: add tinyconfig target Zhangjin Wu
2023-06-25 16:21 ` [PATCH v1 06/22] selftests/nolibc: allow customize extra kernel config options Zhangjin Wu
2023-06-25 16:22 ` [PATCH v1 07/22] selftests/nolibc: add common extra " Zhangjin Wu
2023-06-25 16:23 ` [PATCH v1 08/22] selftests/nolibc: add power reset control support Zhangjin Wu
2023-06-25 16:25 ` [PATCH v1 09/22] selftests/nolibc: add procfs, shmem and tmpfs Zhangjin Wu
2023-06-25 16:26 ` [PATCH v1 10/22] selftests/nolibc: add extra configs for i386 Zhangjin Wu
2023-06-25 16:28 ` [PATCH v1 11/22] selftests/nolibc: add extra configs for x86_64 Zhangjin Wu
2023-06-25 16:30 ` [PATCH v1 12/22] selftests/nolibc: add extra configs for arm64 Zhangjin Wu
2023-06-25 16:31 ` [PATCH v1 13/22] selftests/nolibc: add extra configs for arm Zhangjin Wu
2023-06-25 16:32 ` [PATCH v1 14/22] selftests/nolibc: add extra configs for mips Zhangjin Wu
2023-06-25 16:34 ` [PATCH v1 15/22] selftests/nolibc: add extra configs for riscv32 Zhangjin Wu
2023-06-25 16:35 ` [PATCH v1 16/22] selftests/nolibc: add extra configs for riscv64 Zhangjin Wu
2023-06-25 16:36 ` [PATCH v1 17/22] selftests/nolibc: add extra configs for s390x Zhangjin Wu
2023-06-25 16:38 ` [PATCH v1 18/22] selftests/nolibc: add extra configs for loongarch Zhangjin Wu
2023-06-25 16:39 ` [PATCH v1 19/22] selftests/nolibc: config default CROSS_COMPILE Zhangjin Wu
2023-06-25 16:41 ` [PATCH v1 20/22] selftests/nolibc: add run-tiny and run-default Zhangjin Wu
2023-06-25 16:43 ` [PATCH v1 21/22] selftests/nolibc: allow run tests on all targets Zhangjin Wu
2023-06-25 16:45 ` [PATCH v1 22/22] selftests/nolibc: detect bios existing to avoid hang Zhangjin Wu
2023-07-11 3:55 ` [PATCH v1 00/22] selftests/nolibc: add minimal kernel config support Zhangjin Wu
2023-07-11 7:08 ` Willy Tarreau
2023-07-11 17:18 ` Zhangjin Wu
2023-07-11 19:36 ` Willy Tarreau
2023-07-18 13:43 ` Zhangjin Wu
2023-07-18 15:19 ` Thomas Weißschuh [this message]
2023-07-18 15:59 ` Willy Tarreau
2023-07-18 17:01 ` 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=67eb70d4-c9ff-4afc-bac7-7f36cc2c81bc@t-8ch.de \
--to=thomas@t-8ch.de \
--cc=arnd@arndb.de \
--cc=falcon@tinylab.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=w@1wt.eu \
/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