diff mbox series

[1/2] kvm-xfstests: install-kconfig: Use $ARCH-config instead of $KERN_ARCH-config

Message ID 060d9fef332979fd5d53b1c28c13b2043a16ab25.1696965271.git.ritesh.list@gmail.com
State New
Headers show
Series [1/2] kvm-xfstests: install-kconfig: Use $ARCH-config instead of $KERN_ARCH-config | expand

Commit Message

Ritesh Harjani (IBM) Oct. 10, 2023, 7:16 p.m. UTC
$KERN_ARCH is used for make arguments. For configs let's use
$ARCH-config. This should not break anything since as of now we only
have arm64-config for which $ARCH and $KERN_ARCH is same.

Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
---
 kernel-build/install-kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Theodore Ts'o Oct. 12, 2023, 5:28 p.m. UTC | #1
On Wed, Oct 11, 2023 at 12:46:30AM +0530, Ritesh Harjani (IBM) wrote:
> $KERN_ARCH is used for make arguments. For configs let's use
> $ARCH-config. This should not break anything since as of now we only
> have arm64-config for which $ARCH and $KERN_ARCH is same.
> 
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

It would be much better to teach set_canoncalized_arch about the
powerpc64le architecture.  That way other scripts that use
set_canoicalized_arch can correctly depend on KERN_ARCH.  See
run-fstests/util/arch_funcs:

# There are multiple ways that CPU architectured can be named.
# KERN_ARCH is what is used when specifying ARCH=xxx when building the
# kernel.
#
# GCE_ARCH is what gets used when setting specifying the architecture
# when creating the GCE image using the --architecture flag
# ARCH (after being canonicalized by this function) is defined by
# the Debian architecture port names[1] and is used internally
# by gce-xfstests and kvm-xfstests.  So for example, when we add
# support for support for Power architectures, the ARCH name that should
# be used is ppc64 or ppc64el.

...

# This function takes as input a user-supplied architecture (which
# generally should be a Debian port name, but users might use
# a $(uname -m) instead.
#
function set_canonicalized_arch () {
    case "$1" in
	arm64|aarch64)
	    ARCH="arm64"
	    GCE_ARCH="ARM64"
	    KERN_ARCH="arm64"
	    ;;
    ...

So basically, after calling set_canoncalized_arch, ARCH should be
Debian architecture port name, GCE_ARCH (if not the empty string) is
the name of the GCE architecture name, and KERN_ARCH should be what
should be passed to the Kernel makefile as "make ARCH=$KERN_ARCH ..."

       	  	    	       		- Ted
Theodore Ts'o Oct. 23, 2023, 2:34 a.m. UTC | #2
Hey Ritesh,

I just pulled some changes from Eric Biggers into xfstests-bld which
has a start on adding riscv64 support to kvm-xfstests.  So far, he's
updated libaio to a newer upstream version (newer is relative; the
"new" version was last updated six years ago :-) for better RiscV
support, and he's added RiscV support to set_canonicalized_arch().

I'd recommend that you start with the latest upstream version of
xfstests-bld, and then add support for powerpcle64 by adding support
to find_kernel_to_use() in run=fstests/util/parse_opt_funcs, and
set_cross_compile() and get_kernel_file_info() in
run-fstests/util-arch, since those changes in the 2/2 patch series[1]
were clearly correct.  (And Eric, you should take a look at those
changes[1] for RiscV support.)

[1] https://lore.kernel.org/all/eb1f8f0fb0ff9a6358129a2a45bd0c88421ac669.1696965271.git.ritesh.list@gmail.com/

I'd also encourage you to add support for the new architectures in
selftests/appliance, since that will exercise building a kernel for
the foreign architecture using cross-compilation, and then using
qemu-system-$ARCH from kvm-xfstests.

(Yes, kvm-xfstests is starting to get very much misnamed; but kvm is
easier to type, and autocompletes much more nicely than qemu-<tab>.
The string "kvm" also is sprinkled all over the xfstests-bld scripts,
and I'm not convinced it's worth changing.  That being said, I've
added a qemu-xfstests script which gets installed into the user's bin
directory; we'll see if that is something people feel strongly about
using the new name.)

Finally, since have two separate efforts to add support for new
architectures to xfstests-bld, might I prevail on you to keep some
notes about what's needed to bootstrap a new architecture?  That might
be helpful for some future developer.

Many thanks!

					- Ted
diff mbox series

Patch

diff --git a/kernel-build/install-kconfig b/kernel-build/install-kconfig
index fc2a49a..f5b2b8e 100755
--- a/kernel-build/install-kconfig
+++ b/kernel-build/install-kconfig
@@ -140,8 +140,8 @@  fi
 
 FILES=("$CONFIG_FN")
 
-if test -f "$KCONFIG_DIR/$KERN_ARCH-config" ; then
-    FILES+=("$KCONFIG_DIR/$KERN_ARCH-config")
+if test -f "$KCONFIG_DIR/$ARCH-config" ; then
+    FILES+=("$KCONFIG_DIR/$ARCH-config")
 fi
 
 if test -n "$DO_BLKTESTS" ; then