Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-15 Thread Sam Ravnborg
On Tue, May 15, 2007 at 05:36:40PM +0800, Li Yang-r58472 wrote:
> > -Original Message-
> > From: Kumar Gala [mailto:[EMAIL PROTECTED]
> > Sent: Monday, May 14, 2007 9:57 PM
> > To: Sam Ravnborg
> > Cc: Li Yang-r58472; Linus; Andrew Morton; Linux Kernel;
> [EMAIL PROTECTED]
> > Subject: Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning
> whitelist for
> > powerpc
> > 
> > 
> > On May 14, 2007, at 6:06 AM, Sam Ravnborg wrote:
> > 
> > > On Mon, May 14, 2007 at 06:53:32PM +0800, Li Yang wrote:
> > >> This patch fixes the following "Section mismatch" warnings when
> > >> build powerpc platforms.
> > >>
> > >> -
> > >> WARNING: arch/powerpc/mm/built-in.o - Section mismatch: reference
> to
> > >> .init.text:early_get_page from .text between
> > >> 'pte_alloc_one_kernel' (at
> > >> offset 0xc68) and 'pte_alloc_one'
> > >> WARNING: mm/built-in.o - Section mismatch: reference to
> > >> .init.text:set_up_list3s from .text between
> > >> 'kmem_cache_create' (at offset
> > >> 0x20300) and 'cache_reap'
> > >> -
> > 
> > This warnings should be handled by __init_refok instead.
> 
> Yes.  When __init_refok gets in, we can change all Pattern 9 members in
> the whitelist to use __init_refok.

I have applied the patch without the fixes for the above functions.
Will merge and push the __init_refok changes soonish.

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


Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-15 Thread Stephen Rothwell
On Tue, 15 May 2007 15:33:50 +0530 "Satyam Sharma" <[EMAIL PROTECTED]> wrote:
>
> But I have slightly different (reversed) semantics for __init_refok
> in mind. Basically, we use __init_refok to annotate _callees_
> and not _callers_. In short, __init_refok is a _type_ of __init
> section that other sections can freely reference to, without
> modpost complaining about this. [ had suggested this in some
> previous thread earlier ]

But lots of __init routines cannot be called from just anywhere, it is
the special circumstances of some of the callers that makes the call from
non-init to init ok.  So you need to mark the callers specially.

--
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgpsyugMr7JNc.pgp
Description: PGP signature


Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-15 Thread Satyam Sharma

On 5/15/07, Li Yang-r58472 <[EMAIL PROTECTED]> wrote:

> [...]
> Actually, once __init_refok comes in, would we need any other
> whitelisting mechanism at all? I think the exception patterns in
> secref_whitelist() and those two other whitelisting functions
> (init_section_ref_ok and exit_section_ref_ok) could all be
> subsumed and made redundant if / when __init_refok is used
> in the actual sources.

I don't think so.  __init_refok can be used to mark special functions
which are legitimate to reference .init.text/.init.data


But I have slightly different (reversed) semantics for __init_refok
in mind. Basically, we use __init_refok to annotate _callees_
and not _callers_. In short, __init_refok is a _type_ of __init
section that other sections can freely reference to, without
modpost complaining about this. [ had suggested this in some
previous thread earlier ]

The __init_refok-for-callees mechanism could be useful to
reduce duplication, having to mark lesser number of functions,
and also make most of those exception patterns in modpost.c
redundant.

Ultimately, we want modpost to shut up for some known false
positives. Currently we have 9 exception patterns, 'n' number
of special sections hard-coded in modpost.c, 3 whitelisting
functions and also the __init_refok thing that can be used
directly to mark functions in the sources. But modpost
doesn't really care _how_ a particular case got whitelisted.

Using _only_ the __init_refok (easily greppable in the sources)
annotation for callees could help keep all such special cases
manageable and in control, compared to several different ways
to dodge modpost warnings.


but cannot be used to mark special sections.


Yes, so mark the special _callees_ as __init_refok.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-15 Thread Li Yang-r58472
> -Original Message-
> From: Kumar Gala [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 14, 2007 9:57 PM
> To: Sam Ravnborg
> Cc: Li Yang-r58472; Linus; Andrew Morton; Linux Kernel;
[EMAIL PROTECTED]
> Subject: Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning
whitelist for
> powerpc
> 
> 
> On May 14, 2007, at 6:06 AM, Sam Ravnborg wrote:
> 
> > On Mon, May 14, 2007 at 06:53:32PM +0800, Li Yang wrote:
> >> This patch fixes the following "Section mismatch" warnings when
> >> build powerpc platforms.
> >>
> >> -
> >> WARNING: arch/powerpc/mm/built-in.o - Section mismatch: reference
to
> >> .init.text:early_get_page from .text between
> >> 'pte_alloc_one_kernel' (at
> >> offset 0xc68) and 'pte_alloc_one'
> >> WARNING: mm/built-in.o - Section mismatch: reference to
> >> .init.text:set_up_list3s from .text between
> >> 'kmem_cache_create' (at offset
> >> 0x20300) and 'cache_reap'
> >> -
> 
> This warnings should be handled by __init_refok instead.

Yes.  When __init_refok gets in, we can change all Pattern 9 members in
the whitelist to use __init_refok.

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


RE: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-15 Thread Li Yang-r58472
> -Original Message-
> From: Satyam Sharma [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 15, 2007 8:18 AM
> To: Kumar Gala
> Cc: Sam Ravnborg; Li Yang-r58472; Linus; Andrew Morton; Linux Kernel;
> [EMAIL PROTECTED]
> Subject: Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning
whitelist for
> powerpc
> 
> Hi,
> 
> On 5/14/07, Kumar Gala <[EMAIL PROTECTED]> wrote:
> >
> > On May 14, 2007, at 6:06 AM, Sam Ravnborg wrote:
> >
> > > On Mon, May 14, 2007 at 06:53:32PM +0800, Li Yang wrote:
> > >> This patch fixes the following "Section mismatch" warnings when
> > >> build powerpc platforms.
> > >>
> > >> -
> > >> WARNING: arch/powerpc/mm/built-in.o - Section mismatch: reference
to
> > >> .init.text:early_get_page from .text between
> > >> 'pte_alloc_one_kernel' (at
> > >> offset 0xc68) and 'pte_alloc_one'
> > >> WARNING: mm/built-in.o - Section mismatch: reference to
> > >> .init.text:set_up_list3s from .text between
> > >> 'kmem_cache_create' (at offset
> > >> 0x20300) and 'cache_reap'
> > >> -
> >
> > This warnings should be handled by __init_refok instead.
> 
> Actually, once __init_refok comes in, would we need any other
> whitelisting mechanism at all? I think the exception patterns in
> secref_whitelist() and those two other whitelisting functions
> (init_section_ref_ok and exit_section_ref_ok) could all be
> subsumed and made redundant if / when __init_refok is used
> in the actual sources.

I don't think so.  __init_refok can be used to mark special functions
which are legitimate to reference .init.text/.init.data but cannot be
used to mark special sections.

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


Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-14 Thread Satyam Sharma

Hi,

On 5/14/07, Kumar Gala <[EMAIL PROTECTED]> wrote:


On May 14, 2007, at 6:06 AM, Sam Ravnborg wrote:

> On Mon, May 14, 2007 at 06:53:32PM +0800, Li Yang wrote:
>> This patch fixes the following "Section mismatch" warnings when
>> build powerpc platforms.
>>
>> -
>> WARNING: arch/powerpc/mm/built-in.o - Section mismatch: reference to
>> .init.text:early_get_page from .text between
>> 'pte_alloc_one_kernel' (at
>> offset 0xc68) and 'pte_alloc_one'
>> WARNING: mm/built-in.o - Section mismatch: reference to
>> .init.text:set_up_list3s from .text between
>> 'kmem_cache_create' (at offset
>> 0x20300) and 'cache_reap'
>> -

This warnings should be handled by __init_refok instead.


Actually, once __init_refok comes in, would we need any other
whitelisting mechanism at all? I think the exception patterns in
secref_whitelist() and those two other whitelisting functions
(init_section_ref_ok and exit_section_ref_ok) could all be
subsumed and made redundant if / when __init_refok is used
in the actual sources.

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


Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-14 Thread Sam Ravnborg
On Mon, May 14, 2007 at 12:30:46PM -0700, Andrew Morton wrote:
> > >>
> > >> Signed-off-by: Li Yang <[EMAIL PROTECTED]>
> > > Acked-by: Sam Ravnborg <[EMAIL PROTECTED]>
> 
> I always get confused when a git-tree-owner says "acked-by" against a patch
> which falls within his tree's area.  An acked-by would mean "I'm OK with
> the patch, please apply it".  But I'd have expected to see a "thanks,
> applied" instead.

I have saved the patch so I can apply it if Linus does not do so.
My "Acked-by:" was actually mostly to tell Linus that I was OK
with the modpost changes although I did not write so in my mail.

So if this is not picked up by Linus I will pick up this patch.

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


Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-14 Thread Kumar Gala


On May 14, 2007, at 2:30 PM, Andrew Morton wrote:


On Mon, 14 May 2007 08:56:52 -0500
Kumar Gala <[EMAIL PROTECTED]> wrote:


On May 14, 2007, at 6:06 AM, Sam Ravnborg wrote:


On Mon, May 14, 2007 at 06:53:32PM +0800, Li Yang wrote:

This patch fixes the following "Section mismatch" warnings when
build powerpc platforms.

-
WARNING: arch/powerpc/mm/built-in.o - Section mismatch:  
reference to

.init.text:early_get_page from .text between
'pte_alloc_one_kernel' (at
offset 0xc68) and 'pte_alloc_one'
WARNING: mm/built-in.o - Section mismatch: reference to
.init.text:set_up_list3s from .text between
'kmem_cache_create' (at offset
0x20300) and 'cache_reap'
-


This warnings should be handled by __init_refok instead.



Yes, I think so.




Massive warnings represented by:
-
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch:
reference to
.init.data:.got2 from prom_entry (offset 0x0)
WARNING: arch/powerpc/platforms/built-in.o - Section mismatch:
reference to
.init.text:mpc8313_rdb_probe from .machine.desc after
'mach_mpc8313_rdb'
(at offset 0x4)
-

Signed-off-by: Li Yang <[EMAIL PROTECTED]>

Acked-by: Sam Ravnborg <[EMAIL PROTECTED]>


I always get confused when a git-tree-owner says "acked-by" against  
a patch
which falls within his tree's area.  An acked-by would mean "I'm OK  
with

the patch, please apply it".  But I'd have expected to see a "thanks,
applied" instead.

If it was "Andrew: please merge and send to Linus because it's  
urgent and I
can't be bothered setting up a git pull for it" then fine, but  
please be

explicit about that.


I'd prefer to handle the ppc specific bits through the powerpc.git  
since they are only warnings and we should be able to fix them up for  
the next 2.6.22-rc unless Linus is on a made dash to get 2.6.22 out  
faster than any previous release :)


- k

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


Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-14 Thread Andrew Morton
On Mon, 14 May 2007 08:56:52 -0500
Kumar Gala <[EMAIL PROTECTED]> wrote:

> On May 14, 2007, at 6:06 AM, Sam Ravnborg wrote:
> 
> > On Mon, May 14, 2007 at 06:53:32PM +0800, Li Yang wrote:
> >> This patch fixes the following "Section mismatch" warnings when
> >> build powerpc platforms.
> >>
> >> -
> >> WARNING: arch/powerpc/mm/built-in.o - Section mismatch: reference to
> >> .init.text:early_get_page from .text between  
> >> 'pte_alloc_one_kernel' (at
> >> offset 0xc68) and 'pte_alloc_one'
> >> WARNING: mm/built-in.o - Section mismatch: reference to
> >> .init.text:set_up_list3s from .text between  
> >> 'kmem_cache_create' (at offset
> >> 0x20300) and 'cache_reap'
> >> -
> 
> This warnings should be handled by __init_refok instead.
> 

Yes, I think so.

> 
> >> Massive warnings represented by:
> >> -
> >> WARNING: arch/powerpc/kernel/built-in.o - Section mismatch:  
> >> reference to
> >> .init.data:.got2 from prom_entry (offset 0x0)
> >> WARNING: arch/powerpc/platforms/built-in.o - Section mismatch:  
> >> reference to
> >> .init.text:mpc8313_rdb_probe from .machine.desc after  
> >> 'mach_mpc8313_rdb'
> >> (at offset 0x4)
> >> -
> >>
> >> Signed-off-by: Li Yang <[EMAIL PROTECTED]>
> > Acked-by: Sam Ravnborg <[EMAIL PROTECTED]>

I always get confused when a git-tree-owner says "acked-by" against a patch
which falls within his tree's area.  An acked-by would mean "I'm OK with
the patch, please apply it".  But I'd have expected to see a "thanks,
applied" instead.

If it was "Andrew: please merge and send to Linus because it's urgent and I
can't be bothered setting up a git pull for it" then fine, but please be
explicit about that.

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


Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-14 Thread Kumar Gala


On May 14, 2007, at 6:06 AM, Sam Ravnborg wrote:


On Mon, May 14, 2007 at 06:53:32PM +0800, Li Yang wrote:

This patch fixes the following "Section mismatch" warnings when
build powerpc platforms.

-
WARNING: arch/powerpc/mm/built-in.o - Section mismatch: reference to
.init.text:early_get_page from .text between  
'pte_alloc_one_kernel' (at

offset 0xc68) and 'pte_alloc_one'
WARNING: mm/built-in.o - Section mismatch: reference to
.init.text:set_up_list3s from .text between  
'kmem_cache_create' (at offset

0x20300) and 'cache_reap'
-


This warnings should be handled by __init_refok instead.

- k


Massive warnings represented by:
-
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch:  
reference to

.init.data:.got2 from prom_entry (offset 0x0)
WARNING: arch/powerpc/platforms/built-in.o - Section mismatch:  
reference to
.init.text:mpc8313_rdb_probe from .machine.desc after  
'mach_mpc8313_rdb'

(at offset 0x4)
-

Signed-off-by: Li Yang <[EMAIL PROTECTED]>

Acked-by: Sam Ravnborg <[EMAIL PROTECTED]>

---
scripts/mod/modpost.c |   16 
1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index c89cb71..aa3a881 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -649,9 +649,10 @@ static int strrcmp(const char *s, const char  
*sub)

 *  tosec= .init.text
 *
 * Pattern 10:
- *  ia64 has machvec table for each platform. It is mixture of  
function

- *  pointer of .init.text and .text.
- *  fromsec  = .machvec
+ *  ia64 has machvec table and powerpc has machine desc table for  
each
+ *  platform. It is mixture of function pointer of .init.text  
and .text.

+ *  fromsec  = .machvec | .machine.desc
+ *
 **/
static int secref_whitelist(const char *modname, const char *tosec,
const char *fromsec, const char *atsym,
@@ -681,6 +682,8 @@ static int secref_whitelist(const char  
*modname, const

char *tosec,
const char *pat4sym[] = {
"sparse_index_alloc",
"zone_wait_table_init",
+   "pte_alloc_one_kernel",
+   "kmem_cache_create",
NULL
};

@@ -750,7 +753,8 @@ static int secref_whitelist(const char  
*modname, const

char *tosec,
return 1;

/* Check for pattern 10 */
-   if (strcmp(fromsec, ".machvec") == 0)
+   if ((strcmp(fromsec, ".machvec") == 0) ||
+   (strcmp(fromsec, ".machine.desc") == 0))
return 1;

return 0;
@@ -883,6 +887,10 @@ static void warn_sec_mismatch(const char  
*modname,

const char *fromsec,
secref_whitelist(modname, secname, fromsec,
 elf->strtab + before->st_name, refsymname))
return;
+   /* fromsec whitelist - without a valid 'before' */
+   /* powerpc has a GOT table in .got2 section */
+   if (strcmp(fromsec, ".got2") == 0)
+   return;

if (before && after) {
warn("%s - Section mismatch: reference to %s:%s from %s "


-
To unsubscribe from this list: send the line "unsubscribe linux- 
kernel" in

the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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


Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc

2007-05-14 Thread Sam Ravnborg
On Mon, May 14, 2007 at 06:53:32PM +0800, Li Yang wrote:
> This patch fixes the following "Section mismatch" warnings when
> build powerpc platforms.
> 
> -
> WARNING: arch/powerpc/mm/built-in.o - Section mismatch: reference to 
> .init.text:early_get_page from .text between 'pte_alloc_one_kernel' (at 
> offset 0xc68) and 'pte_alloc_one'
> WARNING: mm/built-in.o - Section mismatch: reference to 
> .init.text:set_up_list3s from .text between 'kmem_cache_create' (at offset 
> 0x20300) and 'cache_reap'
> -
> 
> Massive warnings represented by:
> -
> WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to 
> .init.data:.got2 from prom_entry (offset 0x0)
> WARNING: arch/powerpc/platforms/built-in.o - Section mismatch: reference to 
> .init.text:mpc8313_rdb_probe from .machine.desc after 'mach_mpc8313_rdb' 
> (at offset 0x4)
> -
> 
> Signed-off-by: Li Yang <[EMAIL PROTECTED]>
Acked-by: Sam Ravnborg <[EMAIL PROTECTED]>
> ---
> scripts/mod/modpost.c |   16 
> 1 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index c89cb71..aa3a881 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -649,9 +649,10 @@ static int strrcmp(const char *s, const char *sub)
>  *  tosec= .init.text
>  *
>  * Pattern 10:
> - *  ia64 has machvec table for each platform. It is mixture of function
> - *  pointer of .init.text and .text.
> - *  fromsec  = .machvec
> + *  ia64 has machvec table and powerpc has machine desc table for each
> + *  platform. It is mixture of function pointer of .init.text and .text.
> + *  fromsec  = .machvec | .machine.desc
> + *
>  **/
> static int secref_whitelist(const char *modname, const char *tosec,
>   const char *fromsec, const char *atsym,
> @@ -681,6 +682,8 @@ static int secref_whitelist(const char *modname, const 
> char *tosec,
>   const char *pat4sym[] = {
>   "sparse_index_alloc",
>   "zone_wait_table_init",
> + "pte_alloc_one_kernel",
> + "kmem_cache_create",
>   NULL
>   };
> 
> @@ -750,7 +753,8 @@ static int secref_whitelist(const char *modname, const 
> char *tosec,
>   return 1;
> 
>   /* Check for pattern 10 */
> - if (strcmp(fromsec, ".machvec") == 0)
> + if ((strcmp(fromsec, ".machvec") == 0) ||
> + (strcmp(fromsec, ".machine.desc") == 0))
>   return 1;
> 
>   return 0;
> @@ -883,6 +887,10 @@ static void warn_sec_mismatch(const char *modname, 
> const char *fromsec,
>   secref_whitelist(modname, secname, fromsec,
>elf->strtab + before->st_name, refsymname))
>   return;
> + /* fromsec whitelist - without a valid 'before' */
> + /* powerpc has a GOT table in .got2 section */
> + if (strcmp(fromsec, ".got2") == 0)
> + return;
> 
>   if (before && after) {
>   warn("%s - Section mismatch: reference to %s:%s from %s "
> 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/