Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3149413imj; Mon, 18 Feb 2019 21:12:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IblwXdMGjaXyxdbsmrAnaBEelFUvOHpf2jnM8iE0rz1BzU164jl/cq2BBd9JNW67YclFB3C X-Received: by 2002:a63:a:: with SMTP id 10mr22115479pga.121.1550553165624; Mon, 18 Feb 2019 21:12:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550553165; cv=none; d=google.com; s=arc-20160816; b=GvIRXfftB1YT4/ttf+r+ydFgg1V+WCfdd6lUNKFZWA5HjW75++jgy10QWbljk8y6T9 oNpA1L0Rn4ckzCRj5CRVM370pBiMr0/ZQtORU3e3RFXd+xThkeHaJBksziTng5HzjyfX j3HhkXa99B3XAtkYQ76m0tRQRKuFy50Y6IgTjVYxseUJH8Ku/COob6eAu2S2jsfN2oMs Y9A1DRvOHlO/D+nAqhNdjwJP11LSbjAjKHFT/fieYFyRzaX4TL0imsuTceNki4VJWlkY nu2As3N6mHeR+/6qk4wleTh/UGpDvgVAV5BaY2ASPf5wtls5rB5e0Kv2Z8OUOVGXpyvG B3Iw== 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=cGBUWjaDlcQIPzo4F5E6iO9ob6JqRw4yCLGX5zw2eMM=; b=qZ1eNpXVYJNoQqTSdH0iBQXS5JUZkaan/QKMBj5rWg3A3XTu5zahD7A3akbIEiiaOu EpGtzCz7afYRpcdVhfnjkCmy2wHcea2Vmd7NOCNqy8oqv7F2ojDLelvzK9EXc9yuPPW9 2CJpUc3YLCZTFXLhirZoOoNmFyeQwuOgYBfr3KdUdLdyyg5whOPHAgRt6FvPd+iaYNy7 76XJrWwi8zfn9OoKZP/7U6ci4HjtjXEUc/4fQQ4NpqiGs5p1nRlw8KS478NXuTZ45kPs TL2icpK4+n8ixwBbPFMBzjvyij+AQoy5Ww0DUhHDCJyNvBqEEThXMi+LQyiRDgzLojSv beWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=aolAv2C7; 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 z9si15308994pgf.54.2019.02.18.21.12.30; Mon, 18 Feb 2019 21:12:45 -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=aolAv2C7; 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 S1726187AbfBSFMG (ORCPT + 99 others); Tue, 19 Feb 2019 00:12:06 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:39002 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbfBSFMF (ORCPT ); Tue, 19 Feb 2019 00:12:05 -0500 Received: by mail-qt1-f195.google.com with SMTP id o6so21781940qtk.6 for ; Mon, 18 Feb 2019 21:12: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:in-reply-to:user-agent; bh=cGBUWjaDlcQIPzo4F5E6iO9ob6JqRw4yCLGX5zw2eMM=; b=aolAv2C7w86R4gWSViX9cMjwLfUqRX+7evBV8NPmPS9xXrhVl7UEi004UMIiO/aJqf Emc315u74IsSpuoTZlk+Q5O81jGYmNz2FVd/GGC5r8fhugu76O4q++CBdYnuogGt9A0l iDKTyz2NkvwU15le+h7Hx7RKNcCT+Z4mhc9dw= 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=cGBUWjaDlcQIPzo4F5E6iO9ob6JqRw4yCLGX5zw2eMM=; b=NGAhYdgQtKoDJjH/DU0/46gGM2LXpMsCx5x0bEDluduklbOkVUWAD++nRYN3LkhxRD 9BrU1eIxkpjNlO3HIebCmZtBHUQ6srWZHVvYdUWLkbcFdTjxQ+3bCLik54Ift9CUJtn1 B0sH/5Jn7XbCaqp8JsPeah8oy/L03iWTwnSBfsIaYUcX18jNSgnIQryVrsIrwKGCWkNR ateAd2kUbwRhyoK46kL7kunlbNwNIu2BLM6jLP8Zx8nnFjvBRidgRs9uCuklsTXzWaSn Yv8iFDtgjp09eDOvQAd7L4HkAt9JTDcOdZQrg238e0h3upw3dBl4D2UwLJ7MFJ7xvNgk NCrw== X-Gm-Message-State: AHQUAuZIPCyfNDi1I+tegHCyvvkkXucX2aCHFvBJpocjHKmW8FU6OyoO fRkHg9NLiSS5X7Hn/s/sabEz5A== X-Received: by 2002:a0c:ab87:: with SMTP id j7mr18026669qvb.137.1550553124467; Mon, 18 Feb 2019 21:12:04 -0800 (PST) Received: from localhost ([2620:0:1004:1100:cca9:fccc:8667:9bdc]) by smtp.gmail.com with ESMTPSA id a133sm2604248qkg.66.2019.02.18.21.12.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Feb 2019 21:12:03 -0800 (PST) Date: Tue, 19 Feb 2019 00:12:03 -0500 From: Joel Fernandes To: Masahiro Yamada Cc: Alexei Starovoitov , Networking , Linux Kernel Mailing List , Andrew Morton , Alexei Starovoitov , atish patra , Daniel Colascione , Dan Williams , Greg Kroah-Hartman , Jonathan Corbet , Karim Yaghmour , Kees Cook , kernel-team@android.com, "open list:DOCUMENTATION" , "open list:KERNEL SELFTEST FRAMEWORK" , Manoj Rao , Paul McKenney , "Peter Zijlstra (Intel)" , Randy Dunlap , Steven Rostedt , Shuah Khan , Thomas Gleixner , Yonghong Song Subject: Re: [PATCH v2 1/2] Provide in-kernel headers for making it easy to extend the kernel Message-ID: <20190219051203.GD201007@google.com> References: <20190211143600.15021-1-joel@joelfernandes.org> <20190215031926.ljzluy2cfxp64u6o@ast-mbp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Feb 19, 2019 at 01:42:13PM +0900, Masahiro Yamada wrote: [..] > > > > This archive makes > > > > it possible to build kernel modules, run eBPF programs, and other > > > > tracing programs that need to extend the kernel for tracing purposes > > > > without any dependency on the file system having headers and build > > > > artifacts. > > > > > > > > On Android and embedded systems, it is common to switch kernels but not > > > > have kernel headers available on the file system. Raw kernel headers > > > > also cannot be copied into the filesystem like they can be on other > > > > distros, due to licensing and other issues. There's no linux-headers > > > > package on Android. Further once a different kernel is booted, any > > > > headers stored on the file system will no longer be useful. 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 set looks good to me and since the main use case is building bpf progs > > > I can route it via bpf-next tree if there are no objections. > > > Masahiro, could you please ack it? > > > > > > Honestly, I was not tracking this thread > > since I did not know I was responsible for this. > > > > > > I just started to take a closer look, then immediately got scared. > > > > This version is not mature enough for the merge. > > > > > > > > First of all, this patch cannot be compiled out-of-tree (O= option). > > > > > > I do not know why 0-day bot did not catch this apparent breakage. > > > > > > $ make -j8 O=hoge > > make[1]: Entering directory '/home/masahiro/workspace/bsp/linux/hoge' > > GEN Makefile > > Using .. as source for kernel > > DESCEND objtool > > CALL ../scripts/checksyscalls.sh > > CHK include/generated/compile.h > > make[2]: *** No rule to make target 'Module.symvers', needed by > > 'kernel/kheaders_data.txz'. Stop. > > make[2]: *** Waiting for unfinished jobs.... > > /home/masahiro/workspace/bsp/linux/Makefile:1043: recipe for target > > 'kernel' failed > > make[1]: *** [kernel] Error 2 > > make[1]: *** Waiting for unfinished jobs.... > > make[1]: Leaving directory '/home/masahiro/workspace/bsp/linux/hoge' > > Makefile:152: recipe for target 'sub-make' failed > > make: *** [sub-make] Error 2 > > > > > I saw this build error for in-tree building as well. > > We cannot build this from a pristine source tree. > > For example, I observed the build error in the following procedure. > > $ make mrproper > $ make defconfig > Set CONFIG_IKHEADERS_PROC=y > $ make > > > > > Module.symvers is generated in the modpost stage > (the very last stage of build). > > But, vmlinux depends on kernel/kheaders_data.txz, > which includes Module.symvers. > > So, this is not so simple since it is a circular dependency... I guess I was not building a pristine tree either and missed this circular dependency :-/ . Any ideas on how we can fix the Module.symvers issue? One idea is to reserve the space in the binaries, but only populate the space reserved in the binary *after* the modpost stage, once the archive is ready.. thanks, - Joel