Re: [PATCH v2] vfio: selftests: only build tests on arm64 and x86_64

From: David Matlack

Date: Tue Apr 28 2026 - 16:09:41 EST


On Tue, Apr 28, 2026 at 12:52 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> 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.

Are you sure that x86 is an alias for x86_64? If it is then we don't
even need the __LP64__ stuff I posted.

But when I look at the top-level Makefile and imagine running make
without setting ARCH on the command line on a 32-bit x86 host, ARCH
will be set to SUBARCH, which will be x86.