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:   Tue, 30 Nov 2021 16:26:39 -0800
From:   Joe Perches <joe@...ches.com>
To:     Steve Wahl <steve.wahl@....com>,
        Colin Ian King <colin.i.king@...glemail.com>
Cc:     Mike Travis <mike.travis@....com>,
        Dimitri Sivanich <dimitri.sivanich@....com>,
        Russ Anderson <russ.anderson@....com>,
        Darren Hart <dvhart@...radead.org>,
        Andy Shevchenko <andy@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H . Peter Anvin" <hpa@...or.com>,
        platform-driver-x86@...r.kernel.org,
        kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/platform/uv: make const pointer dots a static const
 array

On Tue, 2021-11-30 at 13:34 -0600, Steve Wahl wrote:
> On Sat, Nov 27, 2021 at 05:03:20PM +0000, Colin Ian King wrote:
> > Don't populate the const array dots on the stack
[]
> Examination of the disassembly shows that the compiler actually
> eliminates the creation of the pointer "dots" on the stack and just
> passes the address of the string constant to the printk function.
> 
> So this change should not have any actual effect (I don't know where
> you got the "shrinks object code" from), and in my humble opinion
> makes the code less clear.

Probably shrinks an allmodconfig where the symbols are referenced.
It probably doesn't do anything to a defconfig.

> As such, unless there's something here I don't understand, I vote to
> reject this patch.
[]
> > but make it static
> > const and make the pointer an array to remove a dereference. Shrinks
> > object code a few bytes too.
[]
> > diff --git a/arch/x86/platform/uv/uv_nmi.c b/arch/x86/platform/uv/uv_nmi.c
[]
> > @@ -725,7 +725,7 @@ static void uv_nmi_dump_cpu_ip(int cpu, struct pt_regs *regs)
> >   */
> >  static void uv_nmi_dump_state_cpu(int cpu, struct pt_regs *regs)
> >  {
> > -	const char *dots = " ................................. ";
> > +	static const char dots[] = " ................................. ";


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ