Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4390376imb; Wed, 6 Mar 2019 12:13:27 -0800 (PST) X-Google-Smtp-Source: APXvYqx90KIn/FwXyyJFwBVhoKk0Ks//lzMiMb/3B/zP1eWmZbc9m9DjkTchKhUAg8UUX4wexUwE X-Received: by 2002:a17:902:6b49:: with SMTP id g9mr8900420plt.291.1551903206979; Wed, 06 Mar 2019 12:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551903206; cv=none; d=google.com; s=arc-20160816; b=xh2nJL5bkJ4y+PkwJUXBu7fysLg6Nj6F+FyjKren5S5ACs7g3+XmjUm+MkYFFZy919 eWOGhbS6GPVdNAoSF2H8h4XlsIGYKmid4T1v5FzbPxXDBcItcjCoRKLKpw/I+L6VM9+X zfdR3l5IvyZi7Q5vDr1BR4iaqxePP+BPzzisGKA3GwiYloGzL+B5KZpzGDGRX2VDnPwt Hmwzv4PT6ZzZUgzIlfY7oiZwnSfg8HSKwViAmBDhbKlsee7rfQjdk72jMWJ/G79Pyh0+ 594Rs5+D9dB6B3pOIxydU1yOJcdUx1ePw/zVnCX4r3X25m/2pWdWJkHNMlWw8mbuauRo TPjw== 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=BZwtFx2fooFRjiTR1TCKpWsbKo6ADG45oouWEdHr+9Q=; b=VGOS7/JxxOYN+jpS/2AMsYlpcmzP9Z3foiW0wJa2iP20mu4JtqU//HovdVSLK69dwV X2gP3Y4gMeRW29weZCgiPUpsaXSFzNrIP3f41uQ8Kq1QceYe7UVitDc1aIi9gMiQEGm0 q43yXfb8LLPBAoAV/cVNjM8YrpZd/F4pVHkypYpQIhFGx+rdU0Ly1CikJCV5/L8HzNOb mTQH4+VnaouNM/A/YabGFBlSbV3reAS1v5gCKBouEIekLZEc1u44oSeLlq9bdsWnrmP9 v+j16TBeRwU6GlGnx8iTYOQaFh/juxVedCdk6s1YPL2RQKb54/d1R/M4nPFjuJaZLnbG eUIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="m4M/csyx"; 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 16si2059721pgc.312.2019.03.06.12.13.08; Wed, 06 Mar 2019 12:13:26 -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="m4M/csyx"; 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 S1728544AbfCFRtI (ORCPT + 99 others); Wed, 6 Mar 2019 12:49:08 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:34343 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727500AbfCFRtH (ORCPT ); Wed, 6 Mar 2019 12:49:07 -0500 Received: by mail-qt1-f195.google.com with SMTP id w4so13822430qtc.1 for ; Wed, 06 Mar 2019 09:49:06 -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=BZwtFx2fooFRjiTR1TCKpWsbKo6ADG45oouWEdHr+9Q=; b=m4M/csyxSRB84j6I57zfVmr8mQSwULuc27umU4eF0Q//esDgB5YZ4p2ZsWgfkukxRD 4yjvHtX4X9oQLUarWFFkdfcj4GSMKmJ6rJwQhDGh87gY8VBOx3LSXu8C3rHSbXppf8ZQ MDyqGiwgi4ZuYeoxpp/TPITUfktu3vkSvfWtg= 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=BZwtFx2fooFRjiTR1TCKpWsbKo6ADG45oouWEdHr+9Q=; b=MVg/ffrTUcZ1SFB/7nORYCAw1exH7SMoJyCRmCgIyKETpnZoUAcx66flPCV5tVTdDU ISjkGTyDYXXeNoeOWmLis/Ch2XosD4/uaAQVAL373b9QCsI9SQTE9nRLXzMDb6xPo2p7 Qs5UEBOYij9fw525UNWizMrQRUVKb7NDDVFZtR17tzZEeTuYD8XaLb0hR2P5eETLMdHG PP1pHdlVA7CD6mSK6bDIS46rSLtwhfNLfHHwPplL7KE+Mtjk6Gx0/Y5mdcd3K1BkwBCr McKz60OknmVV7usU0AXxNNBLjiKrm409CJKKjh9UxwuJPwJKlCF/c55nMNTIVFD2ooMc wamg== X-Gm-Message-State: APjAAAXoKX+hBRdstRj2923o2LZHi5+OgQzT6vwIQyeQuKWuv6//mGQk Lk9c+gEz0XemYK2H6fCXcBOIqA== X-Received: by 2002:a0c:954d:: with SMTP id m13mr7138102qvm.243.1551894545801; Wed, 06 Mar 2019 09:49:05 -0800 (PST) Received: from localhost ([2620:0:1004:1100:cca9:fccc:8667:9bdc]) by smtp.gmail.com with ESMTPSA id 14sm1085321qkj.93.2019.03.06.09.49.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Mar 2019 09:49:04 -0800 (PST) Date: Wed, 6 Mar 2019 12:49:04 -0500 From: Joel Fernandes To: Masahiro Yamada Cc: kbuild test robot , kbuild-all@01.org, LKML , Andrew Morton , Alexei Starovoitov , atish patra , Daniel Colascione , Dan Williams , Dietmar Eggemann , Greg Kroah-Hartman , 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 Subject: Re: [PATCH v4 1/2] Provide in-kernel headers for making it easy to extend the kernel Message-ID: <20190306174904.GA34256@google.com> References: <20190301160856.129678-1-joel@joelfernandes.org> <201903030526.3AuYFiuN%fengguang.wu@intel.com> 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 Hi Masahiro, Thanks for review, my replies are inline: On Wed, Mar 06, 2019 at 09:26:14PM +0900, Masahiro Yamada wrote: > On Mon, Mar 4, 2019 at 1:15 AM Joel Fernandes wrote: > > > > This report is for an older version of the patch so ignore it. The > > issue is already resolved. > > > > On Sat, Mar 2, 2019 at 2:00 PM kbuild test robot wrote: > > > > > > Hi Joel, > > > > > > Thank you for the patch! Yet something to improve: > > > > > > [auto build test ERROR on linus/master] > > > [also build test ERROR on v5.0-rc8] > > > [cannot apply to next-20190301] > > > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > > > > > url: https://github.com/0day-ci/linux/commits/Joel-Fernandes-Google/Provide-in-kernel-headers-for-making-it-easy-to-extend-the-kernel/20190303-014850 > > > config: sh-allmodconfig (attached as .config) > > > compiler: sh4-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0 > > > reproduce: > > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > > chmod +x ~/bin/make.cross > > > # save the attached .config to linux build tree > > > GCC_VERSION=8.2.0 make.cross ARCH=sh > > > > > > All errors (new ones prefixed by >>): > > > > > > >> find: 'arch/sh/kernel/module.lds': No such file or directory > > > >> find: 'arch/sh/kernel/module.lds': No such file or directory > > > > > > --- > > > 0-DAY kernel test infrastructure Open Source Technology Center > > > https://lists.01.org/pipermail/kbuild-all Intel Corporation > > > > > > -- > > > You received this message because you are subscribed to the Google Groups "kernel-team" group. > > > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. > > > > Honestly speaking, I am worried about some flaws > in this feature, but anyway I read your code. I am not sure what you mean by that :-(. All the previous series's comments were addressed and it has been well tested by me and others. This looks quite solid to me. Sorry it took so many revisions, this was not that easy to get right. > Here are just comments from the build system point of view > in case something might be useful. > > Please feel free to adopt some of them if you think they are good. >> [1] > > Please do not ignore kbuild test robot. > > It never makes such a mistake like > replying to a new patch about the test result from old version. > > The reports are really addressing this version (v4). > > I see the error message even on x86. I did not mean to. By the way - the error does not cause any issues. It is just find being noisy. You are right I missed this, and I will correct this in v5. However, it does not cause any issues to the feature/functionality at all. > [2] > > The shell script keeps running > even when an error occurs. > > If any line in a shell script fails, > probably it went already wrong. > > I highly recommend to add 'set -e' > at the very beginning of your shell script. > > It will propagate the error to Make. Ok I will consider making it -e. But please note that, the script itself does not have any bugs. When you say it this way, it looks a bit bad to the onlooker as if there is bugs in the code, but there aren't any that I know off. All the comments in this round of review from view are just cosmetic changes. > [3] > > targets += kheaders_data.tar.xz > targets += kheaders_data.h > targets += kheaders.md5 > > These three lines are unneeded because > 'targets' is necessary just for if_changed or if_changed_rule. > > Instead, please add > > clean-files := kheaders_data.tar.xz kheaders_data.h kheaders.md5 Ok. > [4] > > It is pointless to pass 'ikh_file_list' > from Makefile to the shell script. > > > You can directly describe the following in gen_ikh_data.sh > > You do not need to use sed. > > > src_file_list=" > include/ > arch/$SRCARCH/Makefile > arch/$SRCARCH/include/ > arch/$SRCARCH/kernel/module.lds > scripts/ > Makefile > " > > obj_file_list=" > scripts/ > include/ > arch/$SRCARCH/include/ > " Honestly, I prefer to keep it in Makefile. > if grep -q "^CONFIG_STACK_VALIDATION=y" $KCONFIG_CONFIG; then > obj_file_list="$obj_file_list tools/objtool/objtool" > fi > > > > Be careful about module.lds > so that it will work for all architectures. Yes. > [5] > strip-comments.pl is short enough, > and I do not assume any other user. > > > IMHO, it would be cleaner to embed the one-liner perl > into the shell script, for example, like follows: > > find $cpio_dir -type f -print0 | > xargs -0 -P8 -n1 perl -pi -e 'BEGIN {undef $/;}; s/\/\*((?!SPDX).)*?\*\///smg;' This does not work. I already tried it. But I guess I could generate the script on the fly. > [6] > It might be better to move > scripts/gen_ikh_data.sh to kernel/gen_ikh_data.sh > > It will make this feature self-contained in kernel/. > And (more importantly to me), it would reduce my maintenance field. Sure. > [7] > I do not understand for what 'tarfile_md5' is used. > Is it necessary? It is just precaution, incase tar got corrupted and needs to be regenerated. > [8] > Is it more efficient to pipe the header files > to perl script like this? > > > cat (header) | perl 'do something' > (tmp directory) I don't think so. > [9] > > I'd prefer avoiding 'pushd && popd' if possible. > > Hint: Kbuild already runs at the top directory > of objtree. > > > It is OK if the change would mess up the script. This is needed to make out of tree builds work. > [10] > > You can embed a binary directly into C file > without producing a giant header file. > > I refactored kernel/configs.c > https://lore.kernel.org/patchwork/patch/1042013/ > > Be careful; my patch has not been merged yet into the mainline. > > It has been a while in linux-next, > and I have not received any problem report. > > So, I am guessing it will probably be merged > in the current MW. Ok I will consider doing this. Thanks for the review! - Joel