Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3660443yba; Mon, 29 Apr 2019 06:29:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwglaCObvCzFTokTQxJK+VMatqs6y18j+TDtCEm8r1xs5Kf7WPnxrxxnfjhdi/+B7cCW1G0 X-Received: by 2002:a65:4341:: with SMTP id k1mr57570757pgq.88.1556544549464; Mon, 29 Apr 2019 06:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556544549; cv=none; d=google.com; s=arc-20160816; b=BrZ9mo93KbNRvMgaABGatD51DhRbdHAtgWyYWbsBY1xtXxqq3rqWQnx23gQmgoZFNr Yq4VvnrMlfPhjA9DPfLPIMmtWXk//u6++hLNJoQA3YuLiKQJSQFKGe7M1wEbZIYRBA4l gD9vTID681tZG2ITe59TtjFBuhDmnJ/B0C4lpv0LTlR+nAj9g7bBunSaDqhzBy9JtJAl 6zMcyCFRYEGAWjczKl4T9QpM8qZKTfoZnrxk6ODAYqthDcRQf+3WIvB1mAbL8tRQguqy azpzVzJoO5d+H72BgPeSOeA5XjmWWrUMs775a3OHw3svL+KNOjLxj/8JlGz7Oab8NqoI l5FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WU22o7ORRjAB6LcBsaDZgsJPZQTLBbgaDyibEx6Izj4=; b=0GrrNA+mL1jCRkLx879LtnVtVoueLKA744vpFvvQKVdbR10euBDLQ8jTCrQJBjiz0q r/7fJR1BxD9Ma5M3Ut8acAfWGDXWpfYjBj+1sci+X37oOwdNDFqhBdy66dplP3sD9vPI 1HSShd6A5RkBHko2giMpLaRJ0dHPV780MgqN+ydalQuhy/WC91IuHSbWcrU+7HE0B4JR DQOjamUobhgXMvFG3e11E7llGB8zpShAhDT2lvMaAfRRPYihKH01bXXXnRcoiJjRiufx tgYxuUpT0vcCdgd/Lwksn0xtUKc9hDMhImq/1UdqbcJFWOnfMGLGwLIGXGmrtaAaoGQU /teA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=P6UnyeM1; 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 l11si32492312pgg.554.2019.04.29.06.28.53; Mon, 29 Apr 2019 06:29:09 -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=@joelfernandes.org header.s=google header.b=P6UnyeM1; 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 S1728264AbfD2N0G (ORCPT + 99 others); Mon, 29 Apr 2019 09:26:06 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:44989 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728253AbfD2N0F (ORCPT ); Mon, 29 Apr 2019 09:26:05 -0400 Received: by mail-pf1-f195.google.com with SMTP id y13so5303960pfm.11 for ; Mon, 29 Apr 2019 06:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WU22o7ORRjAB6LcBsaDZgsJPZQTLBbgaDyibEx6Izj4=; b=P6UnyeM18IjOYI0uqwvG04cgNFEmIzGkn8Zx1CTaM3EU2VBNd8Sq+F66l1Iqel1Yni vydGFNKZ0TZ4ytr/FKur1zgYvH8yy2ZLGnucmwPM8n59AVERNvvZowq1ZZxi7OmWOgbB WcBzcncpcf1QJ/NpRyujm7q4CcM04r49DY7mU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WU22o7ORRjAB6LcBsaDZgsJPZQTLBbgaDyibEx6Izj4=; b=eiQR4s35rE9SCtlnF59iOr0pJ94+SiegjXG1l+tWmc0cNDTqXiVwBhWEquefjKub5O oC6Dgce7SSl7WAJLrXdkiXbABsOxelQcrLlVaVPW9eX6EhG5OWYVJvJdh3NLpNB0c7SU yR9mx4It1Kb2eOy0bfrD3GuzodH+OqtwH1E242nHokQHoPYOuGF1ByYsFPhUjjLwV/U+ A7kG3I+M73HYRq41mnp2Pgi4E8kjKLZCg/VIbF29ECtoh/suj8m1zfxbIYX2A6EhluN6 mLUu5QZI00XLfRDuz/6Za6YhPcm8vANziTCFpzygN/e6dSqi7o+f/fkDGjOjZu92vSba oZhg== X-Gm-Message-State: APjAAAVpEEiyMw05KjPQXZiiYOM+NbC42qFOIj/SundgV6diwdrvvgRS 9Pe8SxnOcixV2rXDQ8uOAgftzQ== X-Received: by 2002:a63:5041:: with SMTP id q1mr36002644pgl.386.1556544364696; Mon, 29 Apr 2019 06:26:04 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id 10sm98275989pft.100.2019.04.29.06.26.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Apr 2019 06:26:03 -0700 (PDT) Date: Mon, 29 Apr 2019 09:26:02 -0400 From: Joel Fernandes To: Greg KH Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Andrew Morton , ast@kernel.org, atishp04@gmail.com, dancol@google.com, Dan Williams , dietmar.eggemann@arm.com, Guenter Roeck , Jonathan Corbet , karim.yaghmour@opersys.com, Kees Cook , kernel-team@android.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-trace-devel@vger.kernel.org, Manoj Rao , mhiramat@kernel.org, qais.yousef@arm.com, rdunlap@infradead.org, rostedt@goodmis.org, Shuah Khan , yhs@fb.com, Olof Johansson Subject: Re: [PATCH v7 resend 1/2] Provide in-kernel headers to make extending kernel easier Message-ID: <20190429132602.GA165075@google.com> References: <20190426190430.172543-1-joel@joelfernandes.org> <20190427133844.GA29366@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190427133844.GA29366@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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? Let us agree on these open questions so I can respin the patch to be based on that and move this forward. thanks! - Joel