LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
@ 2008-11-06 16:48 Takashi Iwai
2008-11-06 18:57 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 13+ messages in thread
From: Takashi Iwai @ 2008-11-06 16:48 UTC (permalink / raw)
To: Tony Luck; +Cc: Jeremy Fitzhardinge, Isaku Yamahata, linux-kernel
__initdata and const cannot be always a happy pair, as gcc-4.3.3 gives
the compile errors like:
arch/ia64/xen/xen_pv_ops.c:156: error: xen_init_ops causes a section type conflict
arch/ia64/xen/xen_pv_ops.c:340: error: xen_iosapic_ops causes a section type conflict
This patch simply removes const from data with __initdata.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
diff --git a/arch/ia64/xen/xen_pv_ops.c b/arch/ia64/xen/xen_pv_ops.c
index 04cd123..5d491d9 100644
--- a/arch/ia64/xen/xen_pv_ops.c
+++ b/arch/ia64/xen/xen_pv_ops.c
@@ -153,7 +153,7 @@ xen_post_smp_prepare_boot_cpu(void)
xen_setup_vcpu_info_placement();
}
-static const struct pv_init_ops xen_init_ops __initdata = {
+static struct pv_init_ops xen_init_ops __initdata = {
.banner = xen_banner,
.reserve_memory = xen_reserve_memory,
@@ -260,7 +260,7 @@ xen_intrin_local_irq_restore(unsigned long mask)
xen_rsm_i();
}
-static const struct pv_cpu_ops xen_cpu_ops __initdata = {
+static struct pv_cpu_ops xen_cpu_ops __initdata = {
.fc = xen_fc,
.thash = xen_thash,
.get_cpuid = xen_get_cpuid,
@@ -337,7 +337,7 @@ xen_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op);
}
-static const struct pv_iosapic_ops xen_iosapic_ops __initdata = {
+static struct pv_iosapic_ops xen_iosapic_ops __initdata = {
.pcat_compat_init = xen_pcat_compat_init,
.__get_irq_chip = xen_iosapic_get_irq_chip,
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-06 16:48 [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c Takashi Iwai
@ 2008-11-06 18:57 ` Jeremy Fitzhardinge
2008-11-06 19:15 ` Takashi Iwai
2008-11-06 21:48 ` Sam Ravnborg
0 siblings, 2 replies; 13+ messages in thread
From: Jeremy Fitzhardinge @ 2008-11-06 18:57 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Tony Luck, Isaku Yamahata, linux-kernel, Sam Ravnborg
Takashi Iwai wrote:
> __initdata and const cannot be always a happy pair, as gcc-4.3.3 gives
> the compile errors like:
>
> arch/ia64/xen/xen_pv_ops.c:156: error: xen_init_ops causes a section type conflict
> arch/ia64/xen/xen_pv_ops.c:340: error: xen_iosapic_ops causes a section type conflict
>
> This patch simply removes const from data with __initdata.
>
Yeah, I've seen these sort of messages before, but I don't see why
there's an inherent problem with having const __initdata.
Sam?
J
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>
> ---
> diff --git a/arch/ia64/xen/xen_pv_ops.c b/arch/ia64/xen/xen_pv_ops.c
> index 04cd123..5d491d9 100644
> --- a/arch/ia64/xen/xen_pv_ops.c
> +++ b/arch/ia64/xen/xen_pv_ops.c
> @@ -153,7 +153,7 @@ xen_post_smp_prepare_boot_cpu(void)
> xen_setup_vcpu_info_placement();
> }
>
> -static const struct pv_init_ops xen_init_ops __initdata = {
> +static struct pv_init_ops xen_init_ops __initdata = {
> .banner = xen_banner,
>
> .reserve_memory = xen_reserve_memory,
> @@ -260,7 +260,7 @@ xen_intrin_local_irq_restore(unsigned long mask)
> xen_rsm_i();
> }
>
> -static const struct pv_cpu_ops xen_cpu_ops __initdata = {
> +static struct pv_cpu_ops xen_cpu_ops __initdata = {
> .fc = xen_fc,
> .thash = xen_thash,
> .get_cpuid = xen_get_cpuid,
> @@ -337,7 +337,7 @@ xen_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
> HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op);
> }
>
> -static const struct pv_iosapic_ops xen_iosapic_ops __initdata = {
> +static struct pv_iosapic_ops xen_iosapic_ops __initdata = {
> .pcat_compat_init = xen_pcat_compat_init,
> .__get_irq_chip = xen_iosapic_get_irq_chip,
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-06 18:57 ` Jeremy Fitzhardinge
@ 2008-11-06 19:15 ` Takashi Iwai
2008-11-06 21:48 ` Sam Ravnborg
1 sibling, 0 replies; 13+ messages in thread
From: Takashi Iwai @ 2008-11-06 19:15 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Tony Luck, Isaku Yamahata, linux-kernel, Sam Ravnborg
At Thu, 06 Nov 2008 10:57:21 -0800,
Jeremy Fitzhardinge wrote:
>
> Takashi Iwai wrote:
> > __initdata and const cannot be always a happy pair, as gcc-4.3.3 gives
> > the compile errors like:
> >
> > arch/ia64/xen/xen_pv_ops.c:156: error: xen_init_ops causes a section type conflict
> > arch/ia64/xen/xen_pv_ops.c:340: error: xen_iosapic_ops causes a section type conflict
> >
> > This patch simply removes const from data with __initdata.
> >
>
> Yeah, I've seen these sort of messages before, but I don't see why
> there's an inherent problem with having const __initdata.
Oh, wait; just looking through linux/init.h, I see we have now
__initconst. Maybe this is the right choice?
This would be better documented somewhere in Documentation/*...
thanks,
Takashi
>
> Sam?
>
> J
>
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> >
> > ---
> > diff --git a/arch/ia64/xen/xen_pv_ops.c b/arch/ia64/xen/xen_pv_ops.c
> > index 04cd123..5d491d9 100644
> > --- a/arch/ia64/xen/xen_pv_ops.c
> > +++ b/arch/ia64/xen/xen_pv_ops.c
> > @@ -153,7 +153,7 @@ xen_post_smp_prepare_boot_cpu(void)
> > xen_setup_vcpu_info_placement();
> > }
> >
> > -static const struct pv_init_ops xen_init_ops __initdata = {
> > +static struct pv_init_ops xen_init_ops __initdata = {
> > .banner = xen_banner,
> >
> > .reserve_memory = xen_reserve_memory,
> > @@ -260,7 +260,7 @@ xen_intrin_local_irq_restore(unsigned long mask)
> > xen_rsm_i();
> > }
> >
> > -static const struct pv_cpu_ops xen_cpu_ops __initdata = {
> > +static struct pv_cpu_ops xen_cpu_ops __initdata = {
> > .fc = xen_fc,
> > .thash = xen_thash,
> > .get_cpuid = xen_get_cpuid,
> > @@ -337,7 +337,7 @@ xen_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
> > HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op);
> > }
> >
> > -static const struct pv_iosapic_ops xen_iosapic_ops __initdata = {
> > +static struct pv_iosapic_ops xen_iosapic_ops __initdata = {
> > .pcat_compat_init = xen_pcat_compat_init,
> > .__get_irq_chip = xen_iosapic_get_irq_chip,
> >
> >
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-06 18:57 ` Jeremy Fitzhardinge
2008-11-06 19:15 ` Takashi Iwai
@ 2008-11-06 21:48 ` Sam Ravnborg
2008-11-11 7:51 ` Takashi Iwai
1 sibling, 1 reply; 13+ messages in thread
From: Sam Ravnborg @ 2008-11-06 21:48 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Takashi Iwai, Tony Luck, Isaku Yamahata, linux-kernel
On Thu, Nov 06, 2008 at 10:57:21AM -0800, Jeremy Fitzhardinge wrote:
> Takashi Iwai wrote:
> >__initdata and const cannot be always a happy pair, as gcc-4.3.3 gives
> >the compile errors like:
> >
> > arch/ia64/xen/xen_pv_ops.c:156: error: xen_init_ops causes a section
> > type conflict
> > arch/ia64/xen/xen_pv_ops.c:340: error: xen_iosapic_ops causes a section
> > type conflict
> >
> >This patch simply removes const from data with __initdata.
> >
>
> Yeah, I've seen these sort of messages before, but I don't see why
> there's an inherent problem with having const __initdata.
>
> Sam?
The root problem here is that in some cases gcc will stuff this into
a section marked CONST and in other cases not.
So when we manually specify the section we better not mix const and
non-const stuff in the same section.
The problem is that it is very gcc dependent. I have with powerpc
seen that the same code was not put in CONST with a 32 bit build,
but with the 64 bit build it was.
The only cure was to remove the const and use initdata.
You can try to play with initconst - and it may work.
But you need to have pretty good build coverage to be sure.
Sam
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-06 21:48 ` Sam Ravnborg
@ 2008-11-11 7:51 ` Takashi Iwai
2008-11-11 8:15 ` Isaku Yamahata
0 siblings, 1 reply; 13+ messages in thread
From: Takashi Iwai @ 2008-11-11 7:51 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Jeremy Fitzhardinge, Tony Luck, Isaku Yamahata, linux-kernel
At Thu, 6 Nov 2008 22:48:48 +0100,
Sam Ravnborg wrote:
>
> On Thu, Nov 06, 2008 at 10:57:21AM -0800, Jeremy Fitzhardinge wrote:
> > Takashi Iwai wrote:
> > >__initdata and const cannot be always a happy pair, as gcc-4.3.3 gives
> > >the compile errors like:
> > >
> > > arch/ia64/xen/xen_pv_ops.c:156: error: xen_init_ops causes a section
> > > type conflict
> > > arch/ia64/xen/xen_pv_ops.c:340: error: xen_iosapic_ops causes a section
> > > type conflict
> > >
> > >This patch simply removes const from data with __initdata.
> > >
> >
> > Yeah, I've seen these sort of messages before, but I don't see why
> > there's an inherent problem with having const __initdata.
> >
> > Sam?
>
> The root problem here is that in some cases gcc will stuff this into
> a section marked CONST and in other cases not.
> So when we manually specify the section we better not mix const and
> non-const stuff in the same section.
> The problem is that it is very gcc dependent. I have with powerpc
> seen that the same code was not put in CONST with a 32 bit build,
> but with the 64 bit build it was.
> The only cure was to remove the const and use initdata.
> You can try to play with initconst - and it may work.
> But you need to have pretty good build coverage to be sure.
OK, then my original patch should do right :)
Do you guys see any problems with it?
Right now 2.6.28-rc kernel doesn't build, thus this is basically a
regression.
thanks,
Takashi
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-11 7:51 ` Takashi Iwai
@ 2008-11-11 8:15 ` Isaku Yamahata
2008-11-11 8:18 ` Takashi Iwai
0 siblings, 1 reply; 13+ messages in thread
From: Isaku Yamahata @ 2008-11-11 8:15 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Sam Ravnborg, Jeremy Fitzhardinge, Tony Luck, linux-kernel
On Tue, Nov 11, 2008 at 08:51:11AM +0100, Takashi Iwai wrote:
> At Thu, 6 Nov 2008 22:48:48 +0100,
> Sam Ravnborg wrote:
> >
> > On Thu, Nov 06, 2008 at 10:57:21AM -0800, Jeremy Fitzhardinge wrote:
> > > Takashi Iwai wrote:
> > > >__initdata and const cannot be always a happy pair, as gcc-4.3.3 gives
> > > >the compile errors like:
> > > >
> > > > arch/ia64/xen/xen_pv_ops.c:156: error: xen_init_ops causes a section
> > > > type conflict
> > > > arch/ia64/xen/xen_pv_ops.c:340: error: xen_iosapic_ops causes a section
> > > > type conflict
> > > >
> > > >This patch simply removes const from data with __initdata.
> > > >
> > >
> > > Yeah, I've seen these sort of messages before, but I don't see why
> > > there's an inherent problem with having const __initdata.
> > >
> > > Sam?
> >
> > The root problem here is that in some cases gcc will stuff this into
> > a section marked CONST and in other cases not.
> > So when we manually specify the section we better not mix const and
> > non-const stuff in the same section.
> > The problem is that it is very gcc dependent. I have with powerpc
> > seen that the same code was not put in CONST with a 32 bit build,
> > but with the 64 bit build it was.
> > The only cure was to remove the const and use initdata.
> > You can try to play with initconst - and it may work.
> > But you need to have pretty good build coverage to be sure.
>
> OK, then my original patch should do right :)
> Do you guys see any problems with it?
>
> Right now 2.6.28-rc kernel doesn't build, thus this is basically a
> regression.
I'm fine with the patch.
The above sounds x86 xen potentially has the same issue, though.
linux-2.6/arch/x86/xen $ grep __initdata *
enlighten.c:static const struct pv_info xen_info __initdata = {
enlighten.c:static const struct pv_init_ops xen_init_ops __initdata = {
enlighten.c:static const struct pv_time_ops xen_time_ops __initdata = {
enlighten.c:static const struct pv_cpu_ops xen_cpu_ops __initdata = {
enlighten.c:static const struct pv_apic_ops xen_apic_ops __initdata = {
enlighten.c:static const struct pv_mmu_ops xen_mmu_ops __initdata = {
enlighten.c:static const struct machine_ops __initdata xen_machine_ops = {
irq.c:static const struct pv_irq_ops xen_irq_ops __initdata = {
smp.c:static const struct smp_ops xen_smp_ops __initdata = {
thanks,
--
yamahata
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-11 8:15 ` Isaku Yamahata
@ 2008-11-11 8:18 ` Takashi Iwai
2008-11-11 8:56 ` Isaku Yamahata
0 siblings, 1 reply; 13+ messages in thread
From: Takashi Iwai @ 2008-11-11 8:18 UTC (permalink / raw)
To: Isaku Yamahata; +Cc: Sam Ravnborg, Jeremy Fitzhardinge, Tony Luck, linux-kernel
At Tue, 11 Nov 2008 17:15:52 +0900,
Isaku Yamahata wrote:
>
> On Tue, Nov 11, 2008 at 08:51:11AM +0100, Takashi Iwai wrote:
> > At Thu, 6 Nov 2008 22:48:48 +0100,
> > Sam Ravnborg wrote:
> > >
> > > On Thu, Nov 06, 2008 at 10:57:21AM -0800, Jeremy Fitzhardinge wrote:
> > > > Takashi Iwai wrote:
> > > > >__initdata and const cannot be always a happy pair, as gcc-4.3.3 gives
> > > > >the compile errors like:
> > > > >
> > > > > arch/ia64/xen/xen_pv_ops.c:156: error: xen_init_ops causes a section
> > > > > type conflict
> > > > > arch/ia64/xen/xen_pv_ops.c:340: error: xen_iosapic_ops causes a section
> > > > > type conflict
> > > > >
> > > > >This patch simply removes const from data with __initdata.
> > > > >
> > > >
> > > > Yeah, I've seen these sort of messages before, but I don't see why
> > > > there's an inherent problem with having const __initdata.
> > > >
> > > > Sam?
> > >
> > > The root problem here is that in some cases gcc will stuff this into
> > > a section marked CONST and in other cases not.
> > > So when we manually specify the section we better not mix const and
> > > non-const stuff in the same section.
> > > The problem is that it is very gcc dependent. I have with powerpc
> > > seen that the same code was not put in CONST with a 32 bit build,
> > > but with the 64 bit build it was.
> > > The only cure was to remove the const and use initdata.
> > > You can try to play with initconst - and it may work.
> > > But you need to have pretty good build coverage to be sure.
> >
> > OK, then my original patch should do right :)
> > Do you guys see any problems with it?
> >
> > Right now 2.6.28-rc kernel doesn't build, thus this is basically a
> > regression.
>
> I'm fine with the patch.
>
> The above sounds x86 xen potentially has the same issue, though.
>
> linux-2.6/arch/x86/xen $ grep __initdata *
> enlighten.c:static const struct pv_info xen_info __initdata = {
> enlighten.c:static const struct pv_init_ops xen_init_ops __initdata = {
> enlighten.c:static const struct pv_time_ops xen_time_ops __initdata = {
> enlighten.c:static const struct pv_cpu_ops xen_cpu_ops __initdata = {
> enlighten.c:static const struct pv_apic_ops xen_apic_ops __initdata = {
> enlighten.c:static const struct pv_mmu_ops xen_mmu_ops __initdata = {
> enlighten.c:static const struct machine_ops __initdata xen_machine_ops = {
> irq.c:static const struct pv_irq_ops xen_irq_ops __initdata = {
> smp.c:static const struct smp_ops xen_smp_ops __initdata = {
Oh, care to create a patch?
thanks,
Takashi
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-11 8:18 ` Takashi Iwai
@ 2008-11-11 8:56 ` Isaku Yamahata
2008-11-11 17:43 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 13+ messages in thread
From: Isaku Yamahata @ 2008-11-11 8:56 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Sam Ravnborg, Jeremy Fitzhardinge, Tony Luck, linux-kernel
On Tue, Nov 11, 2008 at 09:18:50AM +0100, Takashi Iwai wrote:
> At Tue, 11 Nov 2008 17:15:52 +0900,
> Isaku Yamahata wrote:
> >
> > On Tue, Nov 11, 2008 at 08:51:11AM +0100, Takashi Iwai wrote:
> > > At Thu, 6 Nov 2008 22:48:48 +0100,
> > > Sam Ravnborg wrote:
> > > >
> > > > On Thu, Nov 06, 2008 at 10:57:21AM -0800, Jeremy Fitzhardinge wrote:
> > > > > Takashi Iwai wrote:
> > > > > >__initdata and const cannot be always a happy pair, as gcc-4.3.3 gives
> > > > > >the compile errors like:
> > > > > >
> > > > > > arch/ia64/xen/xen_pv_ops.c:156: error: xen_init_ops causes a section
> > > > > > type conflict
> > > > > > arch/ia64/xen/xen_pv_ops.c:340: error: xen_iosapic_ops causes a section
> > > > > > type conflict
> > > > > >
> > > > > >This patch simply removes const from data with __initdata.
> > > > > >
> > > > >
> > > > > Yeah, I've seen these sort of messages before, but I don't see why
> > > > > there's an inherent problem with having const __initdata.
> > > > >
> > > > > Sam?
> > > >
> > > > The root problem here is that in some cases gcc will stuff this into
> > > > a section marked CONST and in other cases not.
> > > > So when we manually specify the section we better not mix const and
> > > > non-const stuff in the same section.
> > > > The problem is that it is very gcc dependent. I have with powerpc
> > > > seen that the same code was not put in CONST with a 32 bit build,
> > > > but with the 64 bit build it was.
> > > > The only cure was to remove the const and use initdata.
> > > > You can try to play with initconst - and it may work.
> > > > But you need to have pretty good build coverage to be sure.
> > >
> > > OK, then my original patch should do right :)
> > > Do you guys see any problems with it?
> > >
> > > Right now 2.6.28-rc kernel doesn't build, thus this is basically a
> > > regression.
> >
> > I'm fine with the patch.
> >
> > The above sounds x86 xen potentially has the same issue, though.
> >
> > linux-2.6/arch/x86/xen $ grep __initdata *
> > enlighten.c:static const struct pv_info xen_info __initdata = {
> > enlighten.c:static const struct pv_init_ops xen_init_ops __initdata = {
> > enlighten.c:static const struct pv_time_ops xen_time_ops __initdata = {
> > enlighten.c:static const struct pv_cpu_ops xen_cpu_ops __initdata = {
> > enlighten.c:static const struct pv_apic_ops xen_apic_ops __initdata = {
> > enlighten.c:static const struct pv_mmu_ops xen_mmu_ops __initdata = {
> > enlighten.c:static const struct machine_ops __initdata xen_machine_ops = {
> > irq.c:static const struct pv_irq_ops xen_irq_ops __initdata = {
> > smp.c:static const struct smp_ops xen_smp_ops __initdata = {
>
> Oh, care to create a patch?
Here is.
__initdata and const cannot be always a happy pair and
x86 xen has the potential issue.
This patch simply removes const from data with __initdata
under arch/x86/xen/.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 0013a72..19f758c 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1173,14 +1173,14 @@ static void xen_set_fixmap(unsigned idx, unsigned long phys, pgprot_t prot)
#endif
}
-static const struct pv_info xen_info __initdata = {
+static struct pv_info xen_info __initdata = {
.paravirt_enabled = 1,
.shared_kernel_pmd = 0,
.name = "Xen",
};
-static const struct pv_init_ops xen_init_ops __initdata = {
+static struct pv_init_ops xen_init_ops __initdata = {
.patch = xen_patch,
.banner = xen_banner,
@@ -1189,7 +1189,7 @@ static const struct pv_init_ops xen_init_ops __initdata = {
.post_allocator_init = xen_post_allocator_init,
};
-static const struct pv_time_ops xen_time_ops __initdata = {
+static struct pv_time_ops xen_time_ops __initdata = {
.time_init = xen_time_init,
.set_wallclock = xen_set_wallclock,
@@ -1198,7 +1198,7 @@ static const struct pv_time_ops xen_time_ops __initdata = {
.sched_clock = xen_sched_clock,
};
-static const struct pv_cpu_ops xen_cpu_ops __initdata = {
+static struct pv_cpu_ops xen_cpu_ops __initdata = {
.cpuid = xen_cpuid,
.set_debugreg = xen_set_debugreg,
@@ -1260,7 +1260,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
},
};
-static const struct pv_apic_ops xen_apic_ops __initdata = {
+static struct pv_apic_ops xen_apic_ops __initdata = {
#ifdef CONFIG_X86_LOCAL_APIC
.setup_boot_clock = paravirt_nop,
.setup_secondary_clock = paravirt_nop,
@@ -1268,7 +1268,7 @@ static const struct pv_apic_ops xen_apic_ops __initdata = {
#endif
};
-static const struct pv_mmu_ops xen_mmu_ops __initdata = {
+static struct pv_mmu_ops xen_mmu_ops __initdata = {
.pagetable_setup_start = xen_pagetable_setup_start,
.pagetable_setup_done = xen_pagetable_setup_done,
@@ -1381,7 +1381,7 @@ static void xen_crash_shutdown(struct pt_regs *regs)
xen_reboot(SHUTDOWN_crash);
}
-static const struct machine_ops __initdata xen_machine_ops = {
+static struct machine_ops __initdata xen_machine_ops = {
.restart = xen_restart,
.halt = xen_machine_halt,
.power_off = xen_machine_halt,
diff --git a/arch/x86/xen/irq.c b/arch/x86/xen/irq.c
index 28b85ab..ffadf3a 100644
--- a/arch/x86/xen/irq.c
+++ b/arch/x86/xen/irq.c
@@ -124,7 +124,7 @@ static void xen_halt(void)
xen_safe_halt();
}
-static const struct pv_irq_ops xen_irq_ops __initdata = {
+static struct pv_irq_ops xen_irq_ops __initdata = {
.init_IRQ = __xen_init_IRQ,
.save_fl = xen_save_fl,
.restore_fl = xen_restore_fl,
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index d77da61..f0a1ea3 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -466,7 +466,7 @@ static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
-static const struct smp_ops xen_smp_ops __initdata = {
+static struct smp_ops xen_smp_ops __initdata = {
.smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu,
.smp_prepare_cpus = xen_smp_prepare_cpus,
.smp_cpus_done = xen_smp_cpus_done,
--
yamahata
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-11 8:56 ` Isaku Yamahata
@ 2008-11-11 17:43 ` Jeremy Fitzhardinge
2008-11-11 17:45 ` Takashi Iwai
0 siblings, 1 reply; 13+ messages in thread
From: Jeremy Fitzhardinge @ 2008-11-11 17:43 UTC (permalink / raw)
To: Isaku Yamahata; +Cc: Takashi Iwai, Sam Ravnborg, Tony Luck, linux-kernel
Isaku Yamahata wrote:
> Here is.
>
> __initdata and const cannot be always a happy pair and
> x86 xen has the potential issue.
> This patch simply removes const from data with __initdata
> under arch/x86/xen/.
>
No, I think the proper fix is to use __initconst.
J
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-11 17:43 ` Jeremy Fitzhardinge
@ 2008-11-11 17:45 ` Takashi Iwai
2008-11-11 18:47 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 13+ messages in thread
From: Takashi Iwai @ 2008-11-11 17:45 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Isaku Yamahata, Sam Ravnborg, Tony Luck, linux-kernel
At Tue, 11 Nov 2008 09:43:27 -0800,
Jeremy Fitzhardinge wrote:
>
> Isaku Yamahata wrote:
> > Here is.
> >
> > __initdata and const cannot be always a happy pair and
> > x86 xen has the potential issue.
> > This patch simply removes const from data with __initdata
> > under arch/x86/xen/.
> >
>
> No, I think the proper fix is to use __initconst.
The problem is that it depends on gcc version which section it goes.
Thus __initconst could break some gcc versions as well.
Takashi
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-11 17:45 ` Takashi Iwai
@ 2008-11-11 18:47 ` Jeremy Fitzhardinge
2008-11-11 19:04 ` Takashi Iwai
0 siblings, 1 reply; 13+ messages in thread
From: Jeremy Fitzhardinge @ 2008-11-11 18:47 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Isaku Yamahata, Sam Ravnborg, Tony Luck, linux-kernel
Takashi Iwai wrote:
> At Tue, 11 Nov 2008 09:43:27 -0800,
> Jeremy Fitzhardinge wrote:
>
>> Isaku Yamahata wrote:
>>
>>> Here is.
>>>
>>> __initdata and const cannot be always a happy pair and
>>> x86 xen has the potential issue.
>>> This patch simply removes const from data with __initdata
>>> under arch/x86/xen/.
>>>
>>>
>> No, I think the proper fix is to use __initconst.
>>
>
> The problem is that it depends on gcc version which section it goes.
> Thus __initconst could break some gcc versions as well.
>
Why? __initconst explicitly puts it in .init.rodata.
J
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-11 18:47 ` Jeremy Fitzhardinge
@ 2008-11-11 19:04 ` Takashi Iwai
2008-11-12 18:19 ` Sam Ravnborg
0 siblings, 1 reply; 13+ messages in thread
From: Takashi Iwai @ 2008-11-11 19:04 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Isaku Yamahata, Jeremy Fitzhardinge, Tony Luck, linux-kernel
At Tue, 11 Nov 2008 10:47:24 -0800,
Jeremy Fitzhardinge wrote:
>
> Takashi Iwai wrote:
> > At Tue, 11 Nov 2008 09:43:27 -0800,
> > Jeremy Fitzhardinge wrote:
> >
> >> Isaku Yamahata wrote:
> >>
> >>> Here is.
> >>>
> >>> __initdata and const cannot be always a happy pair and
> >>> x86 xen has the potential issue.
> >>> This patch simply removes const from data with __initdata
> >>> under arch/x86/xen/.
> >>>
> >>>
> >> No, I think the proper fix is to use __initconst.
> >>
> >
> > The problem is that it depends on gcc version which section it goes.
> > Thus __initconst could break some gcc versions as well.
> >
>
> Why? __initconst explicitly puts it in .init.rodata.
Hrm, right, that's what __initconst does. Just confused.
Then I'm wondering in which case __initconst can be broken...
Sam? Do you have any particular reports?
Takashi
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c
2008-11-11 19:04 ` Takashi Iwai
@ 2008-11-12 18:19 ` Sam Ravnborg
0 siblings, 0 replies; 13+ messages in thread
From: Sam Ravnborg @ 2008-11-12 18:19 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Isaku Yamahata, Jeremy Fitzhardinge, Tony Luck, linux-kernel
On Tue, Nov 11, 2008 at 08:04:30PM +0100, Takashi Iwai wrote:
> At Tue, 11 Nov 2008 10:47:24 -0800,
> Jeremy Fitzhardinge wrote:
> >
> > Takashi Iwai wrote:
> > > At Tue, 11 Nov 2008 09:43:27 -0800,
> > > Jeremy Fitzhardinge wrote:
> > >
> > >> Isaku Yamahata wrote:
> > >>
> > >>> Here is.
> > >>>
> > >>> __initdata and const cannot be always a happy pair and
> > >>> x86 xen has the potential issue.
> > >>> This patch simply removes const from data with __initdata
> > >>> under arch/x86/xen/.
> > >>>
> > >>>
> > >> No, I think the proper fix is to use __initconst.
> > >>
> > >
> > > The problem is that it depends on gcc version which section it goes.
> > > Thus __initconst could break some gcc versions as well.
> > >
> >
> > Why? __initconst explicitly puts it in .init.rodata.
>
> Hrm, right, that's what __initconst does. Just confused.
> Then I'm wondering in which case __initconst can be broken...
> Sam? Do you have any particular reports?
I have only got reports that __initconst causes gcc build failure
on powerpc 64 bit.
So for x86 it should be safe to use __initconst.
Sam
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-11-12 18:18 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-06 16:48 [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c Takashi Iwai
2008-11-06 18:57 ` Jeremy Fitzhardinge
2008-11-06 19:15 ` Takashi Iwai
2008-11-06 21:48 ` Sam Ravnborg
2008-11-11 7:51 ` Takashi Iwai
2008-11-11 8:15 ` Isaku Yamahata
2008-11-11 8:18 ` Takashi Iwai
2008-11-11 8:56 ` Isaku Yamahata
2008-11-11 17:43 ` Jeremy Fitzhardinge
2008-11-11 17:45 ` Takashi Iwai
2008-11-11 18:47 ` Jeremy Fitzhardinge
2008-11-11 19:04 ` Takashi Iwai
2008-11-12 18:19 ` 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).