From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D4B01EF1D; Wed, 2 Oct 2024 14:33:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727879629; cv=none; b=lw001AFMC9WiCgULNFsjlcZ6lpQBGnhs2zsChcDXHaMvwlgxmn+3sCSvoTkaBAubQPbfdWoAQilu4HZ2PVHyye3xsqj4ShH5tWD+/rj4LIVNdBaX//Uqpzn6wn+LkOuP3J1IlP+KT/qVBKIc4x4Soa2qyi3oA92wpHumuAzKVHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727879629; c=relaxed/simple; bh=K1oqR8hZ4IrT3yreUL1QHREWBbI00aoklg+EZiNc6yg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hanVS69R4Fz+m8XKCBjIr3RKQQ8+aOg4FR8GB0yDsJbVfGH6gwKp1hZK1L2MaTB1MRwbsmWsZru+sTaVS/j78KSv12wlE+mX9SFgCgAqFzUsPCyu0vLom9XjSlI+Ba7Gpsl/kezPEKf5fJRwGgsW1Cyb9TLgaLUoLtOBSMGun08= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xqclOs11; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xqclOs11" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8FD7C4CECD; Wed, 2 Oct 2024 14:33:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1727879629; bh=K1oqR8hZ4IrT3yreUL1QHREWBbI00aoklg+EZiNc6yg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xqclOs11JX5b8ULjDwlzovT+XuKTooCcrbksxrmSlCOHciKuIVa1aRpGOm75ewfvb RD47GPU7BLTcnbM0TegoAy/Ha44sBfkZxp3aEpags6gy6d9/6wynVE9/tmR5qps/Eu UV+wrWKjFFcOLrILP1grw2AAMDded8RV8aJawDFE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Jose E. Marchesi" , Andrii Nakryiko , Sasha Levin Subject: [PATCH 6.6 184/538] bpf: Temporarily define BPF_NO_PRESEVE_ACCESS_INDEX for GCC Date: Wed, 2 Oct 2024 14:57:03 +0200 Message-ID: <20241002125759.521756525@linuxfoundation.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241002125751.964700919@linuxfoundation.org> References: <20241002125751.964700919@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jose E. Marchesi [ Upstream commit 675b4e24bc50f4600b6bf3527fdbaa1f73498334 ] The vmlinux.h file generated by bpftool makes use of compiler pragmas in order to install the CO-RE preserve_access_index in all the struct types derived from the BTF info: #ifndef __VMLINUX_H__ #define __VMLINUX_H__ #ifndef BPF_NO_PRESERVE_ACCESS_INDEX #pragma clang attribute push (__attribute__((preserve_access_index)), apply_t = record #endif [... type definitions generated from kernel BTF ... ] #ifndef BPF_NO_PRESERVE_ACCESS_INDEX #pragma clang attribute pop #endif The `clang attribute push/pop' pragmas are specific to clang/llvm and are not supported by GCC. At the moment the BTF dumping services in libbpf do not support dicriminating between types dumped because they are directly referred and types dumped because they are dependencies. A suitable API is being worked now. See [1] and [2]. In the interim, this patch changes the selftests/bpf Makefile so it passes -DBPF_NO_PRESERVE_ACCESS_INDEX to GCC when it builds the selftests. This workaround is temporary, and may have an impact on the results of the GCC-built tests. [1] https://lore.kernel.org/bpf/20240503111836.25275-1-jose.marchesi@oracle.com/T/#u [2] https://lore.kernel.org/bpf/20240504205510.24785-1-jose.marchesi@oracle.com/T/#u Tested in bpf-next master. No regressions. Signed-off-by: Jose E. Marchesi Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20240507095011.15867-1-jose.marchesi@oracle.com Stable-dep-of: 3ece93a4087b ("selftests/bpf: Fix wrong binary in Makefile log output") Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index e0f499794f162..24b85060df779 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -412,7 +412,7 @@ endef # Build BPF object using GCC define GCC_BPF_BUILD_RULE $(call msg,GCC-BPF,$(TRUNNER_BINARY),$2) - $(Q)$(BPF_GCC) $3 -Wno-attributes -O2 -c $1 -o $2 + $(Q)$(BPF_GCC) $3 -DBPF_NO_PRESERVE_ACCESS_INDEX -Wno-attributes -O2 -c $1 -o $2 endef SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c -- 2.43.0