From 188a406a4f80cdf791d9637b018f973efe3413f1 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 10 Dec 2008 13:31:38 +0000 Subject: [PATCH] linux/evtchn: allocate pirq_needs_eoi bitmap dynamically Original patch from: Isaku Yamahata Signed-off-by: Jan Beulich --- drivers/xen/core/evtchn.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/xen/core/evtchn.c b/drivers/xen/core/evtchn.c index 53296932..e5c633df 100644 --- a/drivers/xen/core/evtchn.c +++ b/drivers/xen/core/evtchn.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -755,8 +756,7 @@ static struct hw_interrupt_type dynirq_type = { /* 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; 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; - eoi_gmfn.gmfn = arbitrary_virt_to_machine(pirq_needs_eoi) - >> PAGE_SHIFT; + eoi_gmfn.gmfn = virt_to_machine(pirq_needs_eoi) >> PAGE_SHIFT; if (HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn, &eoi_gmfn)) BUG(); } @@ -1137,9 +1136,9 @@ void __init xen_init_IRQ(void) init_evtchn_cpu_bindings(); - BUG_ON(!bitmap_empty(pirq_needs_eoi, PAGE_SIZE * 8)); - eoi_gmfn.gmfn = arbitrary_virt_to_machine(pirq_needs_eoi) - >> PAGE_SHIFT; + pirq_needs_eoi = alloc_bootmem_pages(sizeof(unsigned long) + * BITS_TO_LONGS(ALIGN(NR_PIRQS, PAGE_SIZE * 8))); + eoi_gmfn.gmfn = virt_to_machine(pirq_needs_eoi) >> PAGE_SHIFT; if (HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn, &eoi_gmfn) == 0) pirq_eoi_does_unmask = 1; -- 2.39.5