Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp884611ybb; Wed, 1 Apr 2020 11:25:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvENM7CPFp2oy5oZrcW6EfwHDmgxk08Sn5WWfGG68Nd67dSa6cxkrNDVyZwfIZOI/IrX7Qp X-Received: by 2002:a9d:1904:: with SMTP id j4mr16206242ota.37.1585765507102; Wed, 01 Apr 2020 11:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585765507; cv=none; d=google.com; s=arc-20160816; b=asqIvr76jArc+IRjCksHMf0bWgBQOz+t2HIx8chW43IeIZZ73Yh1G7bkq5tqqm6BdD Qc3JkASX03TVc9MxRhXQpBsKahpaTl6uLSHrYWQYMjJ6gTyDMsOiZk1VsL7eZyBFO4dR 28PpGVE6KhSpLq2oRaW3p/90Zh+uAl1TP6mpJGuhf8gGMJ5pG5qPcxRFNsfwFsD4Ad7V 2g4k/E70X6/SQWY2kTtnq7Zsqrhjl7arA7ZN3JLnpAOCRcd6Ms2HEefgimsgIfvTl37e 7Q2GfTMcxTf/FJyL9T5+dtBAo62+c1FCgfVat/bRoHzTuf9weisg6Q59z3GBDZzPMMA7 EnyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:autocrypt :from:references:cc:to:dkim-signature:subject; bh=1kkKEtu2FNsotuDvZHjyrVpQBdv8liMb6LlRmFQfZoE=; b=mRrCcQI1bd1lGSwTO3DiPKhdCfEpMfZbUF707T/seQK7+gsH6LQdjdCWcEbGZvgtBA 03/fTS3G/p3b/8l6B4wUBH3Fzgty6TevTejv8CMbyPKvnI7jv2vZLeCo7DuzDzK7RqAi +yqUNU/huo3ul6MJ6u11HQu9bdt6/biqWJ5WCuFyihRYgtJopF9+6ifg9lZmT6dImIXa 2RkIxJPBYoYQ0f19MABWRL3ByHCQi/axUjIPT+XPzB3Bb9Y2rNfDRdJ99df+ap+n0zdb Ja/0FKVhFw6S1ldK9EQVJ4RkxiYi9VmzCCXGx8O9ANZ8b/SPUkGKwee6p9gmIN8QLFyn 4gOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bacher09.org header.s=reg header.b=Py92+5ns; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t71si1209489oif.84.2020.04.01.11.24.54; Wed, 01 Apr 2020 11:25:07 -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=@bacher09.org header.s=reg header.b=Py92+5ns; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732978AbgDASYI (ORCPT + 99 others); Wed, 1 Apr 2020 14:24:08 -0400 Received: from pub.regulars.win ([89.163.144.234]:42612 "EHLO pub.regulars.win" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732809AbgDASYI (ORCPT ); Wed, 1 Apr 2020 14:24:08 -0400 Subject: Re: [PATCH v3 bpf] kbuild: fix dependencies for DEBUG_INFO_BTF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bacher09.org; s=reg; t=1585765442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=1kkKEtu2FNsotuDvZHjyrVpQBdv8liMb6LlRmFQfZoE=; b=Py92+5ns2kudY9v+j/rMfz6e9ULZf2d+9VY8vx4ba0jeSq508KPc37HUfX7PusmECzzEPq dnewUNNd45/60N0xsaGHFI6BxV+D1IHM7ECS4p20IwOvUFrz3GvM7zU6E71a6e1sWTkTDO jJVW96CodHSTyq+lDJs5XfHFsp/YLPM= To: Andrii Nakryiko Cc: Kees Cook , Andrii Nakryiko , bpf , open list , Jann Horn , Alexei Starovoitov , Daniel Borkmann , Kernel Hardening , Liu Yiding , KP Singh References: <202004010033.A1523890@keescook> <20200401142057.453892-1-slava@bacher09.org> From: Slava Bacherikov Autocrypt: addr=slava@bacher09.org; prefer-encrypt=mutual; keydata= mQINBFFdcIUBEAC9HZz+DbqCs+jyJjpvRyped8U4bz716OZKvZCTH4fNxrrV0fYWRn7LJ/dU r5tBnwhmlTWD4v6hk88qpD9flagkSP4UuIAo+3aopxvrkyWXXYiEAjSL2uTFolcEO40HuYPk 7nprTEzHcHgcYq2wzJfE046gimzFYcUXkrv1gC89RdkwOgLTFb80QUpKyVeoKJWKWHPfRqGF FxpFwMnW3IrgZhOnl8X859WwKUc/agPz05LjaksGpAP8ayfruxtG/3Hl7OulYPWIkTuxHAtK xW9QL7Vt24P8rVLC7sgNZYcjaOcY70PCkGLnquETuIeeCwhKr/e2n+ymH+CxlAiUY+blNpO5 S5P+rwb0qPvGDzjF+Drdp0ye/S3kMa+FNrELW06Fp74p7BgsPgNsuBVg300JWMFXiS7YeMZV cyedAzGbcO8yxrY6ZnuNF8rLiZOYde79yN82wTNw/fWZtHhz8QJELZzMNjZd3/w61ztSs9ng mduiqv9EyNKlEEuxy6N4jGTQ2YYLE/YcIx654rCfpJWJhj2kDd4k2uNRrhJI7t4duHC86K4M HiOwC7PIKlIbtrpYnTZPXXcQHp69LDzxCAA6dgGkhjZsUTVci0rTEfRQjkXYvK/f3P1SHF1M EHoeEaclqvpkuvPcbHQ/TBwBJs+ekdFCTmBzv0UwqZKfaPW5yQARAQABtDJTbGF2YSBCYWNo ZXJpa292IChNeSBOZXcgS2V5KSA8c2xhdmF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y7VZacR5/CcK0u5MIhDl9fD/Th1FZz94HIrbIIX fdzjFNfqeB5uZahQOWYM9rJN6XJ+9C9Zk6OfHPSv7TafeO8v7WXQBZdLtkNtX6MS+xg= Message-ID: <758ddac6-17ab-2e24-0199-ae0223517894@bacher09.org> Date: Wed, 1 Apr 2020 21:24:00 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 01.04.2020 20:46, Andrii Nakryiko пишет: > 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? As I mention in [0] there is no point in having `!GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST` without `DEBUG_INFO || COMPILE_TEST`, since without it COMPILE_TEST would block DEBUG_INFO_BTF and because of that GCC_PLUGIN_RANDSTRUCT would be never blocked by BTF. As far as I understood from [1] main point for all these these things with COMPILE_TEST is to be able to check if kernel could be compiled with all these options (e.g. check syntax, build scripts, etc). I can rollback `DEBUG_INFO || COMPILE_TEST`, but in that case there is no point in `GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST` since COMPILE_TEST in that case will not affect anything here, regardless from it's value. [0]: https://lore.kernel.org/bpf/202004010029.167BA4AA1F@keescook/T/#m2f493902d6aed09d30e5c4144a0164459386339d [1]: https://lore.kernel.org/bpf/202004010029.167BA4AA1F@keescook/T/#m8f25fab3476c9619249fee9ae692acb98c02cdc7 > > >> 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 >>>