Received: by 10.223.185.116 with SMTP id b49csp2396015wrg; Mon, 12 Feb 2018 08:54:37 -0800 (PST) X-Google-Smtp-Source: AH8x225/n/gNQxhudtUPton4JwBpB+VqbDDr7wF2NOll4iHzbPxiDINJEkRlNZ3jMBlgeT+47lMh X-Received: by 2002:a17:902:3343:: with SMTP id a61-v6mr11132575plc.185.1518454477770; Mon, 12 Feb 2018 08:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518454477; cv=none; d=google.com; s=arc-20160816; b=0AtQBX2DJAZO/xo787MJeW6ubXx4YqN/YCd3E+24wPnoAa+rdjz/UsteGdogkmmSbC BeWsVvwuLyPVgvWdjNFBlJdemKAtvLN2r1tvavSqQgSz33JEZSitbGDcPLTawjCdaZtp ICxGWDMTfs8RPli60zV4R8RzN1hWHEt5Hbps++hA03zQg+3zD9tu4pYEFgenfIQkGs4N m2l4soFIGmxgB8YCdUrNwTUe8C993yqFI8eYS4A4Ubs0/u5BgWSSQnVEszQr0wSN5ZRZ Jp9hJL70NcxHLcPbMcWSx6OcRfzHkjj9yh+GIWxeuJQN3bFL4ukxXm0gcRSlyOqP9jiQ 20dQ== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=N5auMTsaM+6MQ8OJBMe55hgEKN8A2I8B8D81ZIbfuyE=; b=YKKXYfp4cC/QuGTgkuJ53+kz3gsl4TAqFOZsqAlqMwuDDoopi8+6rWi477Zj5bpKhy WnCeUQqVIfnaGPKRBU6fG+xJ4yb27k0kC1AJw3ElNj3clLwudd78VxqI2aDeAXv3s08g qOBYkRPbLO8Fj9P6o1CVxFJ9WfeJ37x9+jPpmY8XBS3G5w8yLLCzmL8T/ZheoWpkQwvA pC/epsaxOcn8qNPk2V+3OzHvQJGwZ8IaHe1gO5szKO6rFk95+3BW1Ch/t5RhBSplJ+zw vRqzTg3ZqwHxzhOZQYBdmT/lAeRLt9ZmY0LPxAwx38slPa+M1Si5yA/y6uyzTb+QldYv OjFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fPkqnkB+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si3478115pgr.631.2018.02.12.08.54.23; Mon, 12 Feb 2018 08:54:37 -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=@gmail.com header.s=20161025 header.b=fPkqnkB+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935907AbeBLOdC (ORCPT + 99 others); Mon, 12 Feb 2018 09:33:02 -0500 Received: from mail-vk0-f53.google.com ([209.85.213.53]:40042 "EHLO mail-vk0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935345AbeBLOc7 (ORCPT ); Mon, 12 Feb 2018 09:32:59 -0500 Received: by mail-vk0-f53.google.com with SMTP id o17so1592150vke.7; Mon, 12 Feb 2018 06:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=N5auMTsaM+6MQ8OJBMe55hgEKN8A2I8B8D81ZIbfuyE=; b=fPkqnkB+3AO90fkjnIuiAQBVCA4MibVZN53sChcJhO3TwSWyPSHbJ0UqxXum9kvm+8 L7lp6cX5eQVqk7SA+iHIUWhYWAyohxVgeaBzxMw33q4hubZyTgH/kCwXDUFh6kpNfTq5 rLc8LYJFPRfJVCFN7Bu+ylK5QEi+OWwDzU1BZx9OIuiao2No9h/JoTRXH1lCG5/LKshf uykw0Abu5QZYgOs9qs6fZB2Cad2x1F36ZWI+uGag8ycIytI4KghY0YgrRELCLPOQ1K2J OSEjMPk2M3xjnOIc5NmPs7QuGiTeFz9Pd492MMh3GYmVoFCxw1NLE28MDA5m35qcsb1Z 8R2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=N5auMTsaM+6MQ8OJBMe55hgEKN8A2I8B8D81ZIbfuyE=; b=UiE8jURKEAR0E/f4Ux4k3VBQovf09tNZr67RFtdcVHF1tiU+qwkPFV4aWlLg8q989f 8N/PWRWwNmFoMOtfzNG45h3TlHrelS0og6BOio2bNOAXBopUmxFWZGLPwPcxpu8eN55c YIu3gOJsn5QEohpRW43ErEYJSX7zcO1n+0DqLaz98D9EROiFygY5OLhbLlf+rmiS1IDP iYi9EtKbKPVSgyV4L1tBpW3IZQeVs3bOQZ7EThldxWo3A1Jj07G8XybSK/IN51k2/qu9 9vmWx8SbuDHJMNadTPA93xq4KlC5sVR5Ky5EZss50z93Q+HQeTEX6o5xfKr8rgK5758E XCBw== X-Gm-Message-State: APf1xPDfjTwFya2gOWj0E/1hZ5pi4i8yN3Bs114SBnI1JdpGkH8AAvk4 rRu6oLyxpb1UVcqrJ/Xun+ea82ffQBTyH0pC1iU= X-Received: by 10.31.181.69 with SMTP id e66mr10673861vkf.122.1518445978462; Mon, 12 Feb 2018 06:32:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.70.21 with HTTP; Mon, 12 Feb 2018 06:32:57 -0800 (PST) In-Reply-To: References: <20180210085519.737ckf4bcl57h4g2@huvuddator> <20180211103432.pf2ot6nd7nbhdhsy@huvuddator> <20180212125458.vb4ve3ieejvuvo65@huvuddator> From: Ulf Magnusson Date: Mon, 12 Feb 2018 15:32:57 +0100 Message-ID: Subject: Re: [RFC PATCH 4/7] kconfig: support new special property shell= To: Masahiro Yamada Cc: Kees Cook , Linus Torvalds , Linux Kbuild mailing list , Greg Kroah-Hartman , Andrew Morton , Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Sam Ravnborg , Michal Marek , Martin Schwidefsky , Pavel Machek , linux-s390 , Jiri Kosina , Linux Kernel Mailing List , Tejun Heo , Ingo Molnar , "Van De Ven, Arjan" , Arnd Bergmann 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, Feb 12, 2018 at 3:23 PM, Masahiro Yamada wrote: > 2018-02-12 23:21 GMT+09:00 Masahiro Yamada : >> 2018-02-12 21:54 GMT+09:00 Ulf Magnusson : >>> On Sun, Feb 11, 2018 at 09:42:09PM +0100, Ulf Magnusson wrote: >>>> On Sun, Feb 11, 2018 at 9:29 PM, Ulf Magnusson wrote: >>>> > On Sun, Feb 11, 2018 at 6:56 PM, Kees Cook wrote: >>>> >> Another case I mentioned before that I just want to make sure we don't >>>> >> reintroduce the problem of getting "stuck" with a bad .config file. >>>> >> While adding _STRONG support, I discovered the two-phase Kconfig >>>> >> resolution that happens during the build. If you selected _STRONG with >>>> >> a strong-capable compiler, everything was fine. If you then tried to >>>> >> build with an older compiler, you'd get stuck since _STRONG wasn't >>>> >> support (as detected during the first Kconfig phase) so the >>>> >> generated/autoconf.h would never get updated with the newly selected >>>> >> _REGULAR). I moved the Makefile analysis of available stack-protector >>>> >> options into the second phase (i.e. after all the Kconfig runs), and >>>> >> that worked to both unstick such configs and provide a clear message >>>> >> early in the build about what wasn't available. >>>> >> >>>> >> If all this detection is getting moved up into Kconfig, I'm worried >>>> >> we'll end up in this state again. If the answer is "you have to delete >>>> >> autoconf.h if you change compilers", then that's fine, but it sure >>>> >> seems unfriendly. :) >>>> > >>>> > Did you mean include/config/auto.conf? That's the one that gets >>>> > included by the Makefiles. >>>> > >>>> > If the feature detection is moved into Kconfig, you should only need >>>> > to rerun the configuration (make menuconfig/oldconfig/olddefconfig) if >>>> > you change the compiler. That will update .config while taking the new >>>> > features into account, and then the second phase during 'make' will >>>> > update include/config/auto.conf from .config. >>>> > >>>> > That second Kconfig phase generates include/generated/autoconf.h and >>>> > include/config/. The include/config/ directory implements dependencies >>>> > between source files and Kconfig symbols by turning the symbols into >>>> > (empty) files. When building (during the "second phase"), Kconfig >>>> > compares .config with include/config/auto.conf to see what changed, >>>> > and signals the changes to 'make' by touch'ing the files corresponding >>>> > to the changed symbols. The idea is to avoid having to do a full >>>> > rebuild whenever the configuration is changed. >>>> > >>>> > Check out scripts/basic/fixdep.c as well if you want to understand how it works. >>>> > >>>> > Cheers, >>>> > Ulf >>>> >>>> By the way: >>>> >>>> That second phase is also a "normal" Kconfig run in the sense that it >>>> does all the usual dependency checking stuff. Even if .config doesn't >>>> respect dependencies, include/config/auto.conf will. So I think you >>>> might not even need to rerun the configuration (though .config will be >>>> out-of-date until you do). >>>> >>>> Cheers, >>>> Ulf >>> >>> Seems you'd have to rerun the configuration, because >>> include/config/auto.conf is only regenerated if it's older than .config. >>> >>> Here's the bit in the root Makefile that does it (KCONFIG_CONFIG is >>> .config). >>> >>> # If .config is newer than include/config/auto.conf, someone tinkered >>> # with it and forgot to run make oldconfig. >>> # if auto.conf.cmd is missing then we are probably in a cleaned tree so >>> # we execute the config step to be sure to catch updated Kconfig files >>> include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd >>> $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig >>> >>> silentoldconfig is a terrible name. What it actually does is run that >>> "second phase" stuff. >> >> Right. This is a historical misnomer. >> >> My plan is, as already posted below, to rename 'silentoldconfig' to 'synconfig' >> https://lkml.org/lkml/2018/1/17/1359 >> >> >> >>> Pretty sure that comment lies by the way. 'make oldconfig' doesn't >>> update include/config/auto.conf. It's probably outdated. >> >> Good catch. >> >> >>> >>> I wonder if it would be simpler to just always run silentoldconfig when >>> building. It's not that slow on my system: >>> >>> $ export ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` >>> $ time scripts/kconfig/conf --silentoldconfig Kconfig >>> >>> real 0m0.167s >>> user 0m0.162s >>> sys 0m0.004s >>> >>> That'd both simplify the Makefiles, and make sure that the latest >>> features are always used if you do feature testing in Kconfig. >>> >>> I don't know how strongly people feel about a few tenths of a second >>> though. >> >> >> No. NACK. >> >> silentoldconfig touches include/generated/autoconf.h >> so, files that depend on it will be re-compiled, unnecessarily. > > > Sorry, I take back this comment. > fixdep takes care of this. > > So, autoconf.h is removed from dependency. > Still something that would need to be looked into, to make sure there's nothing depending on stuff generated by silentoldconfig that would get rebuilt over and over. Cheers, Ulf