[OpenWrt-Devel,v4,4/4] kernel: 3.18: Strip off all the useless options
diff mbox

Message ID CAOiHx=m5cPVevSU_LskpdWC1OsVj_zNyjX2SKx+PzM4uWbFcAA@mail.gmail.com
State Not Applicable
Headers show

Commit Message

Jonas Gorski Dec. 12, 2014, 5:45 p.m. UTC
On Fri, Dec 12, 2014 at 5:02 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Now that we use the defconfigs, we can remove all the options at their default
> value.

This causes a lot of kernel-config changes for e.g bcm63xx_smp with
3.18, several of which are unwanted (e.g. enabling of the FPU
emulator).

How did you determine which of these symbols were unneeded?

Here a diff of the resulting .config with patches 1-3 applied
(before), and with patch 4 in addition applied (after)

Comments

Maxime Ripard Dec. 13, 2014, 4:03 p.m. UTC | #1
On Fri, Dec 12, 2014 at 06:45:06PM +0100, Jonas Gorski wrote:
> On Fri, Dec 12, 2014 at 5:02 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > Now that we use the defconfigs, we can remove all the options at their default
> > value.
> 
> This causes a lot of kernel-config changes for e.g bcm63xx_smp with
> 3.18, several of which are unwanted (e.g. enabling of the FPU
> emulator).
> 
> How did you determine which of these symbols were unneeded?

I let Kconfig do that job.

The only thing I did was copying the old config-3.18 as .config, and
did a make savedefconfig.

If somethings are missing, they're probably enabled either in your
target config-3.18 or through the openwrt code itself.

> 
> Here a diff of the resulting .config with patches 1-3 applied
> (before), and with patch 4 in addition applied (after)
> 
> --- config-3.18-before 2014-12-12 18:39:08.385702153 +0100
> +++ config-3.18-after   2014-12-12 18:33:58.197708840 +0100
> @@ -167,9 +167,9 @@
>  # CONFIG_PREEMPT is not set
>  # CONFIG_KEXEC is not set
>  # CONFIG_CRASH_DUMP is not set
> -# CONFIG_SECCOMP is not set
> +CONFIG_SECCOMP=y

That one is odd. It's probably because SECCOMP has a default y on
MIPS, and I used an ARM configured kernel.

>  CONFIG_MIPS_O32_FP64_SUPPORT=y
> -# CONFIG_MIPS_FPU_EMULATOR is not set
> +CONFIG_MIPS_FPU_EMULATOR=y

Same thing here.

>  CONFIG_USE_OF=y
>  CONFIG_BOOT_RAW=y
>  CONFIG_LOCKDEP_SUPPORT=y
> @@ -262,7 +262,7 @@
>  # CONFIG_KALLSYMS_UNCOMPRESSED is not set
>  CONFIG_BPF=y
>  CONFIG_EXPERT=y
> -# CONFIG_SGETMASK_SYSCALL is not set
> +CONFIG_SGETMASK_SYSCALL=y

Ditto.

>  # CONFIG_SYSFS_SYSCALL is not set
>  # CONFIG_SYSCTL_SYSCALL is not set
>  CONFIG_KALLSYMS=y
> @@ -276,7 +276,7 @@
>  CONFIG_SIGNALFD=y
>  CONFIG_TIMERFD=y
>  CONFIG_EVENTFD=y
> -CONFIG_BPF_SYSCALL=y
> +# CONFIG_BPF_SYSCALL is not set

Hmmm, that symbol seem to have been introduced in 3.18-rc3. I probably
used an earlier kernel.

>  CONFIG_SHMEM=y
>  # CONFIG_AIO is not set
>  # CONFIG_ADVISE_SYSCALLS is not set
> @@ -311,6 +311,7 @@
>  CONFIG_HAVE_ARCH_JUMP_LABEL=y
>  CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
>  CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
> +CONFIG_SECCOMP_FILTER=y

Same as SECCOMP I guess.

>  CONFIG_HAVE_CC_STACKPROTECTOR=y
>  # CONFIG_CC_STACKPROTECTOR is not set
>  CONFIG_CC_STACKPROTECTOR_NONE=y
> @@ -406,7 +407,11 @@
>  #
>  CONFIG_PCIEPORTBUS=y
>  # CONFIG_PCIEAER is not set
> -# CONFIG_PCIEASPM is not set
> +CONFIG_PCIEASPM=y

Ditto.

> +# CONFIG_PCIEASPM_DEBUG is not set
> +CONFIG_PCIEASPM_DEFAULT=y
> +# CONFIG_PCIEASPM_POWERSAVE is not set
> +# CONFIG_PCIEASPM_PERFORMANCE is not set
>  CONFIG_MMU=y
>  # CONFIG_PCCARD is not set
>  # CONFIG_HOTPLUG_PCI is not set
> @@ -418,7 +423,7 @@
>  #
>  CONFIG_BINFMT_ELF=y
>  CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
> -# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
> +CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y

Another default y option....

>  CONFIG_BINFMT_SCRIPT=y
>  # CONFIG_HAVE_AOUT is not set
>  # CONFIG_BINFMT_MISC is not set
> @@ -528,7 +533,7 @@
>  CONFIG_NETFILTER=y
>  # CONFIG_NETFILTER_DEBUG is not set
>  CONFIG_NETFILTER_ADVANCED=y
> -# CONFIG_BRIDGE_NETFILTER is not set
> +CONFIG_BRIDGE_NETFILTER=y

This one seems to be enforced by the netfilter module.

>  #
>  # Core Netfilter Configuration
> @@ -636,6 +641,7 @@
>  CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
>  # CONFIG_NETFILTER_XT_MATCH_NFACCT is not set
>  # CONFIG_NETFILTER_XT_MATCH_OWNER is not set
> +# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
>  # CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
>  # CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
>  # CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
> @@ -657,7 +663,7 @@
>  #
>  CONFIG_NF_DEFRAG_IPV4=m
>  CONFIG_NF_CONNTRACK_IPV4=m
> -# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set
> +CONFIG_NF_CONNTRACK_PROC_COMPAT=y

default y....

>  # CONFIG_NF_LOG_ARP is not set
>  CONFIG_NF_LOG_IPV4=m
>  CONFIG_NF_REJECT_IPV4=m
> @@ -966,7 +972,7 @@
>  #
>  # CONFIG_MTD_LPDDR is not set
>  CONFIG_MTD_SPI_NOR=y
> -# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
> +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y

Ditto.

>  # CONFIG_MTD_UBI is not set
>  CONFIG_DTC=y
>  CONFIG_OF=y
> @@ -1201,7 +1207,9 @@
>  # CONFIG_FORCEDETH is not set
>  CONFIG_NET_VENDOR_OKI=y
>  # CONFIG_ETHOC is not set
> -# CONFIG_NET_PACKET_ENGINE is not set
> +CONFIG_NET_PACKET_ENGINE=y
> +# CONFIG_HAMACHI is not set
> +# CONFIG_YELLOWFIN is not set

Again...

>  CONFIG_NET_VENDOR_QLOGIC=y
>  # CONFIG_QLA3XXX is not set
>  # CONFIG_QLCNIC is not set
> @@ -1304,9 +1312,9 @@
>  CONFIG_PPP=m
>  # CONFIG_PPP_BSDCOMP is not set
>  # CONFIG_PPP_DEFLATE is not set
> -CONFIG_PPP_FILTER=y
> +# CONFIG_PPP_FILTER is not set
>  # CONFIG_PPP_MPPE is not set
> -CONFIG_PPP_MULTILINK=y
> +# CONFIG_PPP_MULTILINK is not set
>  CONFIG_PPPOE=m
>  CONFIG_PPP_ASYNC=m
>  # CONFIG_PPP_SYNC_TTY is not set
> @@ -1345,7 +1353,10 @@
>  #
>  # Userland interfaces
>  #
> -# CONFIG_INPUT_MOUSEDEV is not set
> +CONFIG_INPUT_MOUSEDEV=m
> +CONFIG_INPUT_MOUSEDEV_PSAUX=y
> +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
> +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768

Again....

>  # CONFIG_INPUT_JOYDEV is not set
>  # CONFIG_INPUT_EVDEV is not set
>  # CONFIG_INPUT_EVBUG is not set
> @@ -1354,7 +1365,7 @@
>  # Input Device Drivers
>  #
>  CONFIG_INPUT_KEYBOARD=y
> -# CONFIG_KEYBOARD_ATKBD is not set
> +CONFIG_KEYBOARD_ATKBD=m
>  # CONFIG_KEYBOARD_LKKBD is not set
>  # CONFIG_KEYBOARD_GPIO is not set
>  CONFIG_KEYBOARD_GPIO_POLLED=m
> @@ -1366,29 +1377,41 @@
>  # CONFIG_KEYBOARD_SUNKBD is not set
>  # CONFIG_KEYBOARD_OMAP4 is not set
>  # CONFIG_KEYBOARD_XTKBD is not set
> -# CONFIG_INPUT_MOUSE is not set
> +CONFIG_INPUT_MOUSE=y
> +CONFIG_MOUSE_PS2=m
> +CONFIG_MOUSE_PS2_ALPS=y
> +CONFIG_MOUSE_PS2_LOGIPS2PP=y
> +CONFIG_MOUSE_PS2_SYNAPTICS=y
> +CONFIG_MOUSE_PS2_CYPRESS=y
> +CONFIG_MOUSE_PS2_TRACKPOINT=y
> +# CONFIG_MOUSE_PS2_ELANTECH is not set
> +# CONFIG_MOUSE_PS2_SENTELIC is not set
> +# CONFIG_MOUSE_PS2_TOUCHKIT is not set
> +# CONFIG_MOUSE_SERIAL is not set
> +# CONFIG_MOUSE_APPLETOUCH is not set
> +# CONFIG_MOUSE_BCM5974 is not set
> +# CONFIG_MOUSE_VSXXXAA is not set
> +# CONFIG_MOUSE_GPIO is not set
> +# CONFIG_MOUSE_SYNAPTICS_USB is not set
>  # CONFIG_INPUT_JOYSTICK is not set
>  # CONFIG_INPUT_TABLET is not set
>  # CONFIG_INPUT_TOUCHSCREEN is not set
> -CONFIG_INPUT_MISC=y
> -# CONFIG_INPUT_AD714X is not set
> -# CONFIG_INPUT_GPIO_BEEPER is not set
> -# CONFIG_INPUT_GPIO_TILT_POLLED is not set
> -# CONFIG_INPUT_ATI_REMOTE2 is not set
> -# CONFIG_INPUT_KEYSPAN_REMOTE is not set
> -# CONFIG_INPUT_POWERMATE is not set
> -# CONFIG_INPUT_YEALINK is not set
> -# CONFIG_INPUT_CM109 is not set
> -# CONFIG_INPUT_UINPUT is not set
> -# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
> -# CONFIG_INPUT_ADXL34X is not set
> -# CONFIG_INPUT_CMA3000 is not set
> +# CONFIG_INPUT_MISC is not set
> 
>  #
>  # Hardware I/O ports
>  #
> -# CONFIG_SERIO is not set
> +CONFIG_SERIO=m
>  CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
> +CONFIG_SERIO_I8042=m
> +CONFIG_SERIO_SERPORT=m
> +# CONFIG_SERIO_PCIPS2 is not set
> +CONFIG_SERIO_LIBPS2=m
> +# CONFIG_SERIO_RAW is not set
> +# CONFIG_SERIO_ALTERA_PS2 is not set
> +# CONFIG_SERIO_PS2MULT is not set
> +# CONFIG_SERIO_ARC_PS2 is not set
> +# CONFIG_SERIO_APBPS2 is not set
>  # CONFIG_GAMEPORT is not set
> 
>  #
> @@ -1636,7 +1659,8 @@
>  #
>  # Graphics support
>  #
> -# CONFIG_VGA_ARB is not set
> +CONFIG_VGA_ARB=y
> +CONFIG_VGA_ARB_MAX_GPUS=16
> 
>  #
>  # Direct Rendering Manager
> @@ -1942,7 +1966,7 @@
>  # Compile-time checks and compiler options
>  #
>  CONFIG_DEBUG_INFO=y
> -CONFIG_DEBUG_INFO_REDUCED=y
> +# CONFIG_DEBUG_INFO_REDUCED is not set
>  # CONFIG_DEBUG_INFO_SPLIT is not set
>  # CONFIG_DEBUG_INFO_DWARF4 is not set
>  CONFIG_ENABLE_WARN_DEPRECATED=y
> @@ -2015,7 +2039,7 @@
>  # CONFIG_SPARSE_RCU_POINTER is not set
>  # CONFIG_TORTURE_TEST is not set
>  # CONFIG_RCU_TORTURE_TEST is not set
> -CONFIG_RCU_CPU_STALL_TIMEOUT=60
> +CONFIG_RCU_CPU_STALL_TIMEOUT=21
>  # CONFIG_RCU_CPU_STALL_INFO is not set
>  # CONFIG_RCU_TRACE is not set
>  # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set

Ok, I think most of it is because of options enabled by default. I
wonder why that happens, but I also wonder why it hasn't been picked
up by my tests.

What configuration are you using? Do you have any modifications of
some sort (beside the switch to 3.18?)

Thanks,
Maxime
Jonas Gorski Dec. 13, 2014, 6:50 p.m. UTC | #2
On Sat, Dec 13, 2014 at 5:03 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Fri, Dec 12, 2014 at 06:45:06PM +0100, Jonas Gorski wrote:
>> On Fri, Dec 12, 2014 at 5:02 PM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > Now that we use the defconfigs, we can remove all the options at their default
>> > value.
>>
>> This causes a lot of kernel-config changes for e.g bcm63xx_smp with
>> 3.18, several of which are unwanted (e.g. enabling of the FPU
>> emulator).
>>
>> How did you determine which of these symbols were unneeded?
>
> I let Kconfig do that job.
>
> The only thing I did was copying the old config-3.18 as .config, and
> did a make savedefconfig.
>
> If somethings are missing, they're probably enabled either in your
> target config-3.18 or through the openwrt code itself.
>
>>
>> Here a diff of the resulting .config with patches 1-3 applied
>> (before), and with patch 4 in addition applied (after)
>>
>> --- config-3.18-before 2014-12-12 18:39:08.385702153 +0100
>> +++ config-3.18-after   2014-12-12 18:33:58.197708840 +0100
>> @@ -167,9 +167,9 @@
>>  # CONFIG_PREEMPT is not set
>>  # CONFIG_KEXEC is not set
>>  # CONFIG_CRASH_DUMP is not set
>> -# CONFIG_SECCOMP is not set
>> +CONFIG_SECCOMP=y
>
> That one is odd. It's probably because SECCOMP has a default y on
> MIPS, and I used an ARM configured kernel.

[snip uninteresting remainder of diff]

> Ok, I think most of it is because of options enabled by default. I
> wonder why that happens, but I also wonder why it hasn't been picked
> up by my tests.

I already somewhat expected that.

So make savedefconfig then likely dropped any non-generic non-arm
config symbols regardless whether they are at their default or
non-default values, causing these discrepancies on non-arm targets.

The safest would be to create the reduced config-* as the union of all
target's savedefconfig results, but only using one for each ARCH might
also suffice.

> What configuration are you using? Do you have any modifications of
> some sort (beside the switch to 3.18?)

All I did was switch to 3.18, then did a make target/linux/compile (so
it generated and "cleaned up" the .config in
build_dir/target-*/linux-*/). I might have a few non-default values in
the openwrt-buildroot config, but I did not have any local patches
applied.

One other thing I just noticed: this currently makes "make
kernel_*config" unusable. "make kernel_oldconfig" will ask about about
everything that is at its defaultvalue, while finishing any *config
will result all default values to be added to the config-* in
target/linux/<target>/. This might be easily fixable by running make
savedefconfig first before the openwrt scripts create the difference
from the generic config-* and the new .config for the new target
config-*


Jonas
Maxime Ripard Dec. 15, 2014, 10:09 a.m. UTC | #3
On Sat, Dec 13, 2014 at 07:50:52PM +0100, Jonas Gorski wrote:
> > Ok, I think most of it is because of options enabled by default. I
> > wonder why that happens, but I also wonder why it hasn't been picked
> > up by my tests.
> 
> I already somewhat expected that.
> 
> So make savedefconfig then likely dropped any non-generic non-arm
> config symbols regardless whether they are at their default or
> non-default values, causing these discrepancies on non-arm targets.
> 
> The safest would be to create the reduced config-* as the union of all
> target's savedefconfig results, but only using one for each ARCH might
> also suffice.

I don't think the latter is supported right now, so the first one
would be the easiest path to follow (and that doesn't prevent from
adding later those arch defconfig fragments, that makes a lot of sense
too).

> > What configuration are you using? Do you have any modifications of
> > some sort (beside the switch to 3.18?)
> 
> All I did was switch to 3.18, then did a make target/linux/compile (so
> it generated and "cleaned up" the .config in
> build_dir/target-*/linux-*/). I might have a few non-default values in
> the openwrt-buildroot config, but I did not have any local patches
> applied.

Ok.

> One other thing I just noticed: this currently makes "make
> kernel_*config" unusable. "make kernel_oldconfig" will ask about about
> everything that is at its defaultvalue, while finishing any *config
> will result all default values to be added to the config-* in
> target/linux/<target>/. This might be easily fixable by running make
> savedefconfig first before the openwrt scripts create the difference
> from the generic config-* and the new .config for the new target
> config-*

Hmmm, indeed. I'll fix that.

Thanks!
Maxime
Jonas Gorski Dec. 15, 2014, 10:23 a.m. UTC | #4
On Mon, Dec 15, 2014 at 11:09 AM, Maxime Ripard wrote:
> On Sat, Dec 13, 2014 at 07:50:52PM +0100, Jonas Gorski wrote:
>> One other thing I just noticed: this currently makes "make
>> kernel_*config" unusable. "make kernel_oldconfig" will ask about about
>> everything that is at its defaultvalue, while finishing any *config
>> will result all default values to be added to the config-* in
>> target/linux/<target>/. This might be easily fixable by running make
>> savedefconfig first before the openwrt scripts create the difference
>> from the generic config-* and the new .config for the new target
>> config-*
>
> Hmmm, indeed. I'll fix that.

Don't get too hung up on the kernel_oldconfig asking about everything
part. I currently don't see a way to fix that with reduced configs, as
the information required for that is exactly what you are trying to
lose. So I won't expect the impossible ;-)


Jonas
Maxime Ripard Dec. 15, 2014, 1:17 p.m. UTC | #5
On Sat, Dec 13, 2014 at 07:50:52PM +0100, Jonas Gorski wrote:
> > Ok, I think most of it is because of options enabled by default. I
> > wonder why that happens, but I also wonder why it hasn't been picked
> > up by my tests.
> 
> I already somewhat expected that.
> 
> So make savedefconfig then likely dropped any non-generic non-arm
> config symbols regardless whether they are at their default or
> non-default values, causing these discrepancies on non-arm targets.
> 
> The safest would be to create the reduced config-* as the union of all
> target's savedefconfig results, but only using one for each ARCH might
> also suffice.

So, I just gave the union of all the config symbol a try, and while it
fixes some issues, it also shows up something unexpected (logic,
actually, but I didn't think of that).

The differences that we have now are for the options that we enable
through another way than the config-<version> file itself (like the
target configuration, or the openwrt makefiles directly), that in turn
have options that depends on them with a default to yes, and that we
don't want to enable.

In short, something like

config FOO
    bool 'Some option'

config BAR
    bool 'Some other option'
    depends on FOO
    default y

If FOO is not enabled, the defconfig won't have any information on
BAR, which means that if FOO gets enabled somehow, BAR will be set to
y.

I guess that in such a case, it should be up to the one that enables
the FOO option to also enforce a BAR value if the default is not ok.

That would be easy to do for the target configuration files, but not
that much whenever it's a package that enables that option for
example.

And putting it in the global configuration kind of defeats the
original purpose of this patch set.

So I guess we should define a policy on this. What do you think?

Maxime
Jonas Gorski Dec. 16, 2014, 12:43 p.m. UTC | #6
On Mon, Dec 15, 2014 at 2:17 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Sat, Dec 13, 2014 at 07:50:52PM +0100, Jonas Gorski wrote:
>> > Ok, I think most of it is because of options enabled by default. I
>> > wonder why that happens, but I also wonder why it hasn't been picked
>> > up by my tests.
>>
>> I already somewhat expected that.
>>
>> So make savedefconfig then likely dropped any non-generic non-arm
>> config symbols regardless whether they are at their default or
>> non-default values, causing these discrepancies on non-arm targets.
>>
>> The safest would be to create the reduced config-* as the union of all
>> target's savedefconfig results, but only using one for each ARCH might
>> also suffice.
>
> So, I just gave the union of all the config symbol a try, and while it
> fixes some issues, it also shows up something unexpected (logic,
> actually, but I didn't think of that).
>
> The differences that we have now are for the options that we enable
> through another way than the config-<version> file itself (like the
> target configuration, or the openwrt makefiles directly), that in turn
> have options that depends on them with a default to yes, and that we
> don't want to enable.
>
> In short, something like
>
> config FOO
>     bool 'Some option'
>
> config BAR
>     bool 'Some other option'
>     depends on FOO
>     default y
>
> If FOO is not enabled, the defconfig won't have any information on
> BAR, which means that if FOO gets enabled somehow, BAR will be set to
> y.
>
> I guess that in such a case, it should be up to the one that enables
> the FOO option to also enforce a BAR value if the default is not ok.
>
> That would be easy to do for the target configuration files, but not
> that much whenever it's a package that enables that option for
> example.
>
> And putting it in the global configuration kind of defeats the
> original purpose of this patch set.
>
> So I guess we should define a policy on this. What do you think?

AFAIR, there are two places for "out-of-config" config symbols:

a) config/Config-kernel.in, where several config symbols are directly
exposed as KERNEL_<foo>. There we can add appropriate additional
config symbols with our desired defaults (as is already done for a
few).

b) KernelPackages in their KCONFIG sections. Adding the appropriate
BAR=n to the defintion that enables FOO should be sufficient.

Did you find any further kernel config options not covered by these?

Of course these are then two places which cannot be cleaned up
automatically, but they aren't new, and I don't think we can't get rid
of it.

Btw, how do you propose to keep the list of symbols required current?
I doubt creating the union is a fast process. If you used a script for
that, I think it would be nice to also add it to scripts/, else nobody
will bother to do it again, and in a few kernel releases the generic
config-<foo> will then contain a lot of clutter again.



Jonas
Maxime Ripard Dec. 19, 2014, 11:13 a.m. UTC | #7
On Tue, Dec 16, 2014 at 01:43:03PM +0100, Jonas Gorski wrote:
> On Mon, Dec 15, 2014 at 2:17 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Sat, Dec 13, 2014 at 07:50:52PM +0100, Jonas Gorski wrote:
> >> > Ok, I think most of it is because of options enabled by default. I
> >> > wonder why that happens, but I also wonder why it hasn't been picked
> >> > up by my tests.
> >>
> >> I already somewhat expected that.
> >>
> >> So make savedefconfig then likely dropped any non-generic non-arm
> >> config symbols regardless whether they are at their default or
> >> non-default values, causing these discrepancies on non-arm targets.
> >>
> >> The safest would be to create the reduced config-* as the union of all
> >> target's savedefconfig results, but only using one for each ARCH might
> >> also suffice.
> >
> > So, I just gave the union of all the config symbol a try, and while it
> > fixes some issues, it also shows up something unexpected (logic,
> > actually, but I didn't think of that).
> >
> > The differences that we have now are for the options that we enable
> > through another way than the config-<version> file itself (like the
> > target configuration, or the openwrt makefiles directly), that in turn
> > have options that depends on them with a default to yes, and that we
> > don't want to enable.
> >
> > In short, something like
> >
> > config FOO
> >     bool 'Some option'
> >
> > config BAR
> >     bool 'Some other option'
> >     depends on FOO
> >     default y
> >
> > If FOO is not enabled, the defconfig won't have any information on
> > BAR, which means that if FOO gets enabled somehow, BAR will be set to
> > y.
> >
> > I guess that in such a case, it should be up to the one that enables
> > the FOO option to also enforce a BAR value if the default is not ok.
> >
> > That would be easy to do for the target configuration files, but not
> > that much whenever it's a package that enables that option for
> > example.
> >
> > And putting it in the global configuration kind of defeats the
> > original purpose of this patch set.
> >
> > So I guess we should define a policy on this. What do you think?
> 
> AFAIR, there are two places for "out-of-config" config symbols:
> 
> a) config/Config-kernel.in, where several config symbols are directly
> exposed as KERNEL_<foo>. There we can add appropriate additional
> config symbols with our desired defaults (as is already done for a
> few).
> 
> b) KernelPackages in their KCONFIG sections. Adding the appropriate
> BAR=n to the defintion that enables FOO should be sufficient.

Indeed, it's what I would find the more sensible.

> Did you find any further kernel config options not covered by these?

There's also target/linux/<target>/config-* that might introduce some
of these, but that can be fixed directly in the file too.

> Of course these are then two places which cannot be cleaned up
> automatically, but they aren't new, and I don't think we can't get rid
> of it.

Actually, the current script I have ignores all of this, since it
build the defconfig using the generic configuration, that doesn't have
any of these three sources yet, so I guess we can just add them as we
identify them, with a process similar to what you have now with the
missing configuration options?

> Btw, how do you propose to keep the list of symbols required current?
> I doubt creating the union is a fast process. If you used a script for
> that, I think it would be nice to also add it to scripts/, else nobody
> will bother to do it again, and in a few kernel releases the generic
> config-<foo> will then contain a lot of clutter again.

It's actually quite fast.

The current script I have is this one
http://code.bulix.org/swedu2-87606

It's a bit hacky, and too specific to be merged as is, but it's
something I can turn into something mergeable.

Maxime

Patch
diff mbox

--- config-3.18-before 2014-12-12 18:39:08.385702153 +0100
+++ config-3.18-after   2014-12-12 18:33:58.197708840 +0100
@@ -167,9 +167,9 @@ 
 # CONFIG_PREEMPT is not set
 # CONFIG_KEXEC is not set
 # CONFIG_CRASH_DUMP is not set
-# CONFIG_SECCOMP is not set
+CONFIG_SECCOMP=y
 CONFIG_MIPS_O32_FP64_SUPPORT=y
-# CONFIG_MIPS_FPU_EMULATOR is not set
+CONFIG_MIPS_FPU_EMULATOR=y
 CONFIG_USE_OF=y
 CONFIG_BOOT_RAW=y
 CONFIG_LOCKDEP_SUPPORT=y
@@ -262,7 +262,7 @@ 
 # CONFIG_KALLSYMS_UNCOMPRESSED is not set
 CONFIG_BPF=y
 CONFIG_EXPERT=y
-# CONFIG_SGETMASK_SYSCALL is not set
+CONFIG_SGETMASK_SYSCALL=y
 # CONFIG_SYSFS_SYSCALL is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS=y
@@ -276,7 +276,7 @@ 
 CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
-CONFIG_BPF_SYSCALL=y
+# CONFIG_BPF_SYSCALL is not set
 CONFIG_SHMEM=y
 # CONFIG_AIO is not set
 # CONFIG_ADVISE_SYSCALLS is not set
@@ -311,6 +311,7 @@ 
 CONFIG_HAVE_ARCH_JUMP_LABEL=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_SECCOMP_FILTER=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 # CONFIG_CC_STACKPROTECTOR is not set
 CONFIG_CC_STACKPROTECTOR_NONE=y
@@ -406,7 +407,11 @@ 
 #
 CONFIG_PCIEPORTBUS=y
 # CONFIG_PCIEAER is not set
-# CONFIG_PCIEASPM is not set
+CONFIG_PCIEASPM=y
+# CONFIG_PCIEASPM_DEBUG is not set
+CONFIG_PCIEASPM_DEFAULT=y
+# CONFIG_PCIEASPM_POWERSAVE is not set
+# CONFIG_PCIEASPM_PERFORMANCE is not set
 CONFIG_MMU=y
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
@@ -418,7 +423,7 @@ 
 #
 CONFIG_BINFMT_ELF=y
 CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
 CONFIG_BINFMT_SCRIPT=y
 # CONFIG_HAVE_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
@@ -528,7 +533,7 @@ 
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 CONFIG_NETFILTER_ADVANCED=y
-# CONFIG_BRIDGE_NETFILTER is not set
+CONFIG_BRIDGE_NETFILTER=y

 #
 # Core Netfilter Configuration
@@ -636,6 +641,7 @@ 
 CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 # CONFIG_NETFILTER_XT_MATCH_NFACCT is not set
 # CONFIG_NETFILTER_XT_MATCH_OWNER is not set
+# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
 # CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
 # CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
 # CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
@@ -657,7 +663,7 @@ 
 #
 CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
-# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 # CONFIG_NF_LOG_ARP is not set
 CONFIG_NF_LOG_IPV4=m
 CONFIG_NF_REJECT_IPV4=m
@@ -966,7 +972,7 @@ 
 #
 # CONFIG_MTD_LPDDR is not set
 CONFIG_MTD_SPI_NOR=y
-# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
+CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 # CONFIG_MTD_UBI is not set
 CONFIG_DTC=y
 CONFIG_OF=y
@@ -1201,7 +1207,9 @@ 
 # CONFIG_FORCEDETH is not set
 CONFIG_NET_VENDOR_OKI=y
 # CONFIG_ETHOC is not set
-# CONFIG_NET_PACKET_ENGINE is not set
+CONFIG_NET_PACKET_ENGINE=y
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
 CONFIG_NET_VENDOR_QLOGIC=y
 # CONFIG_QLA3XXX is not set
 # CONFIG_QLCNIC is not set
@@ -1304,9 +1312,9 @@ 
 CONFIG_PPP=m
 # CONFIG_PPP_BSDCOMP is not set
 # CONFIG_PPP_DEFLATE is not set
-CONFIG_PPP_FILTER=y
+# CONFIG_PPP_FILTER is not set
 # CONFIG_PPP_MPPE is not set
-CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_MULTILINK is not set
 CONFIG_PPPOE=m
 CONFIG_PPP_ASYNC=m
 # CONFIG_PPP_SYNC_TTY is not set
@@ -1345,7 +1353,10 @@ 
 #
 # Userland interfaces
 #
-# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_INPUT_MOUSEDEV=m
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
@@ -1354,7 +1365,7 @@ 
 # Input Device Drivers
 #
 CONFIG_INPUT_KEYBOARD=y
-# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_ATKBD=m
 # CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_GPIO is not set
 CONFIG_KEYBOARD_GPIO_POLLED=m
@@ -1366,29 +1377,41 @@ 
 # CONFIG_KEYBOARD_SUNKBD is not set
 # CONFIG_KEYBOARD_OMAP4 is not set
 # CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_CYPRESS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_MOUSE_SYNAPTICS_USB is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
-CONFIG_INPUT_MISC=y
-# CONFIG_INPUT_AD714X is not set
-# CONFIG_INPUT_GPIO_BEEPER is not set
-# CONFIG_INPUT_GPIO_TILT_POLLED is not set
-# CONFIG_INPUT_ATI_REMOTE2 is not set
-# CONFIG_INPUT_KEYSPAN_REMOTE is not set
-# CONFIG_INPUT_POWERMATE is not set
-# CONFIG_INPUT_YEALINK is not set
-# CONFIG_INPUT_CM109 is not set
-# CONFIG_INPUT_UINPUT is not set
-# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
-# CONFIG_INPUT_ADXL34X is not set
-# CONFIG_INPUT_CMA3000 is not set
+# CONFIG_INPUT_MISC is not set

 #
 # Hardware I/O ports
 #
-# CONFIG_SERIO is not set
+CONFIG_SERIO=m
 CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
+CONFIG_SERIO_I8042=m
+CONFIG_SERIO_SERPORT=m
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=m
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_ALTERA_PS2 is not set
+# CONFIG_SERIO_PS2MULT is not set
+# CONFIG_SERIO_ARC_PS2 is not set
+# CONFIG_SERIO_APBPS2 is not set
 # CONFIG_GAMEPORT is not set

 #
@@ -1636,7 +1659,8 @@ 
 #
 # Graphics support
 #
-# CONFIG_VGA_ARB is not set
+CONFIG_VGA_ARB=y
+CONFIG_VGA_ARB_MAX_GPUS=16

 #
 # Direct Rendering Manager
@@ -1942,7 +1966,7 @@ 
 # Compile-time checks and compiler options
 #
 CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_INFO_REDUCED=y
+# CONFIG_DEBUG_INFO_REDUCED is not set
 # CONFIG_DEBUG_INFO_SPLIT is not set
 # CONFIG_DEBUG_INFO_DWARF4 is not set
 CONFIG_ENABLE_WARN_DEPRECATED=y
@@ -2015,7 +2039,7 @@ 
 # CONFIG_SPARSE_RCU_POINTER is not set
 # CONFIG_TORTURE_TEST is not set
 # CONFIG_RCU_TORTURE_TEST is not set
-CONFIG_RCU_CPU_STALL_TIMEOUT=60
+CONFIG_RCU_CPU_STALL_TIMEOUT=21
 # CONFIG_RCU_CPU_STALL_INFO is not set
 # CONFIG_RCU_TRACE is not set
 # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set