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: <Ztg3pFoYERN4GuWf@pathway.suse.cz>
Date: Wed, 4 Sep 2024 12:34:12 +0200
From: Petr Mladek <pmladek@...e.com>
To: John Ogness <john.ogness@...utronix.de>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Sebastian Siewior <bigeasy@...utronix.de>
Subject: Re: [PATCH printk v8 31/35] printk: nbcon: Implement emergency
 sections

On Tue 2024-08-27 16:25:31, John Ogness wrote:
> Hi Petr,
> 
> On 2024-08-20, John Ogness <john.ogness@...utronix.de> wrote:
> > +static __ref unsigned int *nbcon_get_cpu_emergency_nesting(void)
> > +{
> > +	/*
> > +	 * The value of __printk_percpu_data_ready gets set in normal
> > +	 * context and before SMP initialization. As a result it could
> > +	 * never change while inside an nbcon emergency section.
> > +	 */
> > +	if (!printk_percpu_data_ready())
> > +		return &early_nbcon_pcpu_emergency_nesting;
> > +
> > +	/* Open code this_cpu_ptr() without checking migration. */
> > +	return per_cpu_ptr(&nbcon_pcpu_emergency_nesting, raw_smp_processor_id());
> > +}
> 
> It was pointed out to me that raw_cpu_ptr() exists exactly for this
> purpose. There is no need to open code it.

Good to know!

> ------------8<--------------
> >From fe50e9646c44360d88749c2c24c109405b27ad9e Mon Sep 17 00:00:00 2001
> From: John Ogness <john.ogness@...utronix.de>
> Date: Tue, 27 Aug 2024 14:06:19 +0000
> Subject: [PATCH] printk: nbcon: Use raw_cpu_ptr() instead of open coding
> 
> There is no need to open code a non-migration-checking
> this_cpu_ptr(). That is exactly what raw_cpu_ptr() is.
> 
> Signed-off-by: John Ogness <john.ogness@...utronix.de>

Reviewed-by: Petr Mladek <pmladek@...e.com>

I wanted to avoid rebase when it was not really necessary. So, I have
committed the patch into printk/linux.git, branch rework/write_atomic
on top of the existing patches.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ