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: <20191217103152.GB2914497@kroah.com>
Date:   Tue, 17 Dec 2019 11:31:52 +0100
From:   Greg KH <greg@...ah.com>
To:     "Enrico Weigelt, metux IT consult" <info@...ux.net>
Cc:     linux-kernel@...r.kernel.org, linus.walleij@...aro.org,
        bgolaszewski@...libre.com, dmitry.torokhov@...il.com,
        jacek.anaszewski@...il.com, pavel@....cz, dmurphy@...com,
        arnd@...db.de, masahiroy@...nel.org, michal.lkml@...kovi.net,
        kafai@...com, songliubraving@...com, yhs@...com, andriin@...com,
        linux-gpio@...r.kernel.org, linux-input@...r.kernel.org,
        linux-leds@...r.kernel.org, linux-arch@...r.kernel.org,
        linux-kbuild@...r.kernel.org, netdev@...r.kernel.org,
        bpf@...r.kernel.org
Subject: Re: [PATCH] RFC: platform driver registering via initcall tables

On Tue, Dec 17, 2019 at 11:22:19AM +0100, Enrico Weigelt, metux IT consult wrote:
> A large portion of platform drivers doesn't need their own init/exit
> functions. At source level, the boilerplate is already replaced by
> module_platform_driver() macro call, which creates this code under
> the hood. But in the binary, the code is still there.
> 
> This patch is an attempt to remove them it, by the same approach
> already used for the init functions: collect pointers to the driver
> structs in special sections, which are then processed by the init
> code which already calls the init function vectors. For each level,
> the structs are processed right after the init funcs, so we guarantee
> the existing order, and explicit inits always come before the automatic
> registering.

No, what is so "special" about platform drivers that they require this?

If anything, we should be moving _AWAY_ from platform drivers and use
real bus drivers instead.

> Downside of apprach: cluttering init code w/ a little bit knowledge
> about driver related stuff (calls to platform_driver_register(), etc).

Exactly, don't.

> For now, only implemented for the built-in case (modules still go the
> old route). The module case is a little bit trickier: either we have to
> extend the module header (and modpost tool) or do some dynamic symbol
> lookup.
> 
> This patch is just a PoC for further discussions, not ready for mainline.
> It also changes a few drivers, just for illustration. In case the general
> approach is accepted, it will be cleaned up and splitted.

Please no, I don't see why this is even needed.

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ