From: Konrad Rzeszutek Wilk Subject: Re: [GIT PULL] stable/for-ingo-v3.5 of IOAPIC abstraction (and then some users) for v3.5 Date: Tue, 1 May 2012 16:26:40 -0400 Message-ID: <20120501202640.GB16209@phenom.dumpdata.com> References: <20120501194240.GA15237@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Josh Boyer Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com, mingo@kernel.org, suresh.b.siddha@intel.com, mlin@ss.pku.edu.cn List-Id: xen-devel@lists.xenproject.org On Tue, May 01, 2012 at 04:08:19PM -0400, Josh Boyer wrote: > On Tue, May 1, 2012 at 3:42 PM, Konrad Rzeszutek Wilk > wrote: > > -static void __init __ioapic_init_mappings(void) > > +void __init native_io_apic_init_mappings(void) > > =A0{ > > =A0 =A0 =A0 =A0unsigned long ioapic_phys, idx =3D FIX_IO_APIC_BASE_= 0; > > =A0 =A0 =A0 =A0struct resource *ioapic_res; > > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > > index 1a29015..8526317 100644 > > --- a/arch/x86/kernel/setup.c > > +++ b/arch/x86/kernel/setup.c > > @@ -1012,7 +1012,7 @@ void __init setup_arch(char **cmdline_p) > > =A0 =A0 =A0 =A0init_cpu_to_node(); > > > > =A0 =A0 =A0 =A0init_apic_mappings(); > > - =A0 =A0 =A0 ioapic_and_gsi_init(); > > + =A0 =A0 =A0 x86_io_apic_ops.init(); > > > > =A0 =A0 =A0 =A0kvm_guest_init(); > > > > diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.= c > > index 9cf71d0..35c5e54 100644 > > --- a/arch/x86/kernel/x86_init.c > > +++ b/arch/x86/kernel/x86_init.c > > @@ -18,6 +18,7 @@ > > =A0#include > > =A0#include > > =A0#include > > +#include > > =A0#include > > =A0#include > > =A0#include > > @@ -119,3 +120,10 @@ struct x86_msi_ops x86_msi =3D { > > =A0 =A0 =A0 =A0.teardown_msi_irqs =3D default_teardown_msi_irqs, > > =A0 =A0 =A0 =A0.restore_msi_irqs =3D default_restore_msi_irqs, > > =A0}; > > + > > +struct x86_io_apic_ops x86_io_apic_ops =3D { > > + =A0 =A0 =A0 .init =A0 =3D native_io_apic_init_mappings, > > + =A0 =A0 =A0 .read =A0 =3D native_io_apic_read, > > + =A0 =A0 =A0 .write =A0=3D native_io_apic_write, > > + =A0 =A0 =A0 .modify =3D native_io_apic_modify, > > +}; >=20 > You'll get a section mismatch warning on this struct. It's not a hug= e > deal, but native_io_apic_init_mappings is annotated as __init whereas > this struct isn't. In practice it doesn't seem to matter as > x86_io_apic_ops.init is only called in setup_arch, but it's still a > valid warning. I think that the mismatch disappears if the structure has the word _ops in it. At least that is what I saw (when I ran with the MODULE_SEC= TION=3Dy with the initial implementation of this and then fixed it up). However, let me double check - I might have seen that with something else and misremebered it. >=20 > (First noticed in https://bugzilla.redhat.com/show_bug.cgi?id=3D81764= 5 ) >=20 > josh