From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/d545a95fca73
-# HG changeset 746+749 patch
+# HG changeset 746+749+751+760 patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1227879027 0
# Node ID d545a95fca739d0b1963b73a9eb64ea64a244e76
Subject: evtchn: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
-Index: head-2008-12-01/drivers/xen/core/evtchn.c
-===================================================================
---- head-2008-12-01.orig/drivers/xen/core/evtchn.c 2008-12-01 11:22:35.000000000 +0100
-+++ head-2008-12-01/drivers/xen/core/evtchn.c 2008-12-01 11:23:06.000000000 +0100
-@@ -123,9 +123,6 @@ DEFINE_PER_CPU(int, ipi_to_irq[NR_IPIS])
+From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/ca213a56dba1
+Subject: evtchn, phydev: rename PHYSDEVOP_pirq_eoi_mfn to PHYSDEVOP_pirq_eoi_gmfn
+
+Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
+Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
+
+From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/0d10be086a78
+Subject: 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>
+
+--- head-2008-12-15.orig/drivers/xen/core/evtchn.c 2008-11-10 11:44:21.000000000 +0100
++++ head-2008-12-15/drivers/xen/core/evtchn.c 2008-12-15 11:06:31.000000000 +0100
+@@ -35,6 +35,7 @@
+ #include <linux/interrupt.h>
+ #include <linux/sched.h>
+ #include <linux/kernel_stat.h>
++#include <linux/bootmem.h>
+ #include <linux/version.h>
+ #include <asm/atomic.h>
+ #include <asm/system.h>
+@@ -123,9 +124,6 @@ DEFINE_PER_CPU(int, ipi_to_irq[NR_IPIS])
/* Reference counts for bindings to IRQs. */
static int irq_bindcount[NR_IRQS];
#ifdef CONFIG_SMP
static u8 cpu_evtchn[NR_EVENT_CHANNELS];
-@@ -756,16 +753,48 @@ static struct hw_interrupt_type dynirq_t
+@@ -756,16 +754,47 @@ static struct hw_interrupt_type dynirq_t
.retrigger = resend_irq_on_evtchn,
};
-static inline void pirq_unmask_notify(int irq)
+/* 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)
{
init_evtchn_cpu_bindings();
+ if (pirq_eoi_does_unmask) {
-+ struct physdev_pirq_eoi_mfn eoi_mfn;
++ struct physdev_pirq_eoi_gmfn eoi_gmfn;
+
-+ eoi_mfn.mfn = virt_to_bus(pirq_needs_eoi) >> PAGE_SHIFT;
-+ if (HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_mfn, &eoi_mfn))
++ eoi_gmfn.gmfn = virt_to_machine(pirq_needs_eoi) >> PAGE_SHIFT;
++ if (HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn, &eoi_gmfn))
+ BUG();
+ }
+
/* New event-channel space is not 'live' yet. */
for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++)
mask_evtchn(evtchn);
-@@ -1098,9 +1132,15 @@ int evtchn_get_xen_pirq(int irq)
+@@ -1098,9 +1132,16 @@ int evtchn_get_xen_pirq(int irq)
void __init xen_init_IRQ(void)
{
unsigned int i;
-+ struct physdev_pirq_eoi_mfn eoi_mfn;
++ struct physdev_pirq_eoi_gmfn eoi_gmfn;
init_evtchn_cpu_bindings();
-+ BUG_ON(!bitmap_empty(pirq_needs_eoi, PAGE_SIZE * 8));
-+ eoi_mfn.mfn = virt_to_bus(pirq_needs_eoi) >> PAGE_SHIFT;
-+ if (HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_mfn, &eoi_mfn) == 0)
++ 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;
+
/* No event channels are 'live' right now. */
for (i = 0; i < NR_EVENT_CHANNELS; i++)
mask_evtchn(i);
-Index: head-2008-12-01/include/xen/interface/physdev.h
-===================================================================
---- head-2008-12-01.orig/include/xen/interface/physdev.h 2008-12-01 11:22:59.000000000 +0100
-+++ head-2008-12-01/include/xen/interface/physdev.h 2008-12-01 11:23:06.000000000 +0100
+--- head-2008-12-15.orig/include/xen/interface/physdev.h 2008-11-25 12:35:56.000000000 +0100
++++ head-2008-12-15/include/xen/interface/physdev.h 2008-12-08 13:22:39.000000000 +0100
@@ -41,6 +41,21 @@ typedef struct physdev_eoi physdev_eoi_t
DEFINE_XEN_GUEST_HANDLE(physdev_eoi_t);
+ * will automatically get unmasked. The page registered is used as a bit
+ * array indexed by Xen's PIRQ value.
+ */
-+#define PHYSDEVOP_pirq_eoi_mfn 17
-+struct physdev_pirq_eoi_mfn {
++#define PHYSDEVOP_pirq_eoi_gmfn 17
++struct physdev_pirq_eoi_gmfn {
+ /* IN */
-+ xen_pfn_t mfn;
++ xen_pfn_t gmfn;
+};
-+typedef struct physdev_pirq_eoi_mfn physdev_pirq_eoi_mfn_t;
-+DEFINE_XEN_GUEST_HANDLE(physdev_pirq_eoi_mfn_t);
++typedef struct physdev_pirq_eoi_gmfn physdev_pirq_eoi_gmfn_t;
++DEFINE_XEN_GUEST_HANDLE(physdev_pirq_eoi_gmfn_t);
+
+/*
* Query the status of an IRQ line.