From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pz2-f12.google.com (mail-pz2-f12.google.com [74.125.228.12]) (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 AECF426ED40 for ; Fri, 2 Oct 2026 11:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790941726; cv=none; b=eO1FKGy3QEvLWIDgaktePHRmdPS1bMtrN6S4YI7EZfjqfI9NQSMc/489mwYzBZ0fIkVsW/SKOtBUJ2UO0M/6Hfm3K+nQ72o9l9yyW7utiNyoYDlt7xNmgN5Mh58SuNyNVglkNnAm5ZLpI12ULNvwYTNI1hdy0bwKJzNeXd8kwP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790941726; c=relaxed/simple; bh=gAY+ry7XQppx5kZcg+BfzcVwDqxF38v68qrWhv2EpEU=; h=Content-Type:Date:Message-Id:Cc:Subject:From:To:In-Reply-To: References:MIME-Version; b=tQA3fEyr+hko+IG3QMNoUdeni3G6oeKl6CU15R0TsBdqO7jV4lM2foPyZPRBTgHsIp+XP9Emt6JB60PPgX5iuj2auXGFl3u0HRQzmYmjCqgPmgYOJjHDaq73IQ91ZucjlPaN+oTbMhSSJFvymKsxYQRwIG8REOfbbkZk8t6DWsI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MeyZIhmU; arc=none smtp.client-ip=74.125.228.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MeyZIhmU" Received: by mail-pz2-f12.google.com with SMTP id 41be03b00d2f7-cc4cacd3409so4541620a12.2 for ; Fri, 02 Oct 2026 04:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790941724; x=1791546524; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:from:to:cc:subject :date:message-id:reply-to:content-type; bh=jDgCZ93FbbC+h+9QAZpC0c3CaTDV4NHqwfDJ+8l3w7I=; b=MeyZIhmU8tcw6SYtV+1UZ7tSerG+sxuHQGu95Sf+jXbAr1jEANi1Xr2UvlE2O8dFCC Kz4XzfQuSc3KIwWpsVO1Wp9OmjeYf+k2zVFqFV8MrniXv/Iv8UCfKoVfgmpUA3BuiRNo E09LSomNq7IqB2WCn+1NYu8sFOkvU0Cu6beoCzkTV3AHfDKdEtalVaFOtKnZkVt+FvBt TdkVI6itaXRa85ogpErUJnSIghBnEdXTd3G62zvw8C3M2iygDKn2y0J1J0hsAnGP9hT8 3SVS+eFmQ2NIyY/3qTsvtmqitlyjb/IelUbO2q1DHTFsAfgRgFm+mHLNtvYT7EJfslZ4 pFVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790941724; x=1791546524; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=jDgCZ93FbbC+h+9QAZpC0c3CaTDV4NHqwfDJ+8l3w7I=; b=PeMxaNV8Pl1tKfdkWKmHqxQVMHUjtz75UANTp5QI6pQdwe01Tvaq3mHoprc8622V5o K3bQ7EZmxmjj0zc8+/k0QhRCJ2Qg0hFCKDglMa+rhUbvYF77UFb8BVIPhoBUrD9DPRI5 DjfOXwWNTCpuHN2jneeuxHtAfVoqWmVe4dMLz9B/9gjInVavG17YOj8gaqyoR8C3J7lw TCKPilNClqy8C0+SfLbrkcxJv0rkfMSiZoJfsPc9HZUpZhY2CLaEg7QKJv0plJUV5T6m cPG+AfaN1a1zwiQPtINU0jCtiIH1xKBrijlwD7/1Vob0YArt5o7qRT3npKx9QpWbewRh iG4Q== X-Forwarded-Encrypted: i=1; AKwUvBzoMz2v5RuqGMQZ7RkY6eNkU2Qw/znXEhH6r+waMZb8hUuNlxuvIS5jdwC/paa109ShIPxFtD3Fkp0=@vger.kernel.org X-Gm-Message-State: AFuF++lJyXvyJHKtUHEa3s7hruX7OPw/gEzazhwogL2KtixNEyZgBGQq A3BgMmC3iH7FceuDfqKA6s6MecayBD+jBgOhts3C7TCLy0UTrDUCnVWf X-Gm-Gg: AYBFou2G+DnNmxjpxPzW28OmRDPPZcZaiLoh/MtEQevsY4L2TQJLeUK+ty4uLAnpvoy YpkwLqfYQt5tmp/09Ui7dOcErBD24ibT8O+ckRBfmKmyoxp7oxh4hVMBndwWjknsrAFdOHLq7eo BlLfbb0cuTGk+REg0ISS9AmDUBskYT7RjdsLEH8T6dRaMY1IRqHARlZT2etJ9r7y66nbV8gf1zG c4jy07GbwhrK/zEBhdc4Z5l8SvI6xo+1zHi88pbVDpR39DdTvh2hXWELMAoJ97YMs4UW3wq/FCm VH0jqbvbnBauBITW4iwqKOZp2JFKWJnPzO9FJYtRn1mAgzpCEBQ54lF8toRLSOLDuz5FbvMDa6e nbW+cHueoReRi5XMCC0IlmkbNyuLKsypkq9bdZzWLJzSRfjQzvLRTTxDa/URwTDyWh0Gtj7srw5 2QMefvu8cI5YWLYXp08MqmvJLFZjcFvVwkIz/dW2/0hgSdJFS6oSPuF6NqcHchWSDcurvwPd8Ph iult1mANnFdzPBwTDWFpaMGGmQ5HA35LppOXZnkNy4EAmYlnWr/lTaH1wNpLCHtonLlwaKSJmtb r0s= X-Received: by 2002:a05:6300:210a:b0:3e0:b937:8844 with SMTP id adf61e73a8af0-3e0bd199342mr2548048637.44.1790941723843; Fri, 02 Oct 2026 04:48:43 -0700 (PDT) Received: from localhost ([153.61.198.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-88b0d247dbcsm743396b3a.55.2026.10.02.04.48.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Oct 2026 04:48:43 -0700 (PDT) Content-Type: text/plain; charset=UTF-8 Date: Fri, 02 Oct 2026 11:48:42 +0000 Message-Id: Cc: "Alan Maguire" , "Martin KaFai Lau" , "Yonghong Song" , "Jiri Olsa" , "Ihor Solodrai" , "Quentin Monnet" , "Nathan Chancellor" , "Nicolas Schier" , , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , "Christian Heusel" , "Luis Chamberlain" , "Petr Pavlu" , "Sami Tolvanen" , , "Steven Rostedt" , "Masami Hiramatsu" , "Mathieu Desnoyers" , , "Arnaldo Carvalho de Melo" , "Namhyung Kim" , "Ian Rogers" , , "Jiri Kosina" , "Benjamin Tissoires" , , "Tejun Heo" , "David Vernet" , "Andrea Righi" , "Changwoo Min" , , "Shuah Khan" , , "Miguel Ojeda" , , "Arnd Bergmann" , , , "Hazem Mohamed Abuelfotoh" , "Bjoern Doebel" , "Martin Pohlack" , Subject: Re: [PATCH bpf-next v4 04/12] bpf: take the vmlinux BTF from the btf_vmlinux module From: "Alexei Starovoitov" To: "Jay Wang" , , "Daniel Borkmann" , "Andrii Nakryiko" , "Eduard Zingerman" , "Kumar Kartikeya Dwivedi" In-Reply-To: <20261001225214.12351-5-wanjay@amazon.com> References: <20261001225214.12351-1-wanjay@amazon.com> <20261001225214.12351-5-wanjay@amazon.com> X-Mailer: mkdraft (claude review draft; edit before sending) Content-Transfer-Encoding: 8bit Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, Oct 01, 2026 at 10:52 PM Jay Wang wrote: > + err = __sys_bpf(cmd, USER_BPFPTR(uattr), size, USER_BPFPTR(uattr_common), size_common); > + if (IS_MODULE(CONFIG_DEBUG_INFO_BTF) && err < 0 && bpf_btf_vmlinux_retry(cmd, misses)) > + err = __sys_bpf(cmd, USER_BPFPTR(uattr), size, USER_BPFPTR(uattr_common), > + size_common); Running the command twice when it failed and a global counter moved is not going to fly. Missing BTF is not always an error. With =m and BTF not loaded yet take int prog(struct xdp_md *ctx) with func_info. That is everything libbpf loads. do_check_common() calls btf_prepare_func_args(env, 0). find_canonical_prog_ctx_type() returns NULL, btf_is_prog_ctx_type() returns false, the arg becomes ARG_PTR_TO_MEM and func_info_aux[0].unreliable is set. The prog loads. err == 0. No retry. >From then on freplace of that prog fails with "Cannot replace static functions" and fentry/fexit see its args as scalars, even after BTF is loaded. With =y both work. That is the only reason why "a socket filter does not load it". In v3 such prog loaded BTF. systemd built with BPF_FRAMEWORK loads int sd_bind4(struct bpf_sock_addr *ctx) from manager_setup_cgroup() at every boot. The result of the verification cannot depend on who touched BTF first. bpf-ci is right too. The first run writes into uattr. It's starting to feel that this is dead end. So much complexity to save few Mbyte. pw-bot: cr