From: "Jan Beulich" Subject: [PATCH] linux/evtchn: allocate pirq_needs_eoi bitmap dynamically Date: Wed, 10 Dec 2008 10:59:12 +0000 Message-ID: <493FAF10.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Isaku Yamahata List-Id: xen-devel@lists.xenproject.org Original patch from: Isaku Yamahata As usual, written and tested on 2.6.27.8 and made apply to the 2.6.18 tree without further testing. Signed-off-by: Jan Beulich --- head-2008-12-08.orig/drivers/xen/core/evtchn.c 2008-12-05 = 10:53:12.000000000 +0100 +++ head-2008-12-08/drivers/xen/core/evtchn.c 2008-12-10 10:47:20.0000000= 00 +0100 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -755,8 +756,7 @@ static struct irq_chip dynirq_chip =3D { =20 /* Bitmap indicating which PIRQs require Xen to be notified on unmask. */ static int pirq_eoi_does_unmask; -static DECLARE_BITMAP(pirq_needs_eoi, ALIGN(NR_PIRQS, PAGE_SIZE * 8)) - __attribute__ ((__section__(".bss.page_aligned"), __aligned__(PAGE_= SIZE))); +static unsigned long *pirq_needs_eoi; =20 static void pirq_unmask_and_notify(unsigned int evtchn, unsigned int irq) { @@ -1041,8 +1041,7 @@ void irq_resume(void) if (pirq_eoi_does_unmask) { struct physdev_pirq_eoi_gmfn eoi_gmfn; =20 - eoi_gmfn.gmfn =3D arbitrary_virt_to_machine(pirq_needs_eoi)= - >> PAGE_SHIFT; + eoi_gmfn.gmfn =3D virt_to_machine(pirq_needs_eoi) >> = PAGE_SHIFT; if (HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn, = &eoi_gmfn)) BUG(); } @@ -1137,9 +1137,9 @@ void __init xen_init_IRQ(void) =20 init_evtchn_cpu_bindings(); =20 - BUG_ON(!bitmap_empty(pirq_needs_eoi, PAGE_SIZE * 8)); - eoi_gmfn.gmfn =3D arbitrary_virt_to_machine(pirq_needs_eoi) - >> PAGE_SHIFT; + pirq_needs_eoi =3D alloc_bootmem_pages(sizeof(unsigned long) + * BITS_TO_LONGS(ALIGN(NR_PIRQS, PAGE_SIZE * 8))); + eoi_gmfn.gmfn =3D virt_to_machine(pirq_needs_eoi) >> PAGE_SHIFT; if (HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn, &eoi_gmfn) = =3D=3D 0) pirq_eoi_does_unmask =3D 1; =20