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: <CAATStaMkJ_xdkHutcgH2bmZiO3z6fKoLNrP5=Q3XUsNTpvHP5g@mail.gmail.com>
Date:   Tue, 4 May 2021 11:21:58 +1000
From:   "Anand K. Mistry" <amistry@...gle.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     x86@...nel.org, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] x86: Add a prompt for HPET_EMULATE_RTC

On Mon, 3 May 2021 at 17:38, Thomas Gleixner <tglx@...utronix.de> wrote:
>
> On Thu, Apr 29 2021 at 16:00, Anand K. Mistry wrote:
>
> > This does two things:
> > 1. Makes the option visible in menuconfig, allowing the user to easily
> >    disable this option
> > 2. Allows olddefconfig to respect the option if it is set in the old
> >    .config file
>
> Well, it's pretty clear WHAT it does, but there is absolutely no
> reasoning WHY this knob is needed in the first place.

Without this option, 'make oldolddefconfig' ignores the option in the
old .confg file and just sets it to the calculated default for the
platform. An easy way to test this is to do 'make defconfig' on
x86-64, set CONFIG_HPET_EMULATE_RTC=n in the generated .config, and
run 'make olddefconfig'. Without this patch, olddefconfig will ignore
the set option and overwrite it with CONFIG_HPET_EMULATE_RTC=y.

Or, tested on 5.12:
~/linux-stable % make defconfig
... SNIP
#
# configuration written to .config
#
~/linux-stable % grep CONFIG_HPET_EMULATE_RTC .config
CONFIG_HPET_EMULATE_RTC=y
~/linux-stable % sed -i 's/EMULATE_RTC=y/EMULATE_RTC=n/g' .config
~/linux-stable % grep CONFIG_HPET_EMULATE_RTC .config
CONFIG_HPET_EMULATE_RTC=n
~/linux-stable % make olddefconfig
#
# configuration written to .config
#
~/linux-stable % grep CONFIG_HPET_EMULATE_RTC .config
CONFIG_HPET_EMULATE_RTC=y

With this patch, the 'make olddefconfig' results in:
~/linux-stable % grep CONFIG_HPET_EMULATE_RTC .config
# CONFIG_HPET_EMULATE_RTC is not set

So, part of the why is that this enables the use of olddefconfig with
the CONFIG_HPET_EMULATE_RTC option. The other part of why is that my
team uses 'make olddefconfig' by providing a base config and then
using olddefconfig to fill in the unset values with defaults to make a
complete config file for a kernel build. I'd like to disable RTC
emulation on a particular platform, but I can't use a config option to
do it without this patch because 'make olddefconfig' will just ignore
the option.

Debugging why this was the case, I discovered the kconfig tools
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/kconfig/symbol.c#n379)
ignore set values if the option is not visible. Why this is the case,
I don't know. But it looks like in order to have kconfig respect the
config value, it must be visible.

>
> Thanks,
>
>         tglx




--
Anand K. Mistry
Software Engineer
Google Australia

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ