From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4DAE21A42D for ; Thu, 30 Jul 2026 16:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785430323; cv=none; b=V62yHMRmZWm0vgUbuUycGj0Hep7Vcn/L5ExdGAMSIl9zfL22Q/OPLID5K1b34892R2FdfU5AUyNbwd/WlTwNj4nTBJXrOQf1r42FuoBB+uIO+3FVDqd3wu48FTmlqCrP11A9A7p6/fBdGANotVgBoTkIevGP0/3hxs1HmxZQ3vg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785430323; c=relaxed/simple; bh=y04dFwd5QWP+IqlNvWgSGMRQNDIqk+2uXcIZuSUqkY8=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=e9uRiWA7g5RuffjGWtxHnsG1l+a78ZtIqe3UBID1N8JxetTkqA3s5FCyAwsLWBxSCc7CHaVoxG/xYoJRerTRE5GnW14LBROQNmq9t33msLysH3eegGIlcECxG/4AUrLzVoEKSEYuVrUz1eX/bzphv5T4cltGoJ+nxjwH94fT2ik= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=eeWU9iBK; arc=none smtp.client-ip=209.85.214.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="eeWU9iBK" Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2cea6a46766so41171555ad.0 for ; Thu, 30 Jul 2026 09:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785430321; x=1786035121; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date :reply-to:from:to:cc:subject:date:message-id:reply-to:content-type; bh=/ZGz5OPToGH5LOf1V99GZkk6FjXuQA3/sLBX/QC8yio=; b=eeWU9iBK2+wnsY5LJLxK3+wNKnt8nPVFG8Qx+0ivgvEePO92Qe8ZSInucUREBoRWnc YcCR+Ow23yvlGzFT4EGDtjqnmJbS+SaSwQCYHYtIJg9aaWC9wlldSUvWADjhwYcQSGHn aN1odHJBOZaGNbSXstYs3KOgBCctDmEgniWqTgc9jeZDsLR2+mbY8N65UiCiB0LgUnFB i2pRJTdcgoE3oLvQU5VShNLrBJHe5YERzpqypX+xRW/s+qilomF9BQj7pdOnY9snSBPC nWrD6b2ETK5pmslo7+zm5wvE+KaSquSjjNAAIOFhGt2hDmeyqlCqaeghSKKVf09rO2DN 5lJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785430321; x=1786035121; h=content-type:cc:to:from:subject:message-id:mime-version:date :reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=/ZGz5OPToGH5LOf1V99GZkk6FjXuQA3/sLBX/QC8yio=; b=m9teUqNUKaWtA/r3OGSbELzz5nLh+fZjSN4BIONVtCic4W8wsw+ZvaUfbPVVVih4TB q7FAvfJ1KuhlOM5MV1oxKvXg1iYYyHeAySzwE7b6NGAXLDUar8LP5l+B6u6AjcA3lpBA b+Z5r/jVaUm6BWhxYczr12ge6g+eNTcZn69Reis55wUyKbrlk5rJIqaKuKqYnorwl9ow WGt7bR79NqYF0NIJOBj5l8yyxshnXLAxuDaF3gGP4aBDrDS+oI2azR7NAHbhFv9qrmic 7s5ONWx8EQABwEdRA6p3Awr6CadBlPhkKt57ckdg+vgwX2vfpV4ygVTYuAhVxF9PiLwE b6ww== X-Forwarded-Encrypted: i=1; AHgh+RqPJgJ7VN+1U6YBsw/w4wjLSb6GaBlw4BqAHJtmJ5+r6ZaAFkPQbufAEwm5L+hukDfQ/CGRThznainRJKI=@vger.kernel.org X-Gm-Message-State: AOJu0YyvsBzsSxfilxksL2pC24hp2hhFfRXaPywuTvr7L/20QwP2IYiX Z8IxQ6GGsPq0A1oGDvxBfhGn4CNcEB1wEpKb7Ctjx2PIfcRVYPhtszb5PCHm21NMHA/D94kRqht Z7ECjvw== X-Received: from pldo18.prod.google.com ([2002:a17:903:92:b0:2ce:7984:4347]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:3848:b0:2cf:b23d:79c with SMTP id d9443c01a7336-2d035e472e6mr28070495ad.43.1785430320812; Thu, 30 Jul 2026 09:52:00 -0700 (PDT) Reply-To: Sean Christopherson Date: Thu, 30 Jul 2026 09:51:59 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.55.0.508.g3f0d502094-goog Message-ID: <20260730165159.1988017-1-seanjc@google.com> Subject: [PATCH] KVM: selftests: Only link to VFIO library on x86 From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Josh Hilke , Sean Christopherson Content-Type: text/plain; charset="UTF-8" Link to the VFIO library only on architectures where it's actually needed, i.e. only on architectures that support irq_test, which is currently x86-only. The irq_test series, which pulled in VFIO support, effectively raced with commit e65f1bf8a2db ("vfio: selftests: Extend container/iommufd setup for passing vf_token"). I.e. when the KVM test was posted, pulling in libvfio.mk didn't require linking to any new libraries other than VFIO itself. Now that libvfio.mk pulls in luuid, unconditionally linking in support for VFIO is quite onerous, especially when cross-compiling, as it requires installing what is effectively an unused library on four architectures. Eventually KVM selftests will likely support irq_test and thus need to link to VFIO on architectures other than x86, but at least then there will be some amount of gain for the pain. Fixes: a262fc49e0aa ("KVM: selftests: Build and link selftests/vfio/lib into KVM selftests") Cc: David Matlack Cc: Josh Hilke Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/Makefile.kvm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm index 88c6c8046dde..ee91051786d8 100644 --- a/tools/testing/selftests/kvm/Makefile.kvm +++ b/tools/testing/selftests/kvm/Makefile.kvm @@ -261,7 +261,10 @@ OVERRIDE_TARGETS = 1 # which causes the environment variable to override the makefile). include ../lib.mk include ../cgroup/lib/libcgroup.mk + +ifeq ($(ARCH),x86) include ../vfio/lib/libvfio.mk +endif INSTALL_HDR_PATH = $(top_srcdir)/usr LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ @@ -318,7 +321,9 @@ LIBKVM_S_OBJ := $(patsubst %.S, $(OUTPUT)/%.o, $(LIBKVM_S)) LIBKVM_STRING_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_STRING)) LIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) $(LIBKVM_STRING_OBJ) LIBKVM_OBJS += $(LIBCGROUP_O) +ifeq ($(ARCH),x86) LIBKVM_OBJS += $(LIBVFIO_O) +endif SPLIT_TEST_GEN_PROGS := $(patsubst %, $(OUTPUT)/%, $(SPLIT_TESTS)) SPLIT_TEST_GEN_OBJ := $(patsubst %, $(OUTPUT)/$(ARCH)/%.o, $(SPLIT_TESTS)) base-commit: 3c7d7f908d574277a845423ec32250a8d8df44c8 -- 2.55.0.508.g3f0d502094-goog