Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3708703yba; Mon, 29 Apr 2019 07:16:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwulxm8SUGVulZEsAbZWW/aNMpWJhZVSHuSCFveVSAYsz62MiLh/UZf7N9+1K6oe4H2WirL X-Received: by 2002:a63:6ac1:: with SMTP id f184mr60307175pgc.25.1556547404635; Mon, 29 Apr 2019 07:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556547404; cv=none; d=google.com; s=arc-20160816; b=fzG9boI7YrjAWZKqGwjDCvFzL4BQ508SY3DIPCIadLO8vYWpSIFW/dxhTeKH6co0Lt c9imfIiKrhwMOQZYliVL4xoDUeAdBXzVU1ZQeAzS/xsSIPREJjOQNh0ZJDFxNjZlRY2X t8+gPcLYzG3JrvtifHcvoU98sc0EkVyp2ChCA2+dsCyIlh3Ztix+T6wWMVepBa7xWh4Q 8Gese62RolledL3seOwnh+dRzWsR5m3uBZT6GxBacemEbZUU3EyJT9hucFeUfWOwa56H zS4UIQzs57aUhlxEqr1LDiUodu+O4rXFKHnBC7jSoHjZ49+8UhuMhJuj8SbdGrt+SJRe GJww== 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:dkim-filter; bh=l3dZW2UIUJmt2aKGNrZq7mHyn/lDaxk1teTwUSyxmG8=; b=gM42DK2evWuFwyENQNq+xRf+BPIg7GgoNUhHW5dzacaCCQ9fjw907k75A158o3+wGp 11aZSEkAaRdV55QIfp2kJa4gI/jV+5VEOyt1FyrdOiJQFY6dBhaKOnoJ1bzKJVuAKGfk Chg/MdOVm72VAXsisQNnWa/cSIjLcLDFLA8fDL7Tkg2gEF1JLmk3Sq9MBEGY+J5cWSd7 NbW6dx2KOFZLMFc0aS1+uyWBu1WVAOxM4uBh9HeqpOGOcKMi7Q/BAN6nF+DclJrqZ2jr B8GOUrZ4HfhYIBjtSQxcIOyBgdJHCLiTE6V6JLiWcHyDbRlK1b35wN9aDUN/Qwh4t8q1 jMog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=baXvggH1; 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 m18si29918739pgv.209.2019.04.29.07.16.28; Mon, 29 Apr 2019 07:16:44 -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=@nifty.com header.s=dec2015msa header.b=baXvggH1; 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 S1728359AbfD2OP0 (ORCPT + 99 others); Mon, 29 Apr 2019 10:15:26 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:62325 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbfD2OP0 (ORCPT ); Mon, 29 Apr 2019 10:15:26 -0400 Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (authenticated) by conssluserg-02.nifty.com with ESMTP id x3TEF7Xo009931; Mon, 29 Apr 2019 23:15:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com x3TEF7Xo009931 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1556547308; bh=l3dZW2UIUJmt2aKGNrZq7mHyn/lDaxk1teTwUSyxmG8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=baXvggH1PMJGSExGISfzbwfrxQ8BlpNgPgGOOIn0S6jW9HNAfVsTmUhlQwO43QKJg HtyOoGD02YrB6XQ5Env+2sSyVERHIHWZDsMCevgGgkEoJcbuPRtPz08X2JpiMnBAB8 vTsejq5EFPG41XbhzXUBIu6/8CgrRclBIb/LVteCzLD3knrxULNAT1p++suBhy1KmX vr+UaGqco+jNKt+VSpVc7tkEtAtuqvS7zMQEqE1JUp7kM9gZgtX4e5hstZfcuZHgPz lix7VLIX+thkzBHQNbVeKMG/gHXuvkBmhSeqvykBIbuhyrJgCnFxDivO+A9dcFCgPO 3kpcaUjdjp5vg== X-Nifty-SrcIP: [209.85.222.45] Received: by mail-ua1-f45.google.com with SMTP id t15so3534441uao.5; Mon, 29 Apr 2019 07:15:07 -0700 (PDT) X-Gm-Message-State: APjAAAXBEWQSu8KIR9hfhEGCwI/G819hSRBcGP25/8qPxVzVC1hF1fSx BCSFgNR9XjqZ4r3r/5KzL81SWtW1ZkAcfGaGa20= X-Received: by 2002:a9f:2d99:: with SMTP id v25mr12349688uaj.25.1556547306611; Mon, 29 Apr 2019 07:15:06 -0700 (PDT) MIME-Version: 1.0 References: <20190426190430.172543-1-joel@joelfernandes.org> <20190427133844.GA29366@kroah.com> <20190429132602.GA165075@google.com> <20190429135455.GA2412@kroah.com> In-Reply-To: <20190429135455.GA2412@kroah.com> From: Masahiro Yamada Date: Mon, 29 Apr 2019 23:14:30 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 resend 1/2] Provide in-kernel headers to make extending kernel easier To: Greg KH Cc: Joel Fernandes , Linux Kernel Mailing List , Andrew Morton , Alexei Starovoitov , atish patra , Daniel Colascione , Dan Williams , Dietmar Eggemann , Guenter Roeck , Jonathan Corbet , Karim Yaghmour , Kees Cook , "Cc: Android Kernel" , "open list:DOCUMENTATION" , "open list:KERNEL SELFTEST FRAMEWORK" , linux-trace-devel@vger.kernel.org, Manoj Rao , Masami Hiramatsu , Qais Yousef , Randy Dunlap , Steven Rostedt , Shuah Khan , Yonghong Song , Olof Johansson 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 Mon, Apr 29, 2019 at 10:57 PM Greg KH wrote: > > On Mon, Apr 29, 2019 at 09:26:02AM -0400, Joel Fernandes wrote: > > On Sat, Apr 27, 2019 at 03:38:44PM +0200, Greg KH wrote: > > > On Fri, Apr 26, 2019 at 03:04:29PM -0400, Joel Fernandes (Google) wrote: > > > > Introduce in-kernel headers which are made available as an archive > > > > through proc (/proc/kheaders.tar.xz file). This archive makes it > > > > possible to run eBPF and other tracing programs that need to extend the > > > > kernel for tracing purposes without any dependency on the file system > > > > having headers. > > > > > > > > A github PR is sent for the corresponding BCC patch at: > > > > https://github.com/iovisor/bcc/pull/2312 > > > > > > > > On Android and embedded systems, it is common to switch kernels but not > > > > have kernel headers available on the file system. Further once a > > > > different kernel is booted, any headers stored on the file system will > > > > no longer be useful. This is an issue even well known to distros. > > > > By storing the headers as a compressed archive within the kernel, we can > > > > avoid these issues that have been a hindrance for a long time. > > > > > > > > The best way to use this feature is by building it in. Several users > > > > have a need for this, when they switch debug kernels, they do not want to > > > > update the filesystem or worry about it where to store the headers on > > > > it. However, the feature is also buildable as a module in case the user > > > > desires it not being part of the kernel image. This makes it possible to > > > > load and unload the headers from memory on demand. A tracing program can > > > > load the module, do its operations, and then unload the module to save > > > > kernel memory. The total memory needed is 3.3MB. > > > > > > > > By having the archive available at a fixed location independent of > > > > filesystem dependencies and conventions, all debugging tools can > > > > directly refer to the fixed location for the archive, without concerning > > > > with where the headers on a typical filesystem which significantly > > > > simplifies tooling that needs kernel headers. > > > > > > > > The code to read the headers is based on /proc/config.gz code and uses > > > > the same technique to embed the headers. > > > > > > > > Other approaches were discussed such as having an in-memory mountable > > > > filesystem, but that has drawbacks such as requiring an in-kernel xz > > > > decompressor which we don't have today, and requiring usage of 42 MB of > > > > kernel memory to host the decompressed headers at anytime. Also this > > > > approach is simpler than such approaches. > > > > > > > > Reviewed-by: Masahiro Yamada > > > > Signed-off-by: Joel Fernandes (Google) > > > > > > Reviewed-by: Greg Kroah-Hartman > > > > Thanks for the Reviewed-by tag. I believe there are still 2 logistical things > > to merge this. > > 1. Location of the header archive: > > Olof and Steve did not like it to be in /proc and instead /sys seemed a better > > choice they are Ok with. Me and Greg were Ok with it being in /sys/kernel/. > > Alexei, Greg and me are Ok with either proc or Sys. > > As you say, either is fine with me. > > > 2. Who is going to pull this patch: This seems a matter of where the header > > archive resides. If it is in /sys/kernel/ then I am assuming Greg will pull > > it. Masahiro has given his Reviewed-by tag, is he the one to pull it? > > I can take it, but it probably should just go through the kbuild tree, > as that makes more sense to me. I do not want to take responsibility for this. -- Best Regards Masahiro Yamada