From patchwork Fri Nov 10 11:03:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Maguire X-Patchwork-Id: 13452341 X-Patchwork-Delegate: bpf@iogearbox.net Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 8DC871427B for ; Fri, 10 Nov 2023 11:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="wMiFinAu" Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D5E62B791 for ; Fri, 10 Nov 2023 03:04:45 -0800 (PST) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A9MYEWs006296; Fri, 10 Nov 2023 11:04:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2023-03-30; bh=SsCstpZ0Hx6QnOmaazg1ZCW6Talp96yj/c4oMQoAYxQ=; b=wMiFinAuOGo0HVDSmljequuMFnMqMOAytLYK2JIULm8IXrcLC0Nr11PZ5DyO17I71nit A7z5WnjSA1KDBGlSmpD5vwu3ZwFonvQijWk6E1mIpJOJlJfq5jrbaHIXOOQYjqOVMBcG xHGVgahWVTP4u1eQG7nrpOjRB8vPQXBnIC3wa4huh/dVoV1nslpDkikn6OydeIcjs0Ak mj4yaTezszxtHzHioc09LWYeYSq8/rcF1ynjzcSaexPN59J1Q8KRIX7+WR1gMsk54T4O O6YxPO2iCQoOiWsrsfdSLBJ1hj3rbkqDW9ijpFff/nLYpk0/fnPTm5yqDm7EpWK7wZ8g PA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w22nyns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Nov 2023 11:04:29 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3AA9mLpH018361; Fri, 10 Nov 2023 11:04:28 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u8c01qh3n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Nov 2023 11:04:28 +0000 Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AAB3Wg8018454; Fri, 10 Nov 2023 11:04:28 GMT Received: from bpf.uk.oracle.com (dhcp-10-175-213-193.vpn.oracle.com [10.175.213.193]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3u8c01qfd7-15; Fri, 10 Nov 2023 11:04:27 +0000 From: Alan Maguire To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org Cc: jolsa@kernel.org, quentin@isovalent.com, eddyz87@gmail.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, bpf@vger.kernel.org, Alan Maguire Subject: [PATCH v3 bpf-next 14/17] bpf: allow opt-out from using split BTF for modules Date: Fri, 10 Nov 2023 11:03:01 +0000 Message-Id: <20231110110304.63910-15-alan.maguire@oracle.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231110110304.63910-1-alan.maguire@oracle.com> References: <20231110110304.63910-1-alan.maguire@oracle.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_07,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 spamscore=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311100090 X-Proofpoint-ORIG-GUID: hT0xjczoEiHMI18-pIRwTVE_9tHoS7c6 X-Proofpoint-GUID: hT0xjczoEiHMI18-pIRwTVE_9tHoS7c6 X-Patchwork-Delegate: bpf@iogearbox.net By having a BTF_BASE variable defaulting to using vmlinux as base BTF, we allow module builders to build standalone BTF such that it is generated independently and not de-duplicated with core vmlinux BTF. This allows such modules to be more resilient to changes in vmlinux BTF if they occur, as would happen if a change resulted in a different vmlinux BTF id mapping. Opt-out of split BTF is done via make BTF_BASE= M=path/2/module Signed-off-by: Alan Maguire --- scripts/Makefile.modfinal | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal index b3a6aa8fbe8c..b69fd46b040a 100644 --- a/scripts/Makefile.modfinal +++ b/scripts/Makefile.modfinal @@ -30,6 +30,8 @@ quiet_cmd_cc_o_c = CC [M] $@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink) +BTF_BASE := --btf_base vmlinux + quiet_cmd_ld_ko_o = LD [M] $@ cmd_ld_ko_o += \ $(LD) -r $(KBUILD_LDFLAGS) \ @@ -42,8 +44,8 @@ quiet_cmd_btf_ko = BTF [M] $@ if [ ! -f vmlinux ]; then \ printf "Skipping BTF generation for %s due to unavailability of vmlinux\n" $@ 1>&2; \ else \ - LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J $(PAHOLE_FLAGS) --btf_base vmlinux $@; \ - $(RESOLVE_BTFIDS) -b vmlinux $@; \ + LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J $(PAHOLE_FLAGS) $(BTF_BASE) $@; \ + $(RESOLVE_BTFIDS) $(BTF_BASE) $@; \ fi; # Same as newer-prereqs, but allows to exclude specified extra dependencies