[PATCH] KVM: selftests: Use $(SRCARCH) instead of $(ARCH)
Sean Christopherson
seanjc at google.com
Wed May 7 06:27:23 PDT 2025
On Thu, May 01, 2025, David Matlack wrote:
> On 2025-04-30 03:47 PM, David Matlack wrote:
> > Use $(SRCARCH) in Makefile.kvm instead of $(ARCH). The former may have
> > been set on the command line and thus make will ignore the variable
> > assignment to convert x86_64 to x86.
> >
> > Introduce $(SRCARCH) rather than just reverting commit 9af04539d474
> > ("KVM: selftests: Override ARCH for x86_64 instead of using ARCH_DIR")
> > to keep KVM selftests consistent with the top-level kernel Makefile,
> > which uses $(SRCARCH) for the exact same purpose.
> >
> > While here, drop the comment about the top-level selftests allowing
> > ARCH=x86_64. The kernel itself allows/expects ARCH=x86_64 so it's
> > reasonable to expect the KVM selftests to handle it as well.
> >
> > Fixes: 9af04539d474 ("KVM: selftests: Override ARCH for x86_64 instead of using ARCH_DIR")
> > Signed-off-by: David Matlack <dmatlack at google.com>
>
> If this approach seems reasonable I can also send another patch to share
> the definitions of $(ARCH) and $(SRCARCH) with the top-level Makefile so
> that we don't need any custom Makefile code in KVM selftests for this.
>
> e.g.
>
> From: David Matlack <dmatlack at google.com>
> Date: Thu, 1 May 2025 10:30:26 -0700
> Subject: [PATCH v2] kbuild: Share $(ARCH) and $(SRCARCH) with tools/
>
> Pull out the definitions for $(ARCH), $(SRCARCH), and $(SUBARCH) into a
> scripts/arch.include and use it to reduce duplication in Makefiles under
> tools/.
Yes, please. However, SRCARCH might be going away in the kernel's Makefile[*].
I recommend holding off on anything until that discussion is fully resolved.
[*] https://lore.kernel.org/all/cd541739-4ec5-4772-9cef-e3527fc69e26@app.fastmail.com
More information about the linux-riscv
mailing list