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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 8 Aug 2017 10:28:03 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:     Prarit Bhargava <prarit@...hat.com>,
        John Stultz <john.stultz@...aro.org>,
        lkml <linux-kernel@...r.kernel.org>,
        Mark Salyzyn <salyzyn@...roid.com>,
        Jonathan Corbet <corbet@....net>,
        Petr Mladek <pmladek@...e.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Stephen Boyd <sboyd@...eaurora.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Christoffer Dall <cdall@...aro.org>,
        Deepa Dinamani <deepa.kernel@...il.com>,
        Ingo Molnar <mingo@...nel.org>,
        Joel Fernandes <joelaf@...gle.com>,
        Kees Cook <keescook@...omium.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        "Luis R. Rodriguez" <mcgrof@...nel.org>,
        Nicholas Piggin <npiggin@...il.com>,
        "Jason A. Donenfeld" <Jason@...c4.com>,
        Olof Johansson <olof@...om.net>,
        Josh Poimboeuf <jpoimboe@...hat.com>, linux-doc@...r.kernel.org
Subject: Re: [PATCH v4] printk: Add monotonic, boottime, and realtime
 timestamps

On Mon, Aug 07, 2017 at 01:36:39PM -0700, Paul E. McKenney wrote:
> On Mon, Aug 07, 2017 at 04:06:09PM -0400, Prarit Bhargava wrote:

> > peterz?  Want to offer a suggestion?  The issue is that I'm changing a bool
> > config option to an int and that impacts all the arch's defconfigs.  John points
> > out that this is a lot of churn and we're both wondering if there's a better way
> > to do the configs.
> 
> The usual approach is to keep the old bool Kconfig option, and add another
> int Kconfig option that depends on the original one.  The tests for
> the int value get a bit more complex, but one way to handle this is to
> define a cpp macro something like the following:
> 
> #ifdef CONFIG_OLD_OPTION
> #define CPP_NEW_OPTION 0
> #else
> #define CPP_NEW_OPTION CONFIG_NEW_OPTION
> #endif
> 
> Then use CPP_NEW_OPTION, where zero means disabled and other numbers
> select the available options.
> 
> Adjust to suit depending on what values mean what.
> 
> Another approach is to make the range of the new Kconfig option
> depend on the old option:
> 
> config NEW_OPTION
> 	int "your description here"
> 	range 1 5 if OLD_OPTION
> 	range 0 0 if !OLD_OPTION
> 	default 0
> 	help
> 	  your help here
> 
> Again, adjust to suit depending on what values mean what.

Right this. Except I don't see the !OLD_OPTION working as expected.
A 'new' config will not include the old one, so the !OLD_OPTION thing
will 'always' be true.

So your:

> @@ -1,8 +1,46 @@
>  menu "printk and dmesg options"
>
> +choice
> +       prompt "printk default clock"
> +       config PRINTK_TIME_DISABLE
> +       bool "Disabled"
> +       help
> +        Selecting this option disables the time stamps of printk().
> +
> +       config PRINTK_TIME_LOCAL
> +       bool "Local Clock"
> +       help
> +         Selecting this option causes the time stamps of printk() to be
> +         stamped with the unadjusted hardware clock.
> +
> +       config PRINTK_TIME_BOOT
> +       bool "CLOCK_BOOTTIME"
> +       help
> +         Selecting this option causes the time stamps of printk() to be
> +         stamped with the adjusted boottime clock.
> +
> +       config PRINTK_TIME_MONO
> +       bool "CLOCK_MONOTONIC"
> +       help
> +         Selecting this option causes the time stamps of printk() to be
> +         stamped with the adjusted monotonic clock.
> +
> +       config PRINTK_TIME_REAL
> +       bool "CLOCK_REALTIME"
> +       help
> +         Selecting this option causes the time stamps of printk() to be
> +         stamped with the adjusted realtime clock.
> +
> +endchoice
> +
>  config PRINTK_TIME

Change that into something like:

config PRINTK_CLOCK


> -       bool "Show timing information on printks"
> +       int "Show time stamp information on printks"
>         depends on PRINTK
> +       default 0 if PRINTK_TIME_DISABLE
> +       default 1 if PRINTK_TIME_LOCAL

And that into:

	default 1 if PRINTK_TIME_LOCAL || PRINTK_TIME

> +       default 2 if PRINTK_TIME_BOOT
> +       default 3 if PRINTK_TIME_MONO
> +       default 4 if PRINTK_TIME_REAL
>	  help
>	    Selecting this option causes time stamps of the printk()

Then the old PRINTK_TIME symbol will auto-convert into the new
equivalent.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ