Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-25 Thread Joe Perches
On Wed, 2014-06-25 at 10:34 +0200, Mathias Krause wrote: > On 25 June 2014 09:48, Joe Perches wrote: > > On Wed, 2014-06-25 at 09:35 +0200, Rasmus Villemoes wrote: > >> Speaking of dangling pointers: A similar disaster would happen if some > >> code containing pi_* calls gets copy-pasted to some n

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-25 Thread Mathias Krause
On 25 June 2014 09:48, Joe Perches wrote: > On Wed, 2014-06-25 at 09:35 +0200, Rasmus Villemoes wrote: >> Speaking of dangling pointers: A similar disaster would happen if some >> code containing pi_* calls gets copy-pasted to some non-__init >> function. > > This is my biggest issue with adding t

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-25 Thread Mathias Krause
On 25 June 2014 09:35, Rasmus Villemoes wrote: > Mathias Krause writes: > >> On 24 June 2014 16:31, Rasmus Villemoes wrote: >>> gcc already seems to contain infrastructure for this kind of thing, so >>> maybe it doesn't even require a plugin, but simply a little coordination >>> with the gcc fol

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-25 Thread Joe Perches
On Wed, 2014-06-25 at 09:35 +0200, Rasmus Villemoes wrote: > yes, the source would need > to be annotated some way or other, or gcc would need to learn the > semantics of certain kernel functions. > > Speaking of dangling pointers: A similar disaster would happen if some > code containing pi_* ca

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-25 Thread Rasmus Villemoes
Mathias Krause writes: > On 24 June 2014 16:31, Rasmus Villemoes wrote: >> gcc already seems to contain infrastructure for this kind of thing, so >> maybe it doesn't even require a plugin, but simply a little coordination >> with the gcc folks. This snippet from gcc internals seems relevant: >>

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Mathias Krause
On 24 June 2014 23:45, Joe Perches wrote: > On Tue, 2014-06-24 at 23:06 +0200, Mathias Krause wrote: >> On 24 June 2014 22:57, Joe Perches wrote: >> > On Tue, 2014-06-24 at 22:41 +0200, Mathias Krause wrote: >> >> And all of those strings should be in the .rodata section, now. But >> >> why you'r

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Joe Perches
On Tue, 2014-06-24 at 23:06 +0200, Mathias Krause wrote: > On 24 June 2014 22:57, Joe Perches wrote: > > On Tue, 2014-06-24 at 22:41 +0200, Mathias Krause wrote: > >> And all of those strings should be in the .rodata section, now. But > >> why you're asking? > > Because now they will be duplicated

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Mathias Krause
On 24 June 2014 22:57, Joe Perches wrote: > On Tue, 2014-06-24 at 22:41 +0200, Mathias Krause wrote: >> there is more to optimize >> if one is patient enough ;) > > Ever thus. > >> And all of those strings should be in the .rodata section, now. But >> why you're asking? > > Because now they will b

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Joe Perches
On Tue, 2014-06-24 at 22:41 +0200, Mathias Krause wrote: > there is more to optimize > if one is patient enough ;) Ever thus. > And all of those strings should be in the .rodata section, now. But > why you're asking? Because now they will be duplicated in .rodata and the __init section no? > Ye

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Joe Perches
On Tue, 2014-06-24 at 22:10 +0200, Mathias Krause wrote: > I would like to handle the easy ones, too. E.g. strings used in > parameter parsing, i.e. strcmp()s. Sure, but that change is separable from printk conversions. Any idea how much would be changed treewide and whether or not those strings

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Mathias Krause
On 24 June 2014 22:30, Joe Perches wrote: > On Tue, 2014-06-24 at 22:10 +0200, Mathias Krause wrote: >> I would like to handle the easy ones, too. E.g. strings used in >> parameter parsing, i.e. strcmp()s. > > Sure, but that change is separable from printk conversions. Yes. Those need to be marke

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Mathias Krause
On 24 June 2014 21:37, Joe Perches wrote: > On Tue, 2014-06-24 at 21:13 +0200, Mathias Krause wrote: >> I don't think it's that easy. You cannot simply put all strings into >> the .init.rodata section when code currently gets emitted to >> .init.text. The reason is because strings used in __init c

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Joe Perches
On Tue, 2014-06-24 at 21:13 +0200, Mathias Krause wrote: > On 24 June 2014 16:31, Rasmus Villemoes wrote: [] > > gcc already seems to contain infrastructure for this kind of thing, so > > maybe it doesn't even require a plugin, but simply a little coordination > > with the gcc folks. This snippet

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Mathias Krause
On 24 June 2014 16:31, Rasmus Villemoes wrote: > Joe Perches writes: > >> On Mon, 2014-06-23 at 08:23 +0200, Mathias Krause wrote: >>> On 23 June 2014 00:56, Joe Perches wrote: >>> > On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote: >>> >> [...] patch 2 adds some syntactical sugar for the

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-24 Thread Rasmus Villemoes
Joe Perches writes: > On Mon, 2014-06-23 at 08:23 +0200, Mathias Krause wrote: >> On 23 June 2014 00:56, Joe Perches wrote: >> > On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote: >> >> [...] patch 2 adds some syntactical sugar for the most popular use >> >> case, by providing pr_ alike ma

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-22 Thread Joe Perches
On Mon, 2014-06-23 at 08:23 +0200, Mathias Krause wrote: > On 23 June 2014 00:56, Joe Perches wrote: > > On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote: > >> [...] patch 2 adds some syntactical sugar for the most popular use > >> case, by providing pr_ alike macros, namely pi_ for __init

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-22 Thread Mathias Krause
On 23 June 2014 03:30, Joe Perches wrote: > On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote: >> This RFC series tries to address the problem of dangling strings of >> __init functions after initialization, as well as __exit strings for >> code not even included in the final kernel image. T

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-22 Thread Mathias Krause
On 23 June 2014 00:56, Joe Perches wrote: > On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote: >> [...] patch 2 adds some syntactical sugar for the most popular use >> case, by providing pr_ alike macros, namely pi_ for __init >> code and pe_ for __exit code. This hides the use of the marker

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-22 Thread Joe Perches
On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote: > This RFC series tries to address the problem of dangling strings of > __init functions after initialization, as well as __exit strings for > code not even included in the final kernel image. The code might get > freed, but the format string

Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-22 Thread Joe Perches
On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote: > This RFC series tries to address the problem of dangling strings of > __init functions after initialization, as well as __exit strings for > code not even included in the final kernel image. The code might get > freed, but the format string

[RFC PATCH 0/3] Mark literal strings in __init / __exit code

2014-06-22 Thread Mathias Krause
This RFC series tries to address the problem of dangling strings of __init functions after initialization, as well as __exit strings for code not even included in the final kernel image. The code might get freed, but the format strings are not. One solution to the problem might be to declare varia