Skip to contentSkip to conversation

x86: Fixing improper annotation.

PATCH Rufus & Azrael 3 participants 7 messages Nov 11, 2008 – Nov 18, 2008

lore
Share & tools
lore
#0 lore raw

Hi Rakib,

Your two patches set for x86 init_thread_xsate function section mismatch is correct to fix the compilation warning, but generates this other one :

Quoted 5 lines

WARNING: vmlinux.o(.cpuinit.text+0x7de): Section mismatch in reference from the function xsave_cntxt_init() to the function .init.text:__alloc_bootmem() The function __cpuinit xsave_cntxt_init() references
a function __init __alloc_bootmem().
If __alloc_bootmem is only used by xsave_cntxt_init then
annotate __alloc_bootmem with a matching annotation.

Thanks for your good job.

Regards.

#1 lore raw
Quoted 14 lines · Rufus & Azrael

Hi Rakib,

Your two patches set for x86 init_thread_xsate function section mismatch is correct to fix the compilation warning, but generates this other one :

Quoted 7 lines

WARNING: vmlinux.o(.cpuinit.text+0x7de): Section mismatch in reference from the function xsave_cntxt_init() to the function .init.text:__alloc_bootmem()
The function __cpuinit xsave_cntxt_init() references
a function __init __alloc_bootmem().
If __alloc_bootmem is only used by xsave_cntxt_init then annotate __alloc_bootmem with a matching annotation.

that's with both 1/2 and 2/2 applied?

Ingo

#2 lore raw
Quoted 20 lines · Ingo Molnar
Quoted 16 lines · Rufus& Azrael

Hi Rakib,

Your two patches set for x86 init_thread_xsate function section mismatch is correct to fix the compilation warning, but generates this other one :

Quoted 8 lines

WARNING: vmlinux.o(.cpuinit.text+0x7de): Section mismatch in reference from the function xsave_cntxt_init() to the function .init.text:__alloc_bootmem()
The function __cpuinit xsave_cntxt_init() references
a function __init __alloc_bootmem().
If __alloc_bootmem is only used by xsave_cntxt_init then annotate __alloc_bootmem with a matching annotation.

Quoted 5 lines

that's with both 1/2 and 2/2 applied?

Ingo

Yes Ingo with the two patches applied.

Regards.

#3 lore raw
Quoted 21 lines · Rufus & Azrael
Quoted 20 lines · Ingo Molnar
Quoted 16 lines · Rufus& Azrael

Hi Rakib,

Your two patches set for x86 init_thread_xsate function section mismatch is correct to fix the compilation warning, but generates this other one :

Quoted 8 lines

WARNING: vmlinux.o(.cpuinit.text+0x7de): Section mismatch in reference from the function xsave_cntxt_init() to the function .init.text:__alloc_bootmem()
The function __cpuinit xsave_cntxt_init() references
a function __init __alloc_bootmem().
If __alloc_bootmem is only used by xsave_cntxt_init then annotate __alloc_bootmem with a matching annotation.

Quoted 6 lines
Quoted 5 lines

that's with both 1/2 and 2/2 applied?

Ingo

Yes Ingo with the two patches applied.

okay - so i wont apply them until the full scope of the problems here is mapped. We might be best off by marking xsave_cntxt_init() non-init altogether for the time being?

Ingo

#4 lore raw
Quoted 4 lines · Ingo Molnar

okay - so i wont apply them until the full scope of the problems here
is mapped. We might be best off by marking xsave_cntxt_init() non-init altogether for the time being?

But, it's been called from an __init section, it will also trigger an warning too. So, it
will remain as it was. If we goes to hunt these warnings ( I mean
we've to replace __init __alloc_bootmem() with __cpuinit __alloc_bootmem() ) , it's not certain when it will stop. Likely , we need to replace a lots of __init with __cpuinit.

Rakib

Quoted 3 lines

Ingo

#5 lore raw
Quoted 7 lines · Rakib Mullick
Quoted 4 lines · Ingo Molnar

okay - so i wont apply them until the full scope of the problems here
is mapped. We might be best off by marking xsave_cntxt_init() non-init altogether for the time being?

Quoted 7 lines

But, it's been called from an __init section, it will also trigger an
warning too. So, it
will remain as it was. If we goes to hunt these warnings ( I mean
we've to replace __init __alloc_bootmem() with __cpuinit __alloc_bootmem() ) , it's not certain when it will stop. Likely , we need to replace a lots of __init with __cpuinit.

Actually , if we replace __init __alloc_bootmem() with __cpuinit __alloc_bootmem() that doesn't solve the problem. The mentioned warning generates when CONFIG_ARCH_BOOTMEM_NODE=y is set. I think Ingo is right. We can mark xsave_cntxt_init() as non-init. And we could teach modpost to not to generate the warning
with __ref. Can we, Ingo ?

Quoted 5 lines

Rakib

Quoted 3 lines

Ingo

#6 lore raw
Quoted 16 lines · Rakib Mullick
Quoted 7 lines · Rakib Mullick
Quoted 4 lines · Ingo Molnar

okay - so i wont apply them until the full scope of the problems here
is mapped. We might be best off by marking xsave_cntxt_init() non-init altogether for the time being?

Quoted 7 lines

But, it's been called from an __init section, it will also trigger an
warning too. So, it
will remain as it was. If we goes to hunt these warnings ( I mean
we've to replace __init __alloc_bootmem() with __cpuinit __alloc_bootmem() ) , it's not certain when it will stop. Likely , we need to replace a lots of __init with __cpuinit.

Quoted 6 lines

Actually , if we replace __init __alloc_bootmem() with __cpuinit __alloc_bootmem() that doesn't solve the problem. The mentioned warning generates when CONFIG_ARCH_BOOTMEM_NODE=y is set. I think Ingo is right. We can mark xsave_cntxt_init() as non-init. And we could teach modpost to not to generate the warning with __ref. Can we, Ingo ?

sure. Marking stuff non-init is inherently safe as well.

Ingo