From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.7 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796241856; b=vKvyXK4xRYJHrrScDEPZvjcchFU5FfKmF40jGmnd9cWPo0+sp4DstNz+KNmDv/wcuvXM JwWy4MhDoqqPzcuyUUkTog3eX36cEadfF9M9McH4U+Up+0fQVyzHk8+sIsLvmIQROTh7y tM2eMot7kQDcWNVzuUVkLgi4PDAvG1GCOgWDNicPMUbtV5o3yDe9wO5AAU8c4fQ65jWV+ /ybJMw1UeO9//wf5ZKpqsqtNWJ2bd5uRJl5Ou55CFk+lB/EvlGFRDAotzZ5uvnzkPF4Bx bvN98N8LPUL6IcRoKl/Q19DVdqlz+5PEfxcy9hVG3g+aGUz6oBp3mi+AHztYZ2YZycA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796241856; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=x4dQZv4LjkDY43v0bHF7iZT7xdf+UeF9gQyp4hk2zH4=; b=oIaCg9quvJ9FVKZAP9J6OBdeczFuMbLGo47YRCPkhCs4J5gEhpeLkoYsZ4nNeXsgaVZ5 /ZM4p2zsd65LY6BfRH8/8fPnoY50pzj/XY62nxxI+ItjksWd15vqrd+MYGoFGWFq/XEXm lhw+QR4ThvnfXrEOn9g1t3SxfywoCTWfw1a7j9DQga9zMW8k1m+XWPqK5wf8KYlfD9pp1 eKkR5iAovcqsl4KKpaw0ltYkOQ0xZsmplypMZsUG/60uGlpolrUmSffzFyggSj+ss7jRb bvtDirR4AX7S7jCNEyswrUcP1fUKHrj/L1T0xuLDcuADyCymgvATuA+Xo8+X+N7XgGQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=AREfQEVW; arc=none smtp.remote-ip=95.215.58.7 Received: from mta1.migadu.com (out-7.mta1.migadu.com [95.215.58.7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 502BB606A322 for ; Wed, 2 Dec 2026 20:04:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 502BB606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=AREfQEVW X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=nM5+A1nXjSLbz5ntLmIzkTF8X+TAQ4v+s33UcKxNLbg=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796241853; v=1; x=1796846653; b=AREfQEVWJN0fzrEDOrFAXyOFZyv9+Git1Cx2T7ojjkDYcWk97uGG9l3Neyb+uGtLnSYBCtcx wSyxidP8YHKgWgncOULd9vMgzOfqq4KK7Rk9cXeNqYgrwBTdIBfLqLrHbXfdZWJE2sWOeSqKqsl cNjplMZzcqZ51U5uN0Sb6jsc= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 4e23c070cac7c424; Wed, 02 Dec 2026 20:04:13 +0000 X-Mizu-Trace-ID: 4e23c070cac7c424 X-Migadu-Flow: FLOW_OUT Message-ID: <71419c88-4411-4962-946e-d01968e44cfe@linux.dev> Date: Wed, 2 Dec 2026 13:04:04 -0700 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] percpu: do not put btf_type_tag on per-cpu variable declarations To: Alexei Starovoitov , Andrew Morton Cc: dennis@kernel.org, tj@kernel.org, cl@gentwo.org, chris@chrisdown.name, linux-mm@kvack.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, andrii@kernel.org, daniel@iogearbox.net, acme@kernel.org, yonghong.song@linux.dev, eddyz87@gmail.com, martin.lau@linux.dev, nathan@kernel.org, ndesaulniers@google.com, morbo@google.com, justinstitt@google.com, llvm@lists.linux.dev References: <20261117220824.609017-1-vineet.gupta@linux.dev> <20261202110336.89af512bf2a336c18e11556c@linux-foundation.org> Content-Language: en-US From: Vineet Gupta In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Some comments below, mostly for Alexei; Andrew you can ignore ;-) On 12/2/26 11:48 AM, Alexei Starovoitov wrote: > On Wed, Dec 02, 2026 at 11:03 AM Andrew Morton wrote: >> On Tue, 17 Nov 2026 14:08:24 -0800 Vineet Gupta wrote: >> >>> and GCC warns: >>> >>> processor.h:232:36: warning: ignoring attributes applied to >>> 'struct cpuinfo_x86' after definition [-Wattributes] >>> >>> which -Werror turns into a build failure. > It's a prep for GCC support. > >> Sorry, I've been hiding from this patch because I don't understand the >> BTF stuff at all :( Would it be more appropriate for a BPF person to >> handle this? > The BPF side is fine. > It's really GCC behavior. clang does fine as-is. Because clang ignores the construct GCC warns about. > It's arguable whether it's a gcc bug or correct behavior. > I feel the latter. A GCC bug was opened PR/128480 [1] to silent the warning but was rejected won't fix, for the right reasons. The issue is btf_type_tag being applied to a variant of an aggregate.     struct mce { int status; };     extern __attribute__((btf_type_tag("percpu")))            __typeof__(struct mce) injectm;     $ gcc -c t.c     t.c:3:15: warning: ignoring attributes applied to 'struct mce' after definition [-Wattributes] That warning is legit: In dwarf, every variant of an aggregate shares one DIE, so a btf_type_tag on such a variant has nowhere to live and is dropped. clang just does it silently, gcc complains. Thx, -Vineet [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128480 >> otoh, Chris had a good look at the previous version so that and a few >> weeks of -next exposure is enough. > I think it better fits in Nick's build tree, since it's about GCC > and less about bpf/btf. > But if folks are fine I can take it into bpf-next.