Skip to contentSkip to conversation

vfio: selftests: Allow builds when ARCH=x86

PATCH Applied David Matlack 3 participants 3 messages Apr 28 – May 20

Subsystems (4)
lore
Share & tools
lore

David Matlack

author maintainer
#0 lore raw

PATCH 1/1 vfio: selftests: Allow builds when ARCH=x86

Allow builds when ARCH=x86 since the top-level Makefile can set ARCH=x86 even for 64-bit x86 builds.

Note that ARCH=x86 could also indicate a native build on a 32-bit x86 host. However, it doesn't seem like anyone is building selftests natively on 32-bit x86 hosts these days since KVM selftests allow ARCH=x86 and fail to compile on 32-bit x86.

If someone reports an issue on 32-bit native builds we can harden the KVM and VFIO selftests to explicitly check 64-bit (see the discussion in the Closes link below).

Fixes a55d4bbbe644 ("vfio: selftests: only build tests on arm64 and x86_64")

---
Cc: Sean Christopherson <[email protected]>

 tools/testing/selftests/vfio/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vfio/Makefile +1 -1
index 0684932d91bf..40165d087a0b 100644
@@ -1,6 +1,6 @@
 ARCH ?= $(shell uname -m)
 
-ifeq (,$(filter $(ARCH),aarch64 arm64 x86_64))
+ifeq (,$(filter $(ARCH),aarch64 arm64 x86 x86_64))
 # Do nothing on unsupported architectures
 include ../lib.mk
 else

base-commit: 2a4c0c11c0193889446cdb6f1540cc2b9aff97dd

Signature · 1 line
2.54.0.545.g6539524ca2-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · David Matlack

Allow builds when ARCH=x86 since the top-level Makefile can set ARCH=x86 even for 64-bit x86 builds.

Note that ARCH=x86 could also indicate a native build on a 32-bit x86 host. However, it doesn't seem like anyone is building selftests natively on 32-bit x86 hosts these days since KVM selftests allow ARCH=x86 and fail to compile on 32-bit x86.

If someone reports an issue on 32-bit native builds we can harden the KVM and VFIO selftests to explicitly check 64-bit (see the discussion in the Closes link below).

Fixes a55d4bbbe644 ("vfio: selftests: only build tests on arm64 and x86_64")
Quoted 5 lines

---
Cc: Sean Christopherson <[email protected]>

 tools/testing/selftests/vfio/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Jason

maintainer Applied
#2 lore raw
In reply to David Matlack
Quoted 35 lines · On Tue, 28 Apr 2026 23:27:06 +0000 David Matlack <[email protected]> wrote:

Allow builds when ARCH=x86 since the top-level Makefile can set ARCH=x86 even for 64-bit x86 builds.

Note that ARCH=x86 could also indicate a native build on a 32-bit x86 host. However, it doesn't seem like anyone is building selftests natively on 32-bit x86 hosts these days since KVM selftests allow ARCH=x86 and fail to compile on 32-bit x86.

If someone reports an issue on 32-bit native builds we can harden the KVM and VFIO selftests to explicitly check 64-bit (see the discussion in the Closes link below).

Fixes a55d4bbbe644 ("vfio: selftests: only build tests on arm64 and x86_64")

---
Cc: Sean Christopherson <[email protected]>

 tools/testing/selftests/vfio/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vfio/Makefile +1 -1
index 0684932d91bf..40165d087a0b 100644
@@ -1,6 +1,6 @@
 ARCH ?= $(shell uname -m)
 
-ifeq (,$(filter $(ARCH),aarch64 arm64 x86_64))
+ifeq (,$(filter $(ARCH),aarch64 arm64 x86 x86_64))
 # Do nothing on unsupported architectures
 include ../lib.mk
 else
Quoted 1 line

base-commit: 2a4c0c11c0193889446cdb6f1540cc2b9aff97dd

Applied to vfio next branch for v7.2. Thanks,

Alex