WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] 2.6.37 mainline kernel section mismatches

To: Arvind R <arvino55@xxxxxxxxx>
Subject: Re: [Xen-devel] 2.6.37 mainline kernel section mismatches
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Mon, 24 Jan 2011 11:40:28 +0000
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 24 Jan 2011 03:40:14 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTinWfq1KLNgBaURd7sxXz-m7s454GUxgJKC9NajN@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <AANLkTinWfq1KLNgBaURd7sxXz-m7s454GUxgJKC9NajN@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Sat, 22 Jan 2011, Arvind R wrote:
> Hi,
> Got 7 section mismatch warnings while compiling mainline 2.6.37 release 
> kernel.
> 
> FILE                                   Caller Func
>       Callled Func      Warnings
> arch/x86/xen/enlighten.c    xen_hvm_init_shared_info    extend_brk          1
> arch/x86/xen/mmu.c           xen_build_mfn_list_list
> extend_brk          4
> 
> Column 2 functions need __init qualifiers; but these functions are
> also called in
> non __init functions in suspend.c
> 
> FILE                                   DATA
>          INITIALISER        Warnings
> drivers/xen/events.c           cpu_evtchn_mask_p
> &init_evtchn_mask    2
> Here init_evtchn_mask needs __initdata qualifier removed
> 

the appended patch by Stefan Assmann should fix the issue, I'll try to
upstream it in the next merge window.

---


From: Stefan Assmann <sassmann@xxxxxxxxxx>

The following warning shows up when building the kernel with
make CONFIG_DEBUG_SECTION_MISMATCH=y.

WARNING: arch/x86/built-in.o(.text+0x475): Section mismatch in reference from 
the function xen_hvm_init_shared_info() to the function .init.text:extend_brk()
The function xen_hvm_init_shared_info() references
the function __init extend_brk().
This is often because xen_hvm_init_shared_info lacks a __init
annotation or the annotation of extend_brk is wrong.

The problem is that xen_hvm_init_shared_info() calls extend_brk() which is
an __init function. However xen_hvm_init_shared_info() cannot be an
__init function as it's called on system resume as well. Easy fix by
moving extend_brk() out of the function.

Signed-off-by: Stefan Assmann <sassmann@xxxxxxxxxx>
---
 arch/x86/xen/enlighten.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 02c710b..13b11fd 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -83,6 +83,7 @@ EXPORT_SYMBOL(machine_to_phys_order);
 struct start_info *xen_start_info;
 EXPORT_SYMBOL_GPL(xen_start_info);

+struct shared_info *shared_info_page;
 struct shared_info xen_dummy_shared_info;

 void *xen_initial_gdt;
@@ -1310,11 +1311,7 @@ void xen_hvm_init_shared_info(void)
 {
        int cpu;
        struct xen_add_to_physmap xatp;
-       static struct shared_info *shared_info_page = 0;

-       if (!shared_info_page)
-               shared_info_page = (struct shared_info *)
-                       extend_brk(PAGE_SIZE, PAGE_SIZE);
        xatp.domid = DOMID_SELF;
        xatp.idx = 0;
        xatp.space = XENMAPSPACE_shared_info;
@@ -1365,6 +1362,9 @@ static void __init xen_hvm_guest_init(void)
        if (r < 0)
                return;

+       shared_info_page = (struct shared_info *)
+               extend_brk(PAGE_SIZE, PAGE_SIZE);
+
        xen_hvm_init_shared_info();

        if (xen_feature(XENFEAT_hvm_callback_vector))
-- 
1.7.3.2


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>