Re: [PATCH 0/9] tools/nolibc: fix build issues on aarch64 after unistd cleanup

From: Paul E. McKenney
Date: Fri Jan 22 2021 - 07:31:15 EST


On Thu, Jan 21, 2021 at 11:11:17AM +0000, Mark Rutland wrote:

[ . . . ]

> I've given this a spin atop v5.11-rc4, building natively on arm64 on a
> Debian 10.7 system, and with the whole series applied I'm able to run
> the rcutorture kvm.sh script without issue (the CONFIG warnings are
> unrelated to nolibc):
>
> | [mark@gravadlaks:~/src/linux]% ./tools/testing/selftests/rcutorture/bin/kvm.sh --cpus 255 --configs "TREE03" --kmake-arg "CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64" --duration 1
> | Creating a statically linked C-language initrd
> | Done creating a statically linked C-language initrd
> | Results directory: /home/mark/src/linux/tools/testing/selftests/rcutorture/res/2021.01.21-10.53.24
> | ./tools/testing/selftests/rcutorture/bin/kvm.sh --cpus 255 --configs TREE03 --kmake-arg CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 --duration 1
> | ----Start batch 1: Thu 21 Jan 10:53:24 GMT 2021
> | TREE03 16: Starting build. Thu 21 Jan 10:53:24 GMT 2021
> | TREE03 16: Waiting for build to complete. Thu 21 Jan 10:53:24 GMT 2021
> | TREE03 16: Build complete. Thu 21 Jan 10:56:25 GMT 2021
> | ---- TREE03 16: Kernel present. Thu 21 Jan 10:56:25 GMT 2021
> | ---- Starting kernels. Thu 21 Jan 10:56:25 GMT 2021
> | ---- All kernel runs complete. Thu 21 Jan 10:57:35 GMT 2021
> | ---- TREE03 16: Build/run results:
> | --- Thu 21 Jan 10:53:24 GMT 2021: Starting build
> | :CONFIG_HYPERVISOR_GUEST=y: improperly set
> | :CONFIG_KVM_GUEST=y: improperly set

These two (apparently harmless) error messages are due to these lines
in CFcommon:

CONFIG_HYPERVISOR_GUEST=y
CONFIG_KVM_GUEST=y

It looks like CONFIG_HYPERVISOR_GUEST is specific to x86, while KVM_GUEST
is specific to x86, powerpc, and mips. (It appears that arm64 doesn't
need anything here?) Given this variety, I need to make rcutorture
know very early on what arch it is building for. My current approach of
looking at the vmlinux file won't work because I need to get the config
right before building the kernel.

One approach would be to look at the initrd/init file, but doing this
reliably would mean removing the ability for users to supply their own
initrd file trees. Another approach would be to look at the current
environment, perhaps using "uname -m", which will work until someone
wants to cross-build. Yet another approach would be to parse the target
line from the output of "${CROSS_COMPILE}gcc -v".

Left to myself, I would parse the output of "${CROSS_COMPILE}gcc -v".

Thoughts?

Thanx, Paul

> | --- Thu 21 Jan 10:56:25 GMT 2021: Starting kernel
> | QEMU 3.1.0 monitor - type 'help' for more information
> | (qemu) Monitoring qemu job at pid 258620
> | Grace period for qemu job at pid 258620
> |
> |
> | --- Thu 21 Jan 10:53:24 GMT 2021 Test summary:
> | Results directory: /home/mark/src/linux/tools/testing/selftests/rcutorture/res/2021.01.21-10.53.24
> | ./tools/testing/selftests/rcutorture/bin/kvm.sh --cpus 255 --configs TREE03 --kmake-arg CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 --duration 1
> | TREE03 ------- 475 GPs (7.91667/s) [rcu: g5737 f0x0 total-gps=1713]
> | :CONFIG_HYPERVISOR_GUEST=y: improperly set
> | :CONFIG_KVM_GUEST=y: improperly set
>
> So FWIW:
>
> Tested-by: Mark Rutland <mark.rutland@xxxxxxx> [arm64]
>
> It would be great if this could be applied soon so that it's possible to
> use the rcutorture scripts without applying local hacks.
>
> Willy, thanks for sorting this out, especially so quickly!
>
> Thanks,
> Mark.