linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
@ 2007-05-14 10:53 Li Yang
  2007-05-14 11:06 ` Sam Ravnborg
  0 siblings, 1 reply; 12+ messages in thread
From: Li Yang @ 2007-05-14 10:53 UTC (permalink / raw)
  To: Linus, Andrew Morton, Linux Kernel; +Cc: linuxppc-dev, Sam Ravnborg

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 <leoli@freescale.com>
---
 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 "

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-14 10:53 [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc Li Yang
@ 2007-05-14 11:06 ` Sam Ravnborg
  2007-05-14 13:56   ` Kumar Gala
  0 siblings, 1 reply; 12+ messages in thread
From: Sam Ravnborg @ 2007-05-14 11:06 UTC (permalink / raw)
  To: Li Yang; +Cc: Andrew Morton, linuxppc-dev, Linus, Linux Kernel

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 <leoli@freescale.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> 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 "
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-14 11:06 ` Sam Ravnborg
@ 2007-05-14 13:56   ` Kumar Gala
  2007-05-14 19:30     ` Andrew Morton
                       ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Kumar Gala @ 2007-05-14 13:56 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Andrew Morton, linuxppc-dev, Li Yang, Linus, Linux Kernel


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 <leoli@freescale.com>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
>> ---
>> 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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-14 13:56   ` Kumar Gala
@ 2007-05-14 19:30     ` Andrew Morton
  2007-05-14 20:10       ` Kumar Gala
  2007-05-14 21:13       ` Sam Ravnborg
  2007-05-15  0:17     ` Satyam Sharma
  2007-05-15  9:36     ` Li Yang-r58472
  2 siblings, 2 replies; 12+ messages in thread
From: Andrew Morton @ 2007-05-14 19:30 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Linus, Li Yang, Sam Ravnborg, Linux Kernel, linuxppc-dev

On Mon, 14 May 2007 08:56:52 -0500
Kumar Gala <galak@kernel.crashing.org> 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 <leoli@freescale.com>
> > Acked-by: Sam Ravnborg <sam@ravnborg.org>

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-14 19:30     ` Andrew Morton
@ 2007-05-14 20:10       ` Kumar Gala
  2007-05-14 21:13       ` Sam Ravnborg
  1 sibling, 0 replies; 12+ messages in thread
From: Kumar Gala @ 2007-05-14 20:10 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Sam Ravnborg, Linux Kernel, ppc-dev list, Paul Mackerras, Li Yang,
	Linus Torvalds


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

> On Mon, 14 May 2007 08:56:52 -0500
> Kumar Gala <galak@kernel.crashing.org> 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 <leoli@freescale.com>
>>> Acked-by: Sam Ravnborg <sam@ravnborg.org>
>
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-14 19:30     ` Andrew Morton
  2007-05-14 20:10       ` Kumar Gala
@ 2007-05-14 21:13       ` Sam Ravnborg
  1 sibling, 0 replies; 12+ messages in thread
From: Sam Ravnborg @ 2007-05-14 21:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Li Yang, Linus, Linux Kernel

On Mon, May 14, 2007 at 12:30:46PM -0700, Andrew Morton wrote:
> > >>
> > >> Signed-off-by: Li Yang <leoli@freescale.com>
> > > Acked-by: Sam Ravnborg <sam@ravnborg.org>
> 
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-14 13:56   ` Kumar Gala
  2007-05-14 19:30     ` Andrew Morton
@ 2007-05-15  0:17     ` Satyam Sharma
  2007-05-15  9:22       ` Li Yang-r58472
  2007-05-15  9:36     ` Li Yang-r58472
  2 siblings, 1 reply; 12+ messages in thread
From: Satyam Sharma @ 2007-05-15  0:17 UTC (permalink / raw)
  To: Kumar Gala
  Cc: Andrew Morton, Sam Ravnborg, Linux Kernel, linuxppc-dev, Li Yang,
	Linus

Hi,

On 5/14/07, Kumar Gala <galak@kernel.crashing.org> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-15  0:17     ` Satyam Sharma
@ 2007-05-15  9:22       ` Li Yang-r58472
  2007-05-15 10:03         ` Satyam Sharma
  0 siblings, 1 reply; 12+ messages in thread
From: Li Yang-r58472 @ 2007-05-15  9:22 UTC (permalink / raw)
  To: Satyam Sharma, Kumar Gala
  Cc: Andrew Morton, Linus, Sam Ravnborg, Linux Kernel, linuxppc-dev

> -----Original Message-----
> From: Satyam Sharma [mailto:satyam.sharma@gmail.com]
> Sent: Tuesday, May 15, 2007 8:18 AM
> To: Kumar Gala
> Cc: Sam Ravnborg; Li Yang-r58472; Linus; Andrew Morton; Linux Kernel;
> linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning
whitelist for
> powerpc
>=20
> Hi,
>=20
> On 5/14/07, Kumar Gala <galak@kernel.crashing.org> 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.
>=20
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-14 13:56   ` Kumar Gala
  2007-05-14 19:30     ` Andrew Morton
  2007-05-15  0:17     ` Satyam Sharma
@ 2007-05-15  9:36     ` Li Yang-r58472
  2007-05-15 19:29       ` Sam Ravnborg
  2 siblings, 1 reply; 12+ messages in thread
From: Li Yang-r58472 @ 2007-05-15  9:36 UTC (permalink / raw)
  To: Kumar Gala, Sam Ravnborg; +Cc: Andrew Morton, linuxppc-dev, Linus, Linux Kernel

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Monday, May 14, 2007 9:57 PM
> To: Sam Ravnborg
> Cc: Li Yang-r58472; Linus; Andrew Morton; Linux Kernel;
linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning
whitelist for
> powerpc
>=20
>=20
> On May 14, 2007, at 6:06 AM, Sam Ravnborg wrote:
>=20
> > 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'
> >> -------------
>=20
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-15  9:22       ` Li Yang-r58472
@ 2007-05-15 10:03         ` Satyam Sharma
  2007-05-15 10:56           ` Stephen Rothwell
  0 siblings, 1 reply; 12+ messages in thread
From: Satyam Sharma @ 2007-05-15 10:03 UTC (permalink / raw)
  To: Li Yang-r58472
  Cc: Andrew Morton, Sam Ravnborg, Linux Kernel, linuxppc-dev, Linus

On 5/15/07, Li Yang-r58472 <LeoLi@freescale.com> 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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-15 10:03         ` Satyam Sharma
@ 2007-05-15 10:56           ` Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2007-05-15 10:56 UTC (permalink / raw)
  To: Satyam Sharma
  Cc: Andrew Morton, Linus, Linux Kernel, linuxppc-dev, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

On Tue, 15 May 2007 15:33:50 +0530 "Satyam Sharma" <satyam.sharma@gmail.com> 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                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc
  2007-05-15  9:36     ` Li Yang-r58472
@ 2007-05-15 19:29       ` Sam Ravnborg
  0 siblings, 0 replies; 12+ messages in thread
From: Sam Ravnborg @ 2007-05-15 19:29 UTC (permalink / raw)
  To: Li Yang-r58472; +Cc: Andrew Morton, linuxppc-dev, Linus, Linux Kernel

On Tue, May 15, 2007 at 05:36:40PM +0800, Li Yang-r58472 wrote:
> > -----Original Message-----
> > From: Kumar Gala [mailto:galak@kernel.crashing.org]
> > Sent: Monday, May 14, 2007 9:57 PM
> > To: Sam Ravnborg
> > Cc: Li Yang-r58472; Linus; Andrew Morton; Linux Kernel;
> linuxppc-dev@ozlabs.org
> > 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-05-15 19:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-14 10:53 [PATCH 1/2] kbuild: Add "Section mismatch" warning whitelist for powerpc Li Yang
2007-05-14 11:06 ` Sam Ravnborg
2007-05-14 13:56   ` Kumar Gala
2007-05-14 19:30     ` Andrew Morton
2007-05-14 20:10       ` Kumar Gala
2007-05-14 21:13       ` Sam Ravnborg
2007-05-15  0:17     ` Satyam Sharma
2007-05-15  9:22       ` Li Yang-r58472
2007-05-15 10:03         ` Satyam Sharma
2007-05-15 10:56           ` Stephen Rothwell
2007-05-15  9:36     ` Li Yang-r58472
2007-05-15 19:29       ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).