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:	Fri, 24 Jun 2011 12:05:31 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Jonas Bonn <jonas@...thpole.se>
Cc:	Valdis.Kletnieks@...edu, linux-kernel@...r.kernel.org,
	linux-arch@...r.kernel.org, Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH 14/19] OpenRISC: Module support

On Friday 24 June 2011, Jonas Bonn wrote:
> On Wed, 2011-06-22 at 16:26 +0200, Arnd Bergmann wrote:
> > I think that an easy way to do that would be to add to kernel/module.c
> > code like:
> > 
> > #ifndef module_alloc
> > void *module_alloc(unsigned long size)
> > {
> >       return vmalloc(size);
> > }
> > #endif
> > 
> 
> I noticed that kernel/module.c already has this:
> 
> unsigned int __weak arch_mod_section_prepend(struct module *mod,
>                                              unsigned int section)
> 
>
> Is using a __weak attribute on the default (generic) implementations a
> better approach?

I normally don't like using __weak, because it more easily confuses
readers about which version is actually used.

> > Then each architecture that needs a special version can do
> > #define module_alloc(size) module_alloc(size)
> > in their respective asm/module.h
> 
> With the __weak variant this wouldn't be necessary...

Correct. I certainly wouldn't want to see both methods mixed in the
same file. Rusty is maintaining the module loader, maybe he has
a preference.

Rusty, we were discussing the fact that most module loader files
are providing very similar (mostly empty) functions, and that it would
be nice if the new openrisc architecture would only have to provide
apply_relocate_add(), which is actually arch specific, while it could
be changed to use the defaults for everything else.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists