Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp898073ybb; Wed, 1 Apr 2020 11:40:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvHmPGCRkyVkMSbmO2VvMOwzAqX+QlsjuXU+HbhMybWmDBEiTjMpTfi2HCjc9giWPuT5PFb X-Received: by 2002:a9d:62c2:: with SMTP id z2mr19113179otk.155.1585766415202; Wed, 01 Apr 2020 11:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585766415; cv=none; d=google.com; s=arc-20160816; b=h7tZXd/RMRbtJLRDmCfkILvvwSHdj1Dq238WpHkBU6yAWvlycqJEwmfOsAnqVrjw39 kY/ldWl2OgRDXY8tJU/JGGbgza7dGuMmOPAO82hKqZafuELO/Gzpl7UyW3zi3vBkSw9o hdpQEwzFn/FB2OqsfTiDsfPIMI7RAZQFaQVjxVxgg3rkKHWvaPD++5alx/dNml8xo7+Q hvbUd9tNXxZCYDJTgb6626SQ02U/PLJEpgPDsH9S1cYAz6kvQuW8XHKWb19NtyqPnc3s fIy19YxSd12yoC3fUBRxdR5Df2I5ZG5j44+4KB5hNjBN/1KT55lPx92ojOei7Do8fHAT elXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7f+oFGBz4lKq+gYaVg47iObMCSlHnFkkTWzFoO6ob70=; b=gC7WQ0Q8FjcVdE49r7Q6qGqp7G11MkQG05LHL/Sop1pukr/2t+k8w9ikHVLiLa+v/1 M2Xjphy4RwKusqwhS4dGdwiGmSlLpDEvyszuMmTeS3TdOUJKkWBN10hMyrahMkHBB6+X wsdvyivpjUOTVji1fNZm3G/r9L+KINl5r/XmJBn2yQrYpAQQwC0wFFKP0MIgu357WpKo SwvulFYuVB0P+Y7mLCFQeaOVtQ+RfEB62ipXxDbAgbdAzZmgdhO6ibsum5OJY3nkSVOB X4ZI7UW4fFZLNqoyMPOu6ILJuaMCBVv3M8lQBAy1dNqfNUxkXSE4cU+yu+TXIAaBbvAk xetQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pVcU+dsH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k21si1237545oik.231.2020.04.01.11.40.02; Wed, 01 Apr 2020 11:40:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pVcU+dsH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732841AbgDARrM (ORCPT + 99 others); Wed, 1 Apr 2020 13:47:12 -0400 Received: from mail-il1-f195.google.com ([209.85.166.195]:33964 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732328AbgDARrM (ORCPT ); Wed, 1 Apr 2020 13:47:12 -0400 Received: by mail-il1-f195.google.com with SMTP id t11so855275ils.1; Wed, 01 Apr 2020 10:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7f+oFGBz4lKq+gYaVg47iObMCSlHnFkkTWzFoO6ob70=; b=pVcU+dsHG+xi+OdTaXPlzb2fvjo47FLw/EUeR34ecopFZpovwEmAGBOR1KUyZ6G3vt 7HV0y+QRQzVY8Lx9vEb6utqV7AIxezWlddf9ft4fmX5Kmh2JLVTeNtXRHVmARyhnmuR3 UJgf3w8ZuSSFEoVmtaj+a8Ljkz7vkiaRdg4wU8DLrI/3J0hAKW+GYrXM97SQQHdbriVF WEh+cPxR92okd0nPKw7F/JfjrEds+3rxYkbsKM4th6lgFcURuC099Nk1SchXWqRMbUR7 V0GwxUcl2onS7SY10WqEbxlm3r/0+MNuObBGG11nLve5x+q8mNj3NiN4ZrDYDoVpumib yrrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7f+oFGBz4lKq+gYaVg47iObMCSlHnFkkTWzFoO6ob70=; b=eJV0+LUXjwgk3fXQNv1Vm/ENBar48MX0RxDEIjAB0FNJ3GnTGnqqwW2845Rk3GWmcY CQIH0WtyTTojx8kWXrNXNlMP6ynAf6OHyIdgf7TeqK/Q/Y33LVMShrDWUfKe0b3HBq6L Axh8Nd5vlpWxzgt6l2CNVRx5l3AVcRAwXT83YeGYZnOfq64Zkk69sM+OzPoLdSi2/71n Bq55325B0y1USOM5THts1yJiFXqSfJZuAIFPDY3hYKt80qNgLIFJNpWN5/B/1VGF0GIz HspyUnZEfw7PG5xr5my5KBuRVdB8/J3ix+pwB0pTecMSEQiRjodqTFnvrIzfD/TNoFki +HDA== X-Gm-Message-State: ANhLgQ29zODoP0ogaYG0as+iHHvXYuGcbg1BM077Uqe6RPj4V7lx/UR3 +q0kV31gwMtg3xmaWugvZZm8AOnhvpm4/Sd18v0= X-Received: by 2002:a05:6e02:688:: with SMTP id o8mr20983373ils.156.1585763231060; Wed, 01 Apr 2020 10:47:11 -0700 (PDT) MIME-Version: 1.0 References: <202004010033.A1523890@keescook> <20200401142057.453892-1-slava@bacher09.org> In-Reply-To: From: Andrii Nakryiko Date: Wed, 1 Apr 2020 10:46:57 -0700 Message-ID: Subject: Re: [PATCH v3 bpf] kbuild: fix dependencies for DEBUG_INFO_BTF To: Slava Bacherikov Cc: Kees Cook , Andrii Nakryiko , bpf , open list , Jann Horn , Alexei Starovoitov , Daniel Borkmann , Kernel Hardening , Liu Yiding , KP Singh Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 1, 2020 at 7:38 AM Slava Bacherikov wrote: > > > > 01.04.2020 17:20, Slava Bacherikov wrotes: > > Currently turning on DEBUG_INFO_SPLIT when DEBUG_INFO_BTF is also > > enabled will produce invalid btf file, since gen_btf function in > > link-vmlinux.sh script doesn't handle *.dwo files. > > > > Enabling DEBUG_INFO_REDUCED will also produce invalid btf file, and > > using GCC_PLUGIN_RANDSTRUCT with BTF makes no sense. > > > > Signed-off-by: Slava Bacherikov > > Reported-by: Jann Horn > > Reported-by: Liu Yiding > > Acked-by: KP Singh > > Acked-by: Andrii Nakryiko > > Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux") > > --- > > lib/Kconfig.debug | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > > index f61d834e02fe..b94227be2d62 100644 > > --- a/lib/Kconfig.debug > > +++ b/lib/Kconfig.debug > > @@ -222,7 +222,9 @@ config DEBUG_INFO_DWARF4 > > > > config DEBUG_INFO_BTF > > bool "Generate BTF typeinfo" > > - depends on DEBUG_INFO > > + depends on DEBUG_INFO || COMPILE_TEST > I had to add this, since DEBUG_INFO which depends on: > > DEBUG_KERNEL && !COMPILE_TEST > > would block DEBUG_INFO_BTF when COMPILE_TEST is turned on. > Sorry if I'm being dense here. But what's the point in enabling DEBUG_INFO_BTF if there is no *valid* DWARF info available for DWARF-to-BTF conversion? > In that case allyesconfig will emit both: > > CONFIG_DEBUG_INFO_BTF=y > CONFIG_GCC_PLUGIN_RANDSTRUCT=y Which I thought is exactly what we wanted to avoid. Not sure what's the point of compiling kernel (even if it's the one that is not supposed to ever run) that apriori has broken BTF? If it was acceptable to not have DEBUG_INFO for COMPILE_TEST, why it's not acceptable to not have DEBUG_INFO_BTF in that situation as well? > > > > > + depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED > > + depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST > > help > > Generate deduplicated BTF type information from DWARF debug info. > > Turning this on expects presence of pahole tool, which will convert > >