<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/module.c, branch v2.6.37</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.37</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.37'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2010-11-11T03:19:24Z</updated>
<entry>
<title>tracing: Fix module use of trace_bprintk()</title>
<updated>2010-11-11T03:19:24Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2010-11-11T03:19:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=13b9b6e746d753d43270a78dd39694912646b5d9'/>
<id>urn:sha1:13b9b6e746d753d43270a78dd39694912646b5d9</id>
<content type='text'>
On use of trace_printk() there's a macro that determines if the format
is static or a variable. If it is static, it defaults to __trace_bprintk()
otherwise it uses __trace_printk().

A while ago, Lai Jiangshan added __trace_bprintk(). In that patch, we
discussed a way to allow modules to use it. The difference between
__trace_bprintk() and __trace_printk() is that for faster processing,
just the format and args are stored in the trace instead of running
it through a sprintf function. In order to do this, the format used
by the __trace_bprintk() had to be persistent.

See commit 1ba28e02a18cbdbea123836f6c98efb09cbf59ec

The problem comes with trace_bprintk() where the module is unloaded.
The pointer left in the buffer is still pointing to the format.

To solve this issue, the formats in the module were copied into kernel
core. If the same format was used, they would use the same copy (to prevent
memory leak). This all worked well until we tried to merge everything.

At the time this was written, Lai Jiangshan, Frederic Weisbecker,
Ingo Molnar and myself were all touching the same code. When this was
merged, we lost the part of it that was in module.c. This kept out the
copying of the formats and unloading the module could cause bad pointers
left in the ring buffer.

This patch adds back (with updates required for current kernel) the
module code that sets up the necessary pointers.

Cc: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>(trivial) Fix compiler warning in kernel/modules.c</title>
<updated>2010-10-27T10:03:05Z</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2010-09-19T23:58:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=abbce906d05ec37289cd0c3b4e35b2db26eab19b'/>
<id>urn:sha1:abbce906d05ec37289cd0c3b4e35b2db26eab19b</id>
<content type='text'>
Building with CONFIG_KALLSYMS=n gives following warning:

/mnt/src/linux-git/kernel/module.c: In function ‘post_relocation’:
/mnt/src/linux-git/kernel/module.c:2534:2: warning: passing argument 2 of ‘add_kallsyms’ discards qualifiers from pointer target type
/mnt/src/linux-git/kernel/module.c:2038:13: note: expected ‘struct load_info *’ but argument is of type ‘const struct load_info *’

Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>Merge commit 'v2.6.36-rc7' into perf/core</title>
<updated>2010-10-08T08:46:27Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2010-10-08T08:46:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7cd2541cf2395962daf98ec32a141aba3398a9b2'/>
<id>urn:sha1:7cd2541cf2395962daf98ec32a141aba3398a9b2</id>
<content type='text'>
Conflicts:
	arch/x86/kernel/module.c

Merge reason: Resolve the conflict, pick up fixes.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>modules: Fix module_bug_list list corruption race</title>
<updated>2010-10-05T18:29:27Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-10-05T18:29:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5336377d6225959624146629ce3fc88ee8ecda3d'/>
<id>urn:sha1:5336377d6225959624146629ce3fc88ee8ecda3d</id>
<content type='text'>
With all the recent module loading cleanups, we've minimized the code
that sits under module_mutex, fixing various deadlocks and making it
possible to do most of the module loading in parallel.

However, that whole conversion totally missed the rather obscure code
that adds a new module to the list for BUG() handling.  That code was
doubly obscure because (a) the code itself lives in lib/bugs.c (for
dubious reasons) and (b) it gets called from the architecture-specific
"module_finalize()" rather than from generic code.

Calling it from arch-specific code makes no sense what-so-ever to begin
with, and is now actively wrong since that code isn't protected by the
module loading lock any more.

So this commit moves the "module_bug_{finalize,cleanup}()" calls away
from the arch-specific code, and into the generic code - and in the
process protects it with the module_mutex so that the list operations
are now safe.

Future fixups:
 - move the module list handling code into kernel/module.c where it
   belongs.
 - get rid of 'module_bug_list' and just use the regular list of modules
   (called 'modules' - imagine that) that we already create and maintain
   for other reasons.

Reported-and-tested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Adrian Bunk &lt;bunk@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>jump label: Base patch for jump label</title>
<updated>2010-09-22T20:29:41Z</updated>
<author>
<name>Jason Baron</name>
<email>jbaron@redhat.com</email>
</author>
<published>2010-09-17T15:09:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bf5438fca2950b03c21ad868090cc1a8fcd49536'/>
<id>urn:sha1:bf5438fca2950b03c21ad868090cc1a8fcd49536</id>
<content type='text'>
base patch to implement 'jump labeling'. Based on a new 'asm goto' inline
assembly gcc mechanism, we can now branch to labels from an 'asm goto'
statment. This allows us to create a 'no-op' fastpath, which can subsequently
be patched with a jump to the slowpath code. This is useful for code which
might be rarely used, but which we'd like to be able to call, if needed.
Tracepoints are the current usecase that these are being implemented for.

Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
LKML-Reference: &lt;ee8b3595967989fdaf84e698dc7447d315ce972a.1284733808.git.jbaron@redhat.com&gt;

[ cleaned up some formating ]

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>module: cleanup comments, remove noinline</title>
<updated>2010-08-05T03:29:13Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2010-08-05T18:59:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=51f3d0f474aaebbc253100fa32a49c8256812330'/>
<id>urn:sha1:51f3d0f474aaebbc253100fa32a49c8256812330</id>
<content type='text'>
On my (32-bit x86) machine, sys_init_module() uses 124 bytes of stack
once load_module() is inlined.

This effectively reverts ffb4ba76 which inlined it due to stack
pressure.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: group post-relocation functions into post_relocation()</title>
<updated>2010-08-05T03:29:13Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2010-08-05T18:59:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=811d66a0e1e99902d365497eec7884113a2665bd'/>
<id>urn:sha1:811d66a0e1e99902d365497eec7884113a2665bd</id>
<content type='text'>
This simply hoists more code out of load_module; we also put the
identification of the extable and dynamic debug table in with the
others in find_module_sections().

We move the taint check to the actual add/remove of the dynamic debug
info: this is certain (find_module_sections is too early).

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Yehuda Sadeh &lt;yehuda@hq.newdream.net&gt;
</content>
</entry>
<entry>
<title>module: move module args strndup_user to just before use</title>
<updated>2010-08-05T03:29:12Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2010-08-05T18:59:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6526c534b2677ca601b7b92851437feb041d02a1'/>
<id>urn:sha1:6526c534b2677ca601b7b92851437feb041d02a1</id>
<content type='text'>
Instead of copying and allocating the args and storing it in
load_info, we can just allocate them right before we need them.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: pass load_info into other functions</title>
<updated>2010-08-05T03:29:10Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2010-08-05T18:59:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=49668688dd5a5f46c72f965835388ed16c596055'/>
<id>urn:sha1:49668688dd5a5f46c72f965835388ed16c596055</id>
<content type='text'>
Pass the struct load_info into all the other functions in module
loading.  This neatens things and makes them more consistent.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: fix sysfs cleanup for !CONFIG_SYSFS</title>
<updated>2010-08-05T03:29:10Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2010-08-05T18:59:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=36b0360d17dc3928cc96347a18a3a1cdbb7e506d'/>
<id>urn:sha1:36b0360d17dc3928cc96347a18a3a1cdbb7e506d</id>
<content type='text'>
Restore the stub module_remove_modinfo_attrs, remove the now-unused
!CONFIG_SYSFS module_sysfs_init.

Also, rename mod_kobject_remove() to mod_sysfs_teardown() as
it is the logical counterpart to mod_sysfs_setup now.

Reported-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
</feed>
