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]
Date: Mon, 29 Jan 2024 12:28:13 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: Yoann Congal <yoann.congal@...le.fr>, x86@...nel.org,
 linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
 linux-fsdevel@...r.kernel.org
Cc: linux-kbuild@...r.kernel.org, Geert Uytterhoeven <geert@...ux-m68k.org>,
 "Luis R . Rodriguez" <mcgrof@...nel.org>,
 Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
 Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
 "H. Peter Anvin" <hpa@...or.com>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Willem de Bruijn <willemdebruijn.kernel@...il.com>,
 Matthew Wilcox <willy@...radead.org>, Peter Zijlstra <peterz@...radead.org>,
 Darren Hart <dvhart@...radead.org>, Davidlohr Bueso <dave@...olabs.net>,
 André Almeida <andrealmeid@...lia.com>,
 Masahiro Yamada <masahiroy@...nel.org>
Subject: Re: [PATCH v2] printk: Remove redundant CONFIG_BASE_SMALL

On 27. 01. 24, 23:00, Yoann Congal wrote:
> CONFIG_BASE_SMALL is currently a type int but is only used as a boolean
> equivalent to !CONFIG_BASE_FULL.
> 
> So, remove it entirely and move every usage to !CONFIG_BASE_FULL.
> 
> In addition, recent kconfig changes (see the discussion in Closes: tag)
> revealed that using:
>    config SOMETHING
>       default "some value" if X
> does not work as expected if X is not of type bool.
> 
> CONFIG_BASE_SMALL was used that way in init/Kconfig:
>    config LOG_CPU_MAX_BUF_SHIFT
>    	default 12 if !BASE_SMALL
>    	default 0 if BASE_SMALL
> 
> Note: This changes CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 to
> CONFIG_LOG_CPU_MAX_BUF_SHIFT=0 for some defconfigs, but that will not be
> a big impact due to this code in kernel/printk/printk.c:
>    /* by default this will only continue through for large > 64 CPUs */
>    if (cpu_extra <= __LOG_BUF_LEN / 2)
>            return;
> 
> Signed-off-by: Yoann Congal <yoann.congal@...le.fr>
> Reported-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> Closes: https://lore.kernel.org/all/CAMuHMdWm6u1wX7efZQf=2XUAHascps76YQac6rdnQGhc8nop_Q@mail.gmail.com/
> Fixes: 4e244c10eab3 ("kconfig: remove unneeded symbol_empty variable")
> ---
> v1 patch was named "treewide: Change CONFIG_BASE_SMALL to bool type"
> https://lore.kernel.org/all/20240126163032.1613731-1-yoann.congal@smile.fr/
> 
> v1 -> v2: Applied Masahiro Yamada's comments (Thanks!):
> * Changed from "Change CONFIG_BASE_SMALL to type bool" to
>    "Remove it and switch usage to !CONFIG_BASE_FULL"
> * Fixed "Fixes:" tag and reference to the mailing list thread.
> * Added a note about CONFIG_LOG_CPU_MAX_BUF_SHIFT changing.
..
> --- a/drivers/tty/vt/vc_screen.c
> +++ b/drivers/tty/vt/vc_screen.c
> @@ -51,7 +51,7 @@
>   #include <asm/unaligned.h>
>   
>   #define HEADER_SIZE	4u
> -#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE)
> +#define CON_BUF_SIZE (IS_ENABLED(CONFIG_BASE_FULL) ? PAGE_SIZE : 256)

Why is the IS_ENABLED() addition needed? You don't say anything about 
that in the commit log.

thanks,
-- 
js
suse labs


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ