Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5393273rwb; Mon, 14 Nov 2022 04:09:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf6G03EKfnOvoAw+wdsS2eloNeu14gdVSWR4i+2ALo+AveOKZEfi7zjl3Pz4Glx0FKofwCSS X-Received: by 2002:a17:902:f20c:b0:186:fe2d:f3cb with SMTP id m12-20020a170902f20c00b00186fe2df3cbmr13184148plc.132.1668427761381; Mon, 14 Nov 2022 04:09:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668427761; cv=none; d=google.com; s=arc-20160816; b=t9Vk5e4KjYaSC0ctZOFFf2gwhxC6UZJMe9FqFOloKZJYHJej60c0L6x4xdE1Sm/4JU FM2A7kSgKxXgn07fx1ICt+MKpJcF7/I/Nm57p591WwWC+C4qGYbWrJE3W7EOF+n02OOp 9NOLBHJyvxq4sNxTTgtj8QjBLhaDuJUZOofZbG6nFgYbZOYQcQBxsV2kU2HbShZtMNcU Cdj79zgjsH8/OkHwShp6nT+F2tScXysRIST0TmXVrTCK5smA05iMho2c8Wyo6coA8y+Y 9TbBNR3cFKxohAFhiPbwgypnbXYtaOgoJq/tOx9gC5Jq5x5eW1PIFUCZV8/d6JmSigaP wrlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xBNmJBLDVDGdH8+H48/QvaSCZLW72i3AZTvyWsazSeY=; b=WwHLDz1M8ymJ9H6zFs+uBT3cavFmsIw0u8SrfXP7eE2ukdR16Lb3m5TP4+XOga+Ur5 dFu5L3NlKLK06r9xz6c5DLh7iEo42TCxp0F/A5qBzQW8pNjzc9ET/179cHTdWV+YB/xO HEb44eWNjMFF3IX6UK/4J/YZNJ0yJD/qGc6BiMrWMao3uZs65nZVDhREMXLzfSjDG6Yh qfSTrTTDaAwf+va/s6xHvQEya8nNw2qA0x0n4cxKwOPzKzsIMmri7quHQqrXVw6z8LJb 6u8vKmG4e+DMy5s0tfAPEJDNlwnL9F0clklZGsdZuZVn9TOjQ9oB4VVhK4emOE8n3fDt BzBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XtUJF22t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h185-20020a6383c2000000b0045c59e9a8a9si9693812pge.322.2022.11.14.04.09.07; Mon, 14 Nov 2022 04:09:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XtUJF22t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236774AbiKNLqF (ORCPT + 88 others); Mon, 14 Nov 2022 06:46:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236672AbiKNLp2 (ORCPT ); Mon, 14 Nov 2022 06:45:28 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C1D1222BF; Mon, 14 Nov 2022 03:44:47 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BDD5C61045; Mon, 14 Nov 2022 11:44:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F566C433D6; Mon, 14 Nov 2022 11:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426286; bh=l68sB4NnR3/f4L7VL19WvqH6Dh8yt/aVZ1uJVefQMtI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XtUJF22t1vMETfxkDkDoQaLgCdasT1mX3SAV8kKRXx4VF8SppR8kmCPcKMKny+Dbh +R5/4ermD/vAqhbI6Jfl2IqEnpgRKohqOPuvB4Lr0fp79bgVEMQTN7nYEURG2V56sP uAL+oq9za5RvSqWqnegWHtzmApX55dYD+0jXvOKiYAaATRPll3qAZUolXRKuXdwIp3 tZijCM3cQmnJskEoxRP80Y42UARhTetm5DtR4MNQJ6vgwf4jlfGRFsTa01Fyg8IIcV 8YhXFJHgBjabJP8rmmWYRTzNu549Kt7BxT7QTjZNordAq51h+KaB/RMfFHwsvewfck BMu5d6NEToxzA== From: "Jiri Slaby (SUSE)" To: linux-kernel@vger.kernel.org Cc: Jiri Slaby , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org, Martin Liska Subject: [PATCH 21/46] btf, lto: pass scope as strings Date: Mon, 14 Nov 2022 12:43:19 +0100 Message-Id: <20221114114344.18650-22-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114114344.18650-1-jirislaby@kernel.org> References: <20221114114344.18650-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Slaby gcc LTO can put assembler top level statements into other assembler files. The BTF IDs assumed that they are in the same file. We need to make all BTF IDs global to work around this. This is a preparation for that, as we will pass __global_on_lto as scope. That is macro that expands either to "globl" or "local" depending whether LTO is enabled. That wouldn't work without this patch as we stringify scope at the moment. Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Andrii Nakryiko Cc: Martin KaFai Lau Cc: Song Liu Cc: Yonghong Song Cc: John Fastabend Cc: KP Singh Cc: Stanislav Fomichev Cc: Hao Luo Cc: Jiri Olsa Cc: bpf@vger.kernel.org Cc: Martin Liska Signed-off-by: Jiri Slaby --- include/linux/btf_ids.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h index 2aea877d644f..3011757a48ef 100644 --- a/include/linux/btf_ids.h +++ b/include/linux/btf_ids.h @@ -83,16 +83,16 @@ word \ #define __BTF_ID_LIST(name, scope) \ asm( \ ".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \ -"." #scope " " #name "; \n" \ +"." scope " " #name "; \n" \ #name ":; \n" \ ".popsection; \n"); #define BTF_ID_LIST(name) \ -__BTF_ID_LIST(name, local) \ +__BTF_ID_LIST(name, "local") \ extern u32 name[]; #define BTF_ID_LIST_GLOBAL(name, n) \ -__BTF_ID_LIST(name, globl) +__BTF_ID_LIST(name, "globl") /* The BTF_ID_LIST_SINGLE macro defines a BTF_ID_LIST with * a single entry. @@ -142,18 +142,18 @@ asm( \ #define __BTF_SET_START(name, scope) \ asm( \ ".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \ -"." #scope " __BTF_ID__set__" #name "; \n" \ +"." scope " __BTF_ID__set__" #name "; \n" \ "__BTF_ID__set__" #name ":; \n" \ ".zero 4 \n" \ ".popsection; \n"); #define BTF_SET_START(name) \ -__BTF_ID_LIST(name, local) \ -__BTF_SET_START(name, local) +__BTF_ID_LIST(name, "local") \ +__BTF_SET_START(name, "local") #define BTF_SET_START_GLOBAL(name) \ -__BTF_ID_LIST(name, globl) \ -__BTF_SET_START(name, globl) +__BTF_ID_LIST(name, "globl") \ +__BTF_SET_START(name, "globl") #define BTF_SET_END(name) \ asm( \ @@ -186,14 +186,14 @@ extern struct btf_id_set name; #define __BTF_SET8_START(name, scope) \ asm( \ ".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \ -"." #scope " __BTF_ID__set8__" #name "; \n" \ +"." scope " __BTF_ID__set8__" #name "; \n" \ "__BTF_ID__set8__" #name ":; \n" \ ".zero 8 \n" \ ".popsection; \n"); #define BTF_SET8_START(name) \ -__BTF_ID_LIST(name, local) \ -__BTF_SET8_START(name, local) +__BTF_ID_LIST(name, "local") \ +__BTF_SET8_START(name, "local") #define BTF_SET8_END(name) \ asm( \ -- 2.38.1