From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 C527C3DEFFE for ; Mon, 4 May 2026 14:05:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777903517; cv=none; b=OK2Er2x/Mk8+Jwerdc3XFekmCWLD2ynVd1X+NAmA/wGGl6lV3/hARg0JlLE9DbgmJt48++aqAkrF9jvTCoTEYvTUpLxO0D4jLXYf+sw6YNwPuyA758WCt60ZfHzydgrfmeZz773xa/z+3ZM0CbyAtktuMeK1z5CBu5gDUwyFenE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777903517; c=relaxed/simple; bh=pXz4oQgkx4G9mMv6vwbidmLfcUb8rv6BeQKuDKJGgGg=; h=Mime-Version:Content-Type:Date:Message-Id:To:From:Subject:Cc: References:In-Reply-To; b=m7yEWWJnNmMHMynV9agX087G6s2W2XhtYXVdzv5acmxMYuuHlQlf3NIPzCWAoZtjEWmtRQJnSLDb2IMBDmYzf3UgeOAWyHd7vf0uiNXkqrHuX+spDTFXsjvNVst0NrOf87WjO4LTc/i8CfScuOm/dzeKBe+kagFI5HRo5s3d2vw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=AwBPhp05; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="AwBPhp05" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-bc1f3a393c0so137870966b.0 for ; Mon, 04 May 2026 07:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1777903512; x=1778508312; darn=vger.kernel.org; h=in-reply-to:references:cc:subject:from:to:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=bKrjnO573yeT71Xznme42qjXt1eFf7CZCN87a0J7YhM=; b=AwBPhp05kgs2uhzI5JC4OJ3fH+Ens+EmO0FGH40tglXGQkOpfMq0ODRz35BObXXNAU YygFgfpoH+ryfQT9Ap61KswlxyV8aVncU78s+bkqVNpTQsaxS8TILObUQ/FJSSy/qiZO ymPCnvL2wKLzWZfsMXZ4pVE2z4LYvKJrleakjuyrjudoMRGrS+Jzy1hhoGuqsYkcnWez sM2KqrCw5lihu47iPfidLRHZlv7x5joXnf//3fM0Ln9f7Djxc4L0p0ctMUdzXXUvznQK zRyEv2nTrszVUr1u1i3+C5YOSLe4aqwSk60c8fQtgNUCgNQfKvEImUKN1kPf4OKyt0UF xjrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777903512; x=1778508312; h=in-reply-to:references:cc:subject:from:to:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bKrjnO573yeT71Xznme42qjXt1eFf7CZCN87a0J7YhM=; b=SHBKvnfR5jHnQZ3cyGom9qyUcl22AgFLpqapR6sxqkPLmj3+njifRyqWskgKp3M+hF FLkqEwN2kKzOTCCdqBc1KU5nBUJJtioRw8g7vV63leZSqyQBp2gaStDCpkUShcA42/1I fhvrVp4alnB5P25f44ViLMoEGqwxKab/S386SeC1nkvet7BPXYryKRhWPK9sh4vmYS5u 9xC3hVZdPDpe6BGA/pozdtZtV5afI7JS+oPXvoUc15M1bsBHQZYEKU2JjpGEsXQG57Dl EanCggiKxM9QT08NpwH+X108wpiIKvuJMcOGyMgzMJozVOYFe1QkzKiV1DubbghRLuGX nLKQ== X-Forwarded-Encrypted: i=1; AFNElJ/mcrEPcYl99StAxvNpZuwHUqzsGTOROdpOYjxKeRZwy0azGArulL0iNqU9j9vzR6UrM98lPgzGzlV5wn0=@vger.kernel.org X-Gm-Message-State: AOJu0YzP+e6gll9l9+wXzXMcu+wkrnmS6QFt6/keAI5LKzOepPUwEKrg CK9k6GXDD49tVCTabTtdnrHfiWHxQcezXXOFBvQORQqFfjbcukroXL7IUixpdNBUFLQ= X-Gm-Gg: AeBDievj4X8/x2hJpDTSmTeeAlzEVwlLrJyle3wPz00hixbRoaMOqi44pC2PO2n/C02 0xzTx5tN5ookIXXui63wgcdN7laH/9sBPLvLnzPR48Q1Itbfk+gnP86IJ18MqtQZbbGwMYopCZL AsRA7FfrXRc+d52qL0z0VKFIi833Y+TDTjdGCFY1zjrZYoK4ZAFaZ8pKPxkvUQlhYOlDldNuUT5 trTDfVbdaKofNNafUw1p8EO5NIF0XEplcaufSvdiHVWKeqGG46em74jIN5fchB7bdjhxdy4b/wc J+DGovy3DhQS6hOMOYodIepqUJk5Wyrs6SSDgXqlb5lCIMiMzNOWgj539Od0P72ez34ZjRrwTuJ koa7mWm429o0sYzlVn4FV8z+dvUOq0fNgg7rvYezd13A8yoDHomm4r4ZdxG1SeOaRU2bstRPt93 BNqZt2oB7AEkLGeWQeL+Q3cg== X-Received: by 2002:a17:906:c103:b0:bc1:2cdb:5d02 with SMTP id a640c23a62f3a-bc12cdb93e1mr311959166b.20.1777903512085; Mon, 04 May 2026 07:05:12 -0700 (PDT) Received: from localhost ([2804:7f0:b765:1294:2ecf:67ff:fe81:9da0]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-95ce0b63bb8sm5402191241.12.2026.05.04.07.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2026 07:05:11 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 04 May 2026 11:05:08 -0300 Message-Id: To: , , , , , , , , , , , , , , , From: =?utf-8?b?UmljYXJkbyBCLiBNYXJsacOocmU=?= Subject: Re: [PATCH bpf-next v11 02/11] selftests/bpf: Fix test_kmods KDIR to honor O= and distro kernels Cc: , , , , , , , X-Mailer: aerc 0.21.0-120-g22b95d38161f References: <20260430-selftests-bpf_misconfig-v11-2-e11f7a8c4fdc@suse.com> In-Reply-To: Addressed in https://lore.kernel.org/bpf/DI6JRYWASEYN.3I8Q81ZPUE1VE@suse.co= m/ On Thu Apr 30, 2026 at 1:42 PM -03, bot+bpf-ci wrote: >> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selfte= sts/bpf/Makefile >> index 6094fe99b5f6..cc6ee7a2df93 100644 >> --- a/tools/testing/selftests/bpf/Makefile >> +++ b/tools/testing/selftests/bpf/Makefile > > [ ... ] > >> diff --git a/tools/testing/selftests/bpf/test_kmods/Makefile b/tools/tes= ting/selftests/bpf/test_kmods/Makefile >> index 63c4d3f6a12f..031c7454ce65 100644 >> --- a/tools/testing/selftests/bpf/test_kmods/Makefile >> +++ b/tools/testing/selftests/bpf/test_kmods/Makefile >> @@ -1,5 +1,16 @@ >> TEST_KMOD_DIR :=3D $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIS= T))))) >> -KDIR ?=3D $(abspath $(TEST_KMOD_DIR)/../../../../..) >> +SRCTREE_KDIR :=3D $(abspath $(TEST_KMOD_DIR)/../../../../..) >> +# Honor O=3D/KBUILD_OUTPUT only if they point at a prepared kernel buil= d >> +# directory (one containing Module.symvers); otherwise treat the value = as a >> +# selftests-only output directory and fall back to in-tree or distro he= aders. >> +# The parent bpf/Makefile resolves O=3D/KBUILD_OUTPUT to absolute paths= before >> +# invoking this sub-make so relative paths still anchor to the user's >> +# invocation directory. >> +KMOD_O :=3D $(or $(O),$(KBUILD_OUTPUT)) >> +KMOD_O_VALID :=3D $(if $(KMOD_O),$(if $(wildcard $(KMOD_O)/Module.symve= rs),$(KMOD_O))) >> +KDIR ?=3D $(if $(KMOD_O_VALID),$(SRCTREE_KDIR), \ >> + $(if $(wildcard $(SRCTREE_KDIR)/Module.symvers),$(SRCTREE_KDIR), \ >> + /lib/modules/$(shell uname -r)/build)) > > Will the automatic fallback to /lib/modules/$(uname -r)/build cause > confusing build failures? > > Since bpf_testmod relies heavily on internal BPF structures, experimental > macros, and kfuncs that change frequently between kernel releases, compil= ing > it against host distro headers on a system where the running kernel does = not > match the upstream source tree will likely fail. > > If the host headers are present, the permissive skip check further down i= n > the file will pass since the directory exists. However, because the > compilation failure is not ignored by the parent bpf/Makefile, this would > abort the entire BPF selftests build with confusing C compilation errors > instead of silently skipping the unconfigured kernel tree. > > Should in-tree test modules avoid falling back to host distro headers to > prevent these version mismatches? > > This concern was raised in v9 and v10 by bot+bpf-ci@kernel.org and > sashiko-bot@kernel.org: > > "Will falling back to the host kernel headers cause compilation errors > when building in-tree test modules like bpf_testmod? Since bpf_testmod > relies heavily on internal BPF structures, experimental macros, and > kfuncs that change frequently between kernel releases, compiling it > against /lib/modules/$(uname -r)/build on a system where the running > kernel does not exactly match the upstream source tree will likely fail= . > If the host headers are present, the permissive skip check further down > in the file will pass since the directory exists. Because the compilati= on > failure is not ignored by the parent bpf/Makefile, won't this abort the > entire BPF selftests build with confusing C compilation errors instead = of > silently skipping the unconfigured kernel tree? Should in-tree test > modules avoid falling back to host distro headers to prevent these > version mismatches?" > > Reference: https://lore.kernel.org/bpf/d1297f1c857e5430af42dcb3e4d05c7dda= ff08470a43893cac0fbcb83ec51666@mail.kernel.org/ > > [ ... ] > > > --- > AI reviewed your patch. Please fix the bug or email reply why it's not a = bug. > See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/READM= E.md > > CI run summary: https://github.com/kernel-patches/bpf/actions/runs/251764= 31268