From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755346AbYKKITB (ORCPT ); Tue, 11 Nov 2008 03:19:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752899AbYKKISw (ORCPT ); Tue, 11 Nov 2008 03:18:52 -0500 Received: from ns2.suse.de ([195.135.220.15]:45691 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752481AbYKKISw (ORCPT ); Tue, 11 Nov 2008 03:18:52 -0500 Date: Tue, 11 Nov 2008 09:18:50 +0100 Message-ID: From: Takashi Iwai To: Isaku Yamahata Cc: Sam Ravnborg , Jeremy Fitzhardinge , Tony Luck , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Fix section type conflict in arch/ia64/xen/xen_pv_ops.c In-Reply-To: <20081111081552.GA10955%yamahata@valinux.co.jp> References: <49133E11.8050607@goop.org> <20081106214848.GA3579@uranus.ravnborg.org> <20081111081552.GA10955%yamahata@valinux.co.jp> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.3 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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