Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5315239imu; Sun, 20 Jan 2019 08:11:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN66gyhCxFgIzPw47Yeulk4gOqSz/8oRXWB0/00t+v/b+sRpb3+6AYh46ECFZcbs4hMWiD+L X-Received: by 2002:a63:920a:: with SMTP id o10mr24366107pgd.141.1548000687446; Sun, 20 Jan 2019 08:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548000687; cv=none; d=google.com; s=arc-20160816; b=WtXTqBpAl/6A+bi4IvSxXxR07nQwgsIuuG/5mOHd6c5Tr/pVPmte5Cg14t/smG9Yh5 gnGpMox2Duv279q3TxusnvuDR3dL0z5HzlT6FX3/wUg9bhI+cthdZZ+epRx20YLb5ClE RkMvIgC+OZK8Ou86SbS0Sv3UenseFLvyrT9rJz06S+nHEKcVCAZkyPMmzvLLVXmiYzRW hN5lL3E9WtJXhUs3HkOgYLAGkr8pkWG7aCZ5U7f0ujWO9TVyAw9NfNxqa1pSCRrFBYod yJo1eWJXOjM056P06EVt+7UREshChXeDATUp5El/LYmnEw8hOuSAjcNMyXDkZTS7nhEq KfJw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gJLe9NCacgEEA/W4lTVsKxupjgEOAu7y//ExpgweGGQ=; b=fPN/P9NszxBkGX8xtSABBCyxEwP6Xdf6uUBxhCP/Y4uHvS4WzCUeN0rjxOEuDAjmEG 6D+/44jyGamfySL8OzRKvIC2a3djDuwC0a9VLl4S45C0UJn3hVWFPHiRky3fzrh+ESQf mmlwNALcFFCCFL60YYvXCkZ35KkuyYtLxTvBQfRzD8PSq8leP6bTtcgnOC2eD2smppEJ oILKxQ89hkkIeTMltL36ITe35s3YFo3ykEmiFv8gAfeVF7pRJL8tIf3wSdgV7gT6GHSm L9I4R6AAp0SLk35CkVyKIhatowE+JbhXU2ddOJnHau2PLRAjutPD6+Xz5435OpDS6kPg ZZQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=beePmekC; 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 z14si231081pga.349.2019.01.20.08.11.11; Sun, 20 Jan 2019 08:11:27 -0800 (PST) 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=beePmekC; 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 S1725985AbfATQKH (ORCPT + 99 others); Sun, 20 Jan 2019 11:10:07 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:44180 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbfATQKG (ORCPT ); Sun, 20 Jan 2019 11:10:06 -0500 Received: by mail-qt1-f194.google.com with SMTP id n32so20534362qte.11 for ; Sun, 20 Jan 2019 08:10:05 -0800 (PST) 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:content-transfer-encoding:in-reply-to :user-agent; bh=gJLe9NCacgEEA/W4lTVsKxupjgEOAu7y//ExpgweGGQ=; b=beePmekC5ybj6xweHrQRBJOocc00LddL5ESR8RnA0m0vIJacHdoxDo7u4C8fJvnGws jnWtnziu/4VRu/dl7BRtZuHJbhftt+kmxXRB6qSizh9pkpDzEH/5vbUqhZ6PaYKVGeVb txaZJIlgqQkfQRfL6aEdZQ4jAp3neAfv+oxvU= 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:content-transfer-encoding :in-reply-to:user-agent; bh=gJLe9NCacgEEA/W4lTVsKxupjgEOAu7y//ExpgweGGQ=; b=s2PUUrE8QPnjqh+ri6e3ISr1Iths+8W7hhEYAAtz+2CidSnGISYHiiAbO4rKfuF+MD Te0Cs41R5Jn8fu1T9y7hjq5OLCZ9zPslRUw9G0Qil7Eo5zD18WxpiVxNwRxnb3safb+E LfRsmqDHSunj7N5csb7hnjrKTtR472EjBbbzlV7bDoHTKQpduRy+XLRd8u13lEkZbhfz D4CpDQ08R462L9d1fHgQxRz8K6r84FKRUPUdhySOXCeZTpvjTG49XcxkIRmffkGxDWNh OCPbK9dghPrpAkjR8G2LNzgB6zuOU8EARQNdPRV5NBTdi6fFVn9Qc9VBXb9E9OW6OXN6 AsQQ== X-Gm-Message-State: AJcUukcrUxmT3YjBsnrOvtDfdprkApBuAZEjr5XC4gFJ3hgCgPGm1TvQ SgM6EpJkE5yq6VBqMInQ6LG8kA== X-Received: by 2002:ac8:43d0:: with SMTP id w16mr23699498qtn.78.1548000605188; Sun, 20 Jan 2019 08:10:05 -0800 (PST) Received: from localhost ([2620:0:1004:1100:cca9:fccc:8667:9bdc]) by smtp.gmail.com with ESMTPSA id a17sm55260394qth.93.2019.01.20.08.10.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jan 2019 08:10:04 -0800 (PST) Date: Sun, 20 Jan 2019 11:10:03 -0500 From: Joel Fernandes To: hpa@zytor.com Cc: Greg KH , Christoph Hellwig , linux-kernel@vger.kernel.org, Andrew Morton , ast@kernel.org, atishp04@gmail.com, Borislav Petkov , dancol@google.com, Ingo Molnar , Jan Kara , Jonathan Corbet , karim.yaghmour@opersys.com, Kees Cook , kernel-team@android.com, linux-doc@vger.kernel.org, Manoj Rao , Masahiro Yamada , paulmck@linux.vnet.ibm.com, "Peter Zijlstra (Intel)" , rdunlap@infradead.org, rostedt@goodmis.org, Thomas Gleixner , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , yhs@fb.com Subject: Re: [RFC] Provide in-kernel headers for making it easy to extend the kernel Message-ID: <20190120161003.GB23827@google.com> References: <20190118225543.86996-1-joel@joelfernandes.org> <20190119102800.GB17723@infradead.org> <20190119103606.GA17400@kroah.com> <8BD4CB7A-944C-4EC5-A198-1D85C9EE28D6@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8BD4CB7A-944C-4EC5-A198-1D85C9EE28D6@zytor.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, Jan 19, 2019 at 11:01:13PM -0800, hpa@zytor.com wrote: > On January 19, 2019 2:36:06 AM PST, Greg KH wrote: > >On Sat, Jan 19, 2019 at 02:28:00AM -0800, Christoph Hellwig wrote: > >> This seems like a pretty horrible idea and waste of kernel memory. > > > >It's only a waste if you want it to be a waste, i.e. if you load the > >kernel module. > > > >This really isn't any different from how /proc/config.gz works. > > > >> Just add support to kbuild to store a compressed archive in initramfs > >> and unpack it in the right place. > > > >I think the issue is that some devices do not use initramfs, or switch > >away from it after init happens or something like that. Joel has all > >of > >the looney details that he can provide. > > > >thanks, > > > >greg k-h > > Yeah, well... but it is kind of a losing game... the more in-kernel stuff there is the less smiley are things to actually be supported. It is better than nothing, and if this makes things a bit easier and solves real-world issues people have been having, and is optional, then I don't see why not. > Modularizing is it in some ways even crazier in the sense that at that point you are relying on the filesystem containing the module, which has to be loaded into the kernel by a root user. One could even wonder if a better way to do this would be to have "make modules_install" park an archive file – or even a directory as opposed to a symlink – with this stuff in /lib/modules. We could even provide a tmpfs shim which autoloads such an archive via the firmware loader; this might even be generically useful, who knows. All this seems to assume where the modules are located. In Android, we don't have /lib/modules. This patch generically fits into the grand scheme things and I think is just better made a part of the kernel since it is not that huge once compressed, as Dan also pointed. The more complex, and the more assumptions we make, the less likely people writing tools will get it right and be able to easily use it. > > Note also that initramfs contents can be built into the kernel. Extracting such content into a single-instance tmpfs would again be a possibility Such an approach would bloat the kernel image size though, which may not work for everyone. The module based approach, on the other hand, gives an option to the user to enable the feature, but not have it loaded into memory or used until it is really needed. thanks, - Joel