ia64/linux-2.6.18-xen.hg

changeset 760:0d10be086a78

linux/evtchn: allocate pirq_needs_eoi bitmap dynamically

Original patch from: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Dec 10 13:31:38 2008 +0000 (2008-12-10)
parents 2fa1d9446f2f
children 5e1269aa5c29
files drivers/xen/core/evtchn.c
line diff
     1.1 --- a/drivers/xen/core/evtchn.c	Wed Dec 10 13:21:23 2008 +0000
     1.2 +++ b/drivers/xen/core/evtchn.c	Wed Dec 10 13:31:38 2008 +0000
     1.3 @@ -35,6 +35,7 @@
     1.4  #include <linux/interrupt.h>
     1.5  #include <linux/sched.h>
     1.6  #include <linux/kernel_stat.h>
     1.7 +#include <linux/bootmem.h>
     1.8  #include <linux/version.h>
     1.9  #include <asm/atomic.h>
    1.10  #include <asm/system.h>
    1.11 @@ -755,8 +756,7 @@ static struct hw_interrupt_type dynirq_t
    1.12  
    1.13  /* Bitmap indicating which PIRQs require Xen to be notified on unmask. */
    1.14  static int pirq_eoi_does_unmask;
    1.15 -static DECLARE_BITMAP(pirq_needs_eoi, ALIGN(NR_PIRQS, PAGE_SIZE * 8))
    1.16 -	__attribute__ ((__section__(".bss.page_aligned"), __aligned__(PAGE_SIZE)));
    1.17 +static unsigned long *pirq_needs_eoi;
    1.18  
    1.19  static void pirq_unmask_and_notify(unsigned int evtchn, unsigned int irq)
    1.20  {
    1.21 @@ -1041,8 +1041,7 @@ void irq_resume(void)
    1.22  	if (pirq_eoi_does_unmask) {
    1.23  		struct physdev_pirq_eoi_gmfn eoi_gmfn;
    1.24  
    1.25 -		eoi_gmfn.gmfn = arbitrary_virt_to_machine(pirq_needs_eoi)
    1.26 -			>> PAGE_SHIFT;
    1.27 +		eoi_gmfn.gmfn = virt_to_machine(pirq_needs_eoi) >> PAGE_SHIFT;
    1.28  		if (HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn, &eoi_gmfn))
    1.29  			BUG();
    1.30  	}
    1.31 @@ -1137,9 +1136,9 @@ void __init xen_init_IRQ(void)
    1.32  
    1.33  	init_evtchn_cpu_bindings();
    1.34  
    1.35 -	BUG_ON(!bitmap_empty(pirq_needs_eoi, PAGE_SIZE * 8));
    1.36 -	eoi_gmfn.gmfn = arbitrary_virt_to_machine(pirq_needs_eoi)
    1.37 -		>> PAGE_SHIFT;
    1.38 +	pirq_needs_eoi = alloc_bootmem_pages(sizeof(unsigned long)
    1.39 +		* BITS_TO_LONGS(ALIGN(NR_PIRQS, PAGE_SIZE * 8)));
    1.40 + 	eoi_gmfn.gmfn = virt_to_machine(pirq_needs_eoi) >> PAGE_SHIFT;
    1.41  	if (HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn, &eoi_gmfn) == 0)
    1.42  		pirq_eoi_does_unmask = 1;
    1.43