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, 26 Feb 2024 16:11:05 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>, 
	Jiaxun Yang <jiaxun.yang@...goat.com>, Andrew Morton <akpm@...ux-foundation.org>, 
	Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>, linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] mips: cm: Convert __mips_cm_l2sync_phys_base() to
 weak function

On Mon, Feb 26, 2024 at 01:29:54PM +0100, Arnd Bergmann wrote:
> On Mon, Feb 26, 2024, at 13:20, Serge Semin wrote:
> > On Mon, Feb 26, 2024 at 01:04:33PM +0100, Arnd Bergmann wrote:
> >> On Mon, Feb 26, 2024, at 12:27, Serge Semin wrote:
> 
> > I see your point now. Thanks for clarification. IMO it would be less
> > readable due to the ifdef-ery and the new config, and less
> > maintainable due to the conditional compilation, but would provide a
> > more performant solution since the compiler will be able to inline the
> > singly used static method. Basically you suggest to emulate the weak
> > implementation by an additional kernel config.
> 
> I mean the kernel config that you already need here, since
> the strong version of the function is already optional.

Why would I need it if after this patch is applied the
mips_cm_l2sync_phys_base() method will be converted to a global weak
implementation?

> 
> > Not sure whether it would be better than a well-known
> > weak-attribute-based pattern. Anyway let's wait for the
> > Thomas' opinion about your suggestion. If he thinks
> > it would be better I'll update the patches.
> 
> Weak functions are not used all that much outside of a
> couple of parts of the kernel. There is a lot of them
> in drivers/pci/, a little bit in acpi and efi, and
> then a bit in arch/*/, though most of that is in mips.

+ a lot of them in kernel/*, some in mm/* .)

> 
> Ifdef checks in .c files are not great, but at least they
> are much more common than __weak functions and self-documenting.

Ok. I don't have concretely strong opinion about what is better. Let's
wait for what Thomas thinks about this.

-Serge(y)

> 
>      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ