From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.91 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796241856; b=enU7uy4vvB55IZ72QD4m/KzWcQXNsCFKyh6zlEoFVVaTpsYtR5aeJIJsmV02edLrDDw5 Gu0989oh1aakzOQe3zqYYsvCgqrp7WIKbGYejednW9dufLKIJDUZ3E1DJQwo7J4MfO9Aw tBqcOjfxYoL+7WmSBYE9Z8iBAB2pZsFWqUQ3oxc1SQ+8pyBErtIIDF9KfjQYlt0Cg8Hbf hR35lc9pyEH7lhS91g2lw1CRpxrBjjySaWomMbGE+tdMHf8zFAkKUSWtLIugr/zpCHHKy mqpshCRK5kHHbK9j74uME/l+fdMrljnl7WJbv+F+EtU5T1fDMmgDlXcwXgNOvksgS/w== 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=fWfOWu9p8iGizi3uO1ykrp2NraZR0TSnK1lJlzYQDfXONxLdin0zPyogTzf6q7nT1vS6 IuzN+Lx2eTWYPLoij9wrCMXXQ7tnquDxmXelgmP7A2pJRJQzemaNxGaKqa12sltgqd4q0 ZWDenAIbgCuLUc0M8p/o/PhYAnQJeJ4a7KbcEuhYh0ybts1wITxwnDNBPDNl5UNujoyIG O9M+nIyMPrLo7sLXBhRFT7U6E5hY06z3YcJFjQXp7Nf+Z2ZU/hUJqzxMwOq8MHpUiBPtb 71IHdX0DiV6Y7yflOaMYzpYzswR6jTzACFKDyoErN4b01oV4GpHzCDxZrGVD0W9y64w== 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=91.218.175.91 Received: from mta0.migadu.com (out-91.mta0.migadu.com [91.218.175.91]) (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 59D8F606A32D for ; Wed, 2 Dec 2026 20:04:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 59D8F606A32D 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: llvm@lists.linux.dev 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: llvm@lists.linux.dev 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: llvm@lists.linux.dev 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.