* [PATCH 1/3] xen: events: mark cpu_evtchn_mask_p as __refdata
@ 2011-02-11 15:23 Ian Campbell
2011-02-11 15:23 ` [PATCH 2/3] xen: annotate functions which only call into __init at start of day Ian Campbell
0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2011-02-11 15:23 UTC (permalink / raw)
To: xen-devel
Cc: Jeremy Fitzhardinge, Ian Campbell, Stefano Stabellini,
Konrad Rzeszutek Wilk
This variable starts out pointing at init_evtchn_mask which is marked
__initdata but is set to point to a non-init data region in xen_init_IRQ
which is itself an __init function so this is safe.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-and-acked-by: Andrew Jones <drjones@redhat.com>
---
drivers/xen/events.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 51051cf..d88702e 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -114,7 +114,7 @@ struct cpu_evtchn_s {
static __initdata struct cpu_evtchn_s init_evtchn_mask = {
.bits[0 ... (NR_EVENT_CHANNELS/BITS_PER_LONG)-1] = ~0ul,
};
-static struct cpu_evtchn_s *cpu_evtchn_mask_p = &init_evtchn_mask;
+static struct cpu_evtchn_s __refdata *cpu_evtchn_mask_p = &init_evtchn_mask;
static inline unsigned long *cpu_evtchn_mask(int cpu)
{
--
1.5.6.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] xen: annotate functions which only call into __init at start of day
2011-02-11 15:23 [PATCH 1/3] xen: events: mark cpu_evtchn_mask_p as __refdata Ian Campbell
@ 2011-02-11 15:23 ` Ian Campbell
2011-02-11 15:23 ` [PATCH 3/3] xen p2m: annotate variable which appears unused Ian Campbell
2011-02-11 16:31 ` [PATCH 2/3] xen: annotate functions which only call into __init at start of day Jan Beulich
0 siblings, 2 replies; 6+ messages in thread
From: Ian Campbell @ 2011-02-11 15:23 UTC (permalink / raw)
To: xen-devel
Cc: Jeremy Fitzhardinge, Ian Campbell, Stefano Stabellini,
Konrad Rzeszutek Wilk
Both xen_hvm_init_shared_info and xen_build_mfn_list_list can be
called at resume time as well as at start of day but only reference
__init functions (extend_brk) at start of day. Hence annotate with
__refdata.
WARNING: arch/x86/built-in.o(.text+0x4f1): 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.
xen_hvm_init_shared_info calls extend_brk() iff !shared_info_page and
initialises shared_info_page with the result. This happens at start of
day only.
WARNING: arch/x86/built-in.o(.text+0x599b): Section mismatch in reference
from the function xen_build_mfn_list_list() to the function
.init.text:extend_brk()
The function xen_build_mfn_list_list() references
the function __init extend_brk().
This is often because xen_build_mfn_list_list lacks a __init
annotation or the annotation of extend_brk is wrong.
(this warning occurs multiple times)
xen_build_mfn_list_list only calls extend_brk() at boot time, while
building the initial mfn list list
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
arch/x86/xen/enlighten.c | 2 +-
arch/x86/xen/p2m.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 50542ef..f4195fa 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1292,7 +1292,7 @@ static int init_hvm_pv_info(int *major, int *minor)
return 0;
}
-void xen_hvm_init_shared_info(void)
+void __refdata xen_hvm_init_shared_info(void)
{
int cpu;
struct xen_add_to_physmap xatp;
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index fd12d7c..53fe9fc 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -136,7 +136,7 @@ static void p2m_init(unsigned long *p2m)
* - After resume we're called from within stop_machine, but the mfn
* tree should alreay be completely allocated.
*/
-void xen_build_mfn_list_list(void)
+void __refdata xen_build_mfn_list_list(void)
{
unsigned long pfn;
--
1.5.6.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] xen p2m: annotate variable which appears unused
2011-02-11 15:23 ` [PATCH 2/3] xen: annotate functions which only call into __init at start of day Ian Campbell
@ 2011-02-11 15:23 ` Ian Campbell
2011-02-11 15:37 ` Konrad Rzeszutek Wilk
2011-02-11 16:31 ` [PATCH 2/3] xen: annotate functions which only call into __init at start of day Jan Beulich
1 sibling, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2011-02-11 15:23 UTC (permalink / raw)
To: xen-devel
Cc: Jeremy Fitzhardinge, Ian Campbell, Stefano Stabellini,
Konrad Rzeszutek Wilk
CC arch/x86/xen/p2m.o
arch/x86/xen/p2m.c: In function 'm2p_remove_override':
arch/x86/xen/p2m.c:460: warning: 'address' may be used uninitialized in this function
arch/x86/xen/p2m.c: In function 'm2p_add_override':
arch/x86/xen/p2m.c:426: warning: 'address' may be used uninitialized in this function
In actual fact address is inialised in one "if (!PageHighMem(page))"
statement and used in a second and so is always initialised before
use.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
arch/x86/xen/p2m.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 53fe9fc..3720efa 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -421,7 +421,7 @@ int m2p_add_override(unsigned long mfn, struct page *page)
{
unsigned long flags;
unsigned long pfn;
- unsigned long address;
+ unsigned long uninitialized_var(address);
unsigned level;
pte_t *ptep = NULL;
@@ -455,7 +455,7 @@ int m2p_remove_override(struct page *page)
unsigned long flags;
unsigned long mfn;
unsigned long pfn;
- unsigned long address;
+ unsigned long uninitialized_var(address);
unsigned level;
pte_t *ptep = NULL;
--
1.5.6.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] xen p2m: annotate variable which appears unused
2011-02-11 15:23 ` [PATCH 3/3] xen p2m: annotate variable which appears unused Ian Campbell
@ 2011-02-11 15:37 ` Konrad Rzeszutek Wilk
0 siblings, 0 replies; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-02-11 15:37 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel, Jeremy Fitzhardinge, Stefano Stabellini
On Fri, Feb 11, 2011 at 03:23:58PM +0000, Ian Campbell wrote:
> CC arch/x86/xen/p2m.o
> arch/x86/xen/p2m.c: In function 'm2p_remove_override':
> arch/x86/xen/p2m.c:460: warning: 'address' may be used uninitialized in this function
> arch/x86/xen/p2m.c: In function 'm2p_add_override':
> arch/x86/xen/p2m.c:426: warning: 'address' may be used uninitialized in this function
Thanks for doing those. I've been seeing them for weeks now and just never
got off to fixing them.
>
> In actual fact address is inialised in one "if (!PageHighMem(page))"
> statement and used in a second and so is always initialised before
> use.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> arch/x86/xen/p2m.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> index 53fe9fc..3720efa 100644
> --- a/arch/x86/xen/p2m.c
> +++ b/arch/x86/xen/p2m.c
> @@ -421,7 +421,7 @@ int m2p_add_override(unsigned long mfn, struct page *page)
> {
> unsigned long flags;
> unsigned long pfn;
> - unsigned long address;
> + unsigned long uninitialized_var(address);
> unsigned level;
> pte_t *ptep = NULL;
>
> @@ -455,7 +455,7 @@ int m2p_remove_override(struct page *page)
> unsigned long flags;
> unsigned long mfn;
> unsigned long pfn;
> - unsigned long address;
> + unsigned long uninitialized_var(address);
> unsigned level;
> pte_t *ptep = NULL;
>
> --
> 1.5.6.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] xen: annotate functions which only call into __init at start of day
2011-02-11 15:23 ` [PATCH 2/3] xen: annotate functions which only call into __init at start of day Ian Campbell
2011-02-11 15:23 ` [PATCH 3/3] xen p2m: annotate variable which appears unused Ian Campbell
@ 2011-02-11 16:31 ` Jan Beulich
2011-02-11 16:37 ` Ian Campbell
1 sibling, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2011-02-11 16:31 UTC (permalink / raw)
To: Ian Campbell
Cc: Jeremy Fitzhardinge, xen-devel, Konrad Rzeszutek Wilk,
Stefano Stabellini
>>> On 11.02.11 at 16:23, Ian Campbell <ian.campbell@citrix.com> wrote:
> Both xen_hvm_init_shared_info and xen_build_mfn_list_list can be
> called at resume time as well as at start of day but only reference
> __init functions (extend_brk) at start of day. Hence annotate with
> __refdata.
__ref for functions (__refdata for data items).
Jan
> WARNING: arch/x86/built-in.o(.text+0x4f1): 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.
>
> xen_hvm_init_shared_info calls extend_brk() iff !shared_info_page and
> initialises shared_info_page with the result. This happens at start of
> day only.
>
> WARNING: arch/x86/built-in.o(.text+0x599b): Section mismatch in reference
> from the function xen_build_mfn_list_list() to the function
> .init.text:extend_brk()
> The function xen_build_mfn_list_list() references
> the function __init extend_brk().
> This is often because xen_build_mfn_list_list lacks a __init
> annotation or the annotation of extend_brk is wrong.
>
> (this warning occurs multiple times)
>
> xen_build_mfn_list_list only calls extend_brk() at boot time, while
> building the initial mfn list list
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> arch/x86/xen/enlighten.c | 2 +-
> arch/x86/xen/p2m.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index 50542ef..f4195fa 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -1292,7 +1292,7 @@ static int init_hvm_pv_info(int *major, int *minor)
> return 0;
> }
>
> -void xen_hvm_init_shared_info(void)
> +void __refdata xen_hvm_init_shared_info(void)
> {
> int cpu;
> struct xen_add_to_physmap xatp;
> diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> index fd12d7c..53fe9fc 100644
> --- a/arch/x86/xen/p2m.c
> +++ b/arch/x86/xen/p2m.c
> @@ -136,7 +136,7 @@ static void p2m_init(unsigned long *p2m)
> * - After resume we're called from within stop_machine, but the mfn
> * tree should alreay be completely allocated.
> */
> -void xen_build_mfn_list_list(void)
> +void __refdata xen_build_mfn_list_list(void)
> {
> unsigned long pfn;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] xen: annotate functions which only call into __init at start of day
2011-02-11 16:31 ` [PATCH 2/3] xen: annotate functions which only call into __init at start of day Jan Beulich
@ 2011-02-11 16:37 ` Ian Campbell
0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2011-02-11 16:37 UTC (permalink / raw)
To: Jan Beulich
Cc: Jeremy Fitzhardinge, xen-devel, Konrad Rzeszutek Wilk,
Stefano Stabellini
On Fri, 2011-02-11 at 16:31 +0000, Jan Beulich wrote:
> >>> On 11.02.11 at 16:23, Ian Campbell <ian.campbell@citrix.com> wrote:
> > Both xen_hvm_init_shared_info and xen_build_mfn_list_list can be
> > called at resume time as well as at start of day but only reference
> > __init functions (extend_brk) at start of day. Hence annotate with
> > __refdata.
>
> __ref for functions (__refdata for data items).
Oops, correct. Strangely didn't generate any warnings/errors.
Ian.
>From 79f2b81934879be52353f64076b7936ba6fd08a3 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@citrix.com>
Date: Fri, 11 Feb 2011 16:36:03 +0000
Subject: [PATCH] xen: annotate functions which only call into __init at start of day
Both xen_hvm_init_shared_info and xen_build_mfn_list_list can be
called at resume time as well as at start of day but only reference
__init functions (extend_brk) at start of day. Hence annotate with
__ref.
WARNING: arch/x86/built-in.o(.text+0x4f1): 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.
xen_hvm_init_shared_info calls extend_brk() iff !shared_info_page and
initialises shared_info_page with the result. This happens at start of
day only.
WARNING: arch/x86/built-in.o(.text+0x599b): Section mismatch in reference
from the function xen_build_mfn_list_list() to the function
.init.text:extend_brk()
The function xen_build_mfn_list_list() references
the function __init extend_brk().
This is often because xen_build_mfn_list_list lacks a __init
annotation or the annotation of extend_brk is wrong.
(this warning occurs multiple times)
xen_build_mfn_list_list only calls extend_brk() at boot time, while
building the initial mfn list list
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
arch/x86/xen/enlighten.c | 2 +-
arch/x86/xen/p2m.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 50542ef..28e6d42 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1292,7 +1292,7 @@ static int init_hvm_pv_info(int *major, int *minor)
return 0;
}
-void xen_hvm_init_shared_info(void)
+void __ref xen_hvm_init_shared_info(void)
{
int cpu;
struct xen_add_to_physmap xatp;
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index fd12d7c..3239bf6 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -136,7 +136,7 @@ static void p2m_init(unsigned long *p2m)
* - After resume we're called from within stop_machine, but the mfn
* tree should alreay be completely allocated.
*/
-void xen_build_mfn_list_list(void)
+void __ref xen_build_mfn_list_list(void)
{
unsigned long pfn;
--
1.5.6.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-02-11 16:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-11 15:23 [PATCH 1/3] xen: events: mark cpu_evtchn_mask_p as __refdata Ian Campbell
2011-02-11 15:23 ` [PATCH 2/3] xen: annotate functions which only call into __init at start of day Ian Campbell
2011-02-11 15:23 ` [PATCH 3/3] xen p2m: annotate variable which appears unused Ian Campbell
2011-02-11 15:37 ` Konrad Rzeszutek Wilk
2011-02-11 16:31 ` [PATCH 2/3] xen: annotate functions which only call into __init at start of day Jan Beulich
2011-02-11 16:37 ` Ian Campbell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.