From: Ingo Molnar Subject: Re: [PATCH 02/18] xen: hook io_apic read/write operations Date: Sat, 9 May 2009 10:42:01 +0200 Message-ID: <20090509084201.GF3656@elte.hu> References: <1241730883-4917-1-git-send-email-jeremy@goop.org> <1241730883-4917-3-git-send-email-jeremy@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1241730883-4917-3-git-send-email-jeremy@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: Xen-devel , the arch/x86 maintainers , Linux Kernel Mailing List , Jeremy Fitzhardinge List-Id: xen-devel@lists.xenproject.org * Jeremy Fitzhardinge wrote: > --- a/arch/x86/kernel/apic/io_apic.c > +++ b/arch/x86/kernel/apic/io_apic.c > @@ -62,8 +62,10 @@ > #include > #include > > +#include > #include > > + > #define __apicdebuginit(type) static type __init > > /* > @@ -407,14 +409,26 @@ static inline void io_apic_eoi(unsigned int apic, unsigned int vector) > > static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) > { > - struct io_apic __iomem *io_apic = io_apic_base(apic); > + struct io_apic __iomem *io_apic; > + > + if (xen_initial_domain()) > + return xen_io_apic_read(apic, reg); hm, any reason why we dont want to create a 'struct io_apic' driver abstraction instead of spreading xen_initial_domain() checks all around the code? Ingo