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

From: David Matlack

Date: Tue Apr 28 2026 - 18:54:16 EST


On Tue, Apr 28, 2026 at 3:03 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> On Tue, Apr 28, 2026, David Matlack wrote:
> > 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?
>
> Well, I was quite sure :-) But scripts/subarch.include disagrees:
>
> SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
>
> as does attempting to build KVM selftests on a 32-bit host.

Yeah that's what I was seeing as well. With that cleared up I'll send
a fix for VFIO selftests to allow ARCH=x86 if __LP64__ is defined,
which will fix Jason's issue.

> > 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.
>
> Yep. So the big question is, why doesn't anyone complain about KVM selftests not
> building on 32-bit? Because they most definitely don't build.

I guess no one's building on 32-bit hosts anymore? :)