Re: [PATCH v2] vfio: selftests: only build tests on arm64 and x86_64
From: Sean Christopherson
Date: Tue Apr 28 2026 - 15:56:06 EST
On Tue, Apr 28, 2026, David Matlack wrote:
> On 2026-04-27 06:55 PM, Sean Christopherson wrote:
> > On Mon, Apr 27, 2026, Jason Gunthorpe wrote:
> > > Even though this is a 64 bit build.
> >
> > Heh, it's much funnier when it's happening to someone else. :-)
> >
> > KVM selftests went through these exact pains. I'm pretty sure these are the
> > relevant commits (the empty targets one may or may not apply to VFIO).
> >
> > 9af04539d474dda4984ff4909d4568e6123c8cba KVM: selftests: Override ARCH for x86_64 instead of using ARCH_DIR
> > 67730e6c53d70fb31618230f81c4acee9f72eaa3 KVM: selftests: Use canonical $(ARCH) paths for KVM selftests directories
> > 43fbd8cd389faa9760c5152b1c58e893c812953b KVM: selftests: Provide empty 'all' and 'clean' targets for unsupported ARCHs
>
> KVM selftests don't prevent 32-bit x86 builds though,
Yes they do? x86 is an alias for x86_64 (or vice versa), and so the i386 target
gets binned into the empty target provided by tools/testing/selftests/kvm/Makefile.
And KVM selftests most definitely don't play nice with 32-bit.
> which is part of what we're trying to do here.
>
> For example running...
>
> $ make -C tools/testing/selftests/kvm ARCH=x86 CC="gcc -m32"
>
> ...produces a lot of -Wformat errors that were also seeing in VFIO selftests
> from the kernel test robot.
Uh, don't do that? KVM selftests can't even get past the preprocessor with -m32.
Either the kernel test robot is trolling y'all, or there's something missing in
the VFIO configuration, because I'm not seeing any magic in KVM to guard against
the above.