<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/module.h, branch v3.0.85</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.85</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.85'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2011-05-19T07:25:27Z</updated>
<entry>
<title>module: Sort exported symbols</title>
<updated>2011-05-19T07:25:27Z</updated>
<author>
<name>Alessio Igor Bogani</name>
<email>abogani@kernel.org</email>
</author>
<published>2011-04-14T12:59:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f02e8a6596b7dc9b2171f7ff5654039ef0950cdc'/>
<id>urn:sha1:f02e8a6596b7dc9b2171f7ff5654039ef0950cdc</id>
<content type='text'>
This patch places every exported symbol in its own section
(i.e. "___ksymtab+printk").  Thus the linker will use its SORT() directive
to sort and finally merge all symbol in the right and final section
(i.e. "__ksymtab").

The symbol prefixed archs use an underscore as prefix for symbols.
To avoid collision we use a different character to create the temporary
section names.

This work was supported by a hardware donation from the CE Linux Forum.

Signed-off-by: Alessio Igor Bogani &lt;abogani@kernel.org&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt; (folded in '+' fixup)
Tested-by: Dirk Behme &lt;dirk.behme@googlemail.com&gt;
</content>
</entry>
<entry>
<title>module: each_symbol_section instead of each_symbol</title>
<updated>2011-05-19T07:25:26Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2011-04-19T19:49:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=de4d8d53465483168d6a627d409ee2d09d8e3308'/>
<id>urn:sha1:de4d8d53465483168d6a627d409ee2d09d8e3308</id>
<content type='text'>
Instead of having a callback function for each symbol in the kernel,
have a callback for each array of symbols.

This eases the logic when we move to sorted symbols and binary search.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Alessio Igor Bogani &lt;abogani@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: remove 64 bit alignment padding from struct module with CONFIG_TRACE*</title>
<updated>2011-05-19T07:25:25Z</updated>
<author>
<name>Richard Kennedy</name>
<email>richard@rsk.demon.co.uk</email>
</author>
<published>2011-05-19T22:55:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a288bd651f4180c224cfddf837a0416157a36661'/>
<id>urn:sha1:a288bd651f4180c224cfddf837a0416157a36661</id>
<content type='text'>
Reorder struct module to remove 24 bytes of alignment padding on 64 bit
builds when the CONFIG_TRACE options are selected. This allows the
structure to fit into one fewer cache lines, and its size drops from 592
to 568 on x86_64.

Signed-off-by: Richard Kennedy &lt;richard@rsk.demon.co.uk&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: do not hide __modver_version_show declaration behind ifdef</title>
<updated>2011-05-19T07:25:25Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor@vmware.com</email>
</author>
<published>2011-02-08T00:02:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9b73a5840c7d5f77e5766626716df13787cb258c'/>
<id>urn:sha1:9b73a5840c7d5f77e5766626716df13787cb258c</id>
<content type='text'>
Doing so prevents the following warning from sparse:

  CHECK   kernel/params.c
kernel/params.c:817:9: warning: symbol '__modver_version_show' was not
declared. Should it be static?

since kernel/params.c is never compiled with MODULE being set.

Signed-off-by: Dmitry Torokhov &lt;dtor@vmware.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: deal with alignment issues in built-in module versions</title>
<updated>2011-05-19T07:25:24Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor@vmware.com</email>
</author>
<published>2011-02-08T00:02:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b4bc842802db3314f9a657094da0450a903ea619'/>
<id>urn:sha1:b4bc842802db3314f9a657094da0450a903ea619</id>
<content type='text'>
On m68k natural alignment is 2-byte boundary but we are trying to
align structures in __modver section on sizeof(void *) boundary.
This causes trouble when we try to access elements in this section
in array-like fashion when create "version" attributes for built-in
modules.

Moreover, as DaveM said, we can't reliably put structures into
independent objects, put them into a special section, and then expect
array access over them (via the section boundaries) after linking the
objects together to just "work" due to variable alignment choices in
different situations. The only solution that seems to work reliably
is to make an array of plain pointers to the objects in question and
put those pointers in the special section.

Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@vmware.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: explicitly align module_version_attribute structure</title>
<updated>2011-02-21T23:21:53Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor@vmware.com</email>
</author>
<published>2011-02-04T21:30:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=98562ad8cb03fa6b7ba7f50168cdb34a98abcc1d'/>
<id>urn:sha1:98562ad8cb03fa6b7ba7f50168cdb34a98abcc1d</id>
<content type='text'>
We force particular alignment when we generate attribute structures
when generation MODULE_VERSION() data and we need to make sure that
this alignment is followed when we iterate over these structures,
otherwise we may crash on platforms whose natural alignment is not
sizeof(void *), such as m68k.

Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@vmware.com&gt;
[ There are more issues here, but the fixes are incredibly ugly - Linus ]
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tracepoints: Fix section alignment using pointer array</title>
<updated>2011-02-03T14:28:46Z</updated>
<author>
<name>Mathieu Desnoyers</name>
<email>mathieu.desnoyers@efficios.com</email>
</author>
<published>2011-01-26T22:26:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=654986462939cd7ec18f276c6379a334dac106a7'/>
<id>urn:sha1:654986462939cd7ec18f276c6379a334dac106a7</id>
<content type='text'>
Make the tracepoints more robust, making them solid enough to handle compiler
changes by not relying on anything based on compiler-specific behavior with
respect to structure alignment. Implement an approach proposed by David Miller:
use an array of const pointers to refer to the individual structures, and export
this pointer array through the linker script rather than the structures per se.
It will consume 32 extra bytes per tracepoint (24 for structure padding and 8
for the pointers), but are less likely to break due to compiler changes.

History:

commit 7e066fb8 tracepoints: add DECLARE_TRACE() and DEFINE_TRACE()
added the aligned(32) type and variable attribute to the tracepoint structures
to deal with gcc happily aligning statically defined structures on 32-byte
multiples.

One attempt was to use a 8-byte alignment for tracepoint structures by applying
both the variable and type attribute to tracepoint structures definitions and
declarations. It worked fine with gcc 4.5.1, but broke with gcc 4.4.4 and 4.4.5.

The reason is that the "aligned" attribute only specify the _minimum_ alignment
for a structure, leaving both the compiler and the linker free to align on
larger multiples. Because tracepoint.c expects the structures to be placed as an
array within each section, up-alignment cause NULL-pointer exceptions due to the
extra unexpected padding.

(this patch applies on top of -tip)

Signed-off-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
LKML-Reference: &lt;20110126222622.GA10794@Krystal&gt;
CC: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
CC: Ingo Molnar &lt;mingo@elte.hu&gt;
CC: Thomas Gleixner &lt;tglx@linutronix.de&gt;
CC: Andrew Morton &lt;akpm@linux-foundation.org&gt;
CC: Peter Zijlstra &lt;peterz@infradead.org&gt;
CC: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Replace trace_event struct array with pointer array</title>
<updated>2011-02-03T02:37:13Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-01-27T14:15:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e4a9ea5ee7c8812a7bf0c3fb725ceeaa3d4c2fcc'/>
<id>urn:sha1:e4a9ea5ee7c8812a7bf0c3fb725ceeaa3d4c2fcc</id>
<content type='text'>
Currently the trace_event structures are placed in the _ftrace_events
section, and at link time, the linker makes one large array of all
the trace_event structures. On boot up, this array is read (much like
the initcall sections) and the events are processed.

The problem is that there is no guarantee that gcc will place complex
structures nicely together in an array format. Two structures in the
same file may be placed awkwardly, because gcc has no clue that they
are suppose to be in an array.

A hack was used previous to force the alignment to 4, to pack the
structures together. But this caused alignment issues with other
architectures (sparc).

Instead of packing the structures into an array, the structures' addresses
are now put into the _ftrace_event section. As pointers are always the
natural alignment, gcc should always pack them tightly together
(otherwise initcall, extable, etc would also fail).

By having the pointers to the structures in the section, we can still
iterate the trace_events without causing unnecessary alignment problems
with other architectures, or depending on the current behaviour of
gcc that will likely change in the future just to tick us kernel developers
off a little more.

The _ftrace_event section is also moved into the .init.data section
as it is now only needed at boot up.

Suggested-by: David Miller &lt;davem@davemloft.net&gt;
Cc: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>module: fix linker error for MODULE_VERSION when !MODULE and CONFIG_SYSFS=n</title>
<updated>2011-01-24T04:02:52Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2011-01-24T20:32:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3b90a5b292321b2acac3921f77046ae195aef53f'/>
<id>urn:sha1:3b90a5b292321b2acac3921f77046ae195aef53f</id>
<content type='text'>
lib/built-in.o:(__modver+0x8): undefined reference to `__modver_version_show'
lib/built-in.o:(__modver+0x2c): undefined reference to `__modver_version_show'

Simplest to just not emit anything: if they've disabled SYSFS they probably
want the smallest kernel possible.

Reported-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: show version information for built-in modules in sysfs</title>
<updated>2011-01-24T04:02:51Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor@vmware.com</email>
</author>
<published>2010-12-15T22:00:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e94965ed5beb23c6fabf7ed31f625e66d7ff28de'/>
<id>urn:sha1:e94965ed5beb23c6fabf7ed31f625e66d7ff28de</id>
<content type='text'>
Currently only drivers that are built as modules have their versions
shown in /sys/module/&lt;module_name&gt;/version, but this information might
also be useful for built-in drivers as well. This especially important
for drivers that do not define any parameters - such drivers, if
built-in, are completely invisible from userspace.

This patch changes MODULE_VERSION() macro so that in case when we are
compiling built-in module, version information is stored in a separate
section. Kernel then uses this data to create 'version' sysfs attribute
in the same fashion it creates attributes for module parameters.

Signed-off-by: Dmitry Torokhov &lt;dtor@vmware.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
</feed>
