lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQJ+J_d6FbcHZ5+SM6mS3MjyGq_Q3x4_BxWzXzVZvMRkQ@mail.gmail.com>
Date:   Thu, 5 Jul 2018 14:38:22 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     Christoph Hellwig <hch@....de>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/5] kconfig: include common Kconfig files from top-level Kconfig

2018-07-04 1:11 GMT+09:00 Randy Dunlap <rdunlap@...radead.org>:
> On 07/03/18 06:36, Christoph Hellwig wrote:
>> On Mon, Jul 02, 2018 at 01:08:16PM -0700, Randy Dunlap wrote:
>>>> I would prefer to have init/Kconfig before arch/$(SRCARCH)/Kconfig.
>>>
>>> Ugh, that won't get this set correctly on x86_64:
>>> CONFIG_PGTABLE_LEVELS=2
>>
>> Did you try it?  As far as I can tell modern kconfig isn't really
>> order sensitive any more.
>> --
>
> Yes, it was wrong. :(
>
> Once the symbol has a default value, it won't be assigned a different
> default value (at least that's how it looks; I haven't read the kconfig
> source code).
>

The order does matter.

The 'default' properties are accumulated
as they appear.


If arch/Kconfig were parsed before arch/x86/Kconfig,
it would end up with this:



config PGTABLE_LEVELS
    int
    default 2                    <- from arch/Kconfig
    default 5 if X86_5LEVEL      <- from arch/x86/Kconfig
    default 4 if X86_64          <- from arch/x86/Kconfig
    default 3 if X86_PAE         <- from arch/x86/Kconfig
    default 2                    <- from arch/x86/Kconfig

So, PGTABLE_LEVELS would be always 2.
The last four lines are dead code.





The correct order is arch/x86/Kconfig, arch/Kconfig
then we can get this:

config PGTABLE_LEVELS
    int
    default 5 if X86_5LEVEL      <- from arch/x86/Kconfig
    default 4 if X86_64          <- from arch/x86/Kconfig
    default 3 if X86_PAE         <- from arch/x86/Kconfig
    default 2                    <- from arch/x86/Kconfig
    default 2                    <- from arch/Kconfig


-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ