diff options
Diffstat (limited to 'arch/arm/xen')
-rw-r--r-- | arch/arm/xen/enlighten.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 036a4d84e861..bad67ad43c2d 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <xen/xen.h> | 1 | #include <xen/xen.h> |
2 | #include <xen/events.h> | ||
2 | #include <xen/grant_table.h> | 3 | #include <xen/grant_table.h> |
3 | #include <xen/hvm.h> | 4 | #include <xen/hvm.h> |
4 | #include <xen/interface/xen.h> | 5 | #include <xen/interface/xen.h> |
@@ -9,6 +10,8 @@ | |||
9 | #include <xen/xenbus.h> | 10 | #include <xen/xenbus.h> |
10 | #include <asm/xen/hypervisor.h> | 11 | #include <asm/xen/hypervisor.h> |
11 | #include <asm/xen/hypercall.h> | 12 | #include <asm/xen/hypercall.h> |
13 | #include <linux/interrupt.h> | ||
14 | #include <linux/irqreturn.h> | ||
12 | #include <linux/module.h> | 15 | #include <linux/module.h> |
13 | #include <linux/of.h> | 16 | #include <linux/of.h> |
14 | #include <linux/of_irq.h> | 17 | #include <linux/of_irq.h> |
@@ -33,6 +36,8 @@ EXPORT_SYMBOL_GPL(xen_have_vector_callback); | |||
33 | int xen_platform_pci_unplug = XEN_UNPLUG_ALL; | 36 | int xen_platform_pci_unplug = XEN_UNPLUG_ALL; |
34 | EXPORT_SYMBOL_GPL(xen_platform_pci_unplug); | 37 | EXPORT_SYMBOL_GPL(xen_platform_pci_unplug); |
35 | 38 | ||
39 | static __read_mostly int xen_events_irq = -1; | ||
40 | |||
36 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, | 41 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, |
37 | unsigned long addr, | 42 | unsigned long addr, |
38 | unsigned long mfn, int nr, | 43 | unsigned long mfn, int nr, |
@@ -74,6 +79,9 @@ static int __init xen_guest_init(void) | |||
74 | if (of_address_to_resource(node, GRANT_TABLE_PHYSADDR, &res)) | 79 | if (of_address_to_resource(node, GRANT_TABLE_PHYSADDR, &res)) |
75 | return 0; | 80 | return 0; |
76 | xen_hvm_resume_frames = res.start >> PAGE_SHIFT; | 81 | xen_hvm_resume_frames = res.start >> PAGE_SHIFT; |
82 | xen_events_irq = irq_of_parse_and_map(node, 0); | ||
83 | pr_info("Xen %s support found, events_irq=%d gnttab_frame_pfn=%lx\n", | ||
84 | version, xen_events_irq, xen_hvm_resume_frames); | ||
77 | xen_domain_type = XEN_HVM_DOMAIN; | 85 | xen_domain_type = XEN_HVM_DOMAIN; |
78 | 86 | ||
79 | xen_setup_features(); | 87 | xen_setup_features(); |
@@ -115,3 +123,28 @@ static int __init xen_guest_init(void) | |||
115 | return 0; | 123 | return 0; |
116 | } | 124 | } |
117 | core_initcall(xen_guest_init); | 125 | core_initcall(xen_guest_init); |
126 | |||
127 | static irqreturn_t xen_arm_callback(int irq, void *arg) | ||
128 | { | ||
129 | xen_hvm_evtchn_do_upcall(); | ||
130 | return IRQ_HANDLED; | ||
131 | } | ||
132 | |||
133 | static int __init xen_init_events(void) | ||
134 | { | ||
135 | if (!xen_domain() || xen_events_irq < 0) | ||
136 | return -ENODEV; | ||
137 | |||
138 | xen_init_IRQ(); | ||
139 | |||
140 | if (request_percpu_irq(xen_events_irq, xen_arm_callback, | ||
141 | "events", xen_vcpu)) { | ||
142 | pr_err("Error requesting IRQ %d\n", xen_events_irq); | ||
143 | return -EINVAL; | ||
144 | } | ||
145 | |||
146 | enable_percpu_irq(xen_events_irq, 0); | ||
147 | |||
148 | return 0; | ||
149 | } | ||
150 | postcore_initcall(xen_init_events); | ||