aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/xen/events.c13
-rw-r--r--include/asm-x86/xen/events.h22
-rw-r--r--include/xen/events.h8
3 files changed, 30 insertions, 13 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index c50d499b1e6f..2396b4492f70 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -469,7 +469,7 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
469 for_each_online_cpu(i) { 469 for_each_online_cpu(i) {
470 struct vcpu_info *v = per_cpu(xen_vcpu, i); 470 struct vcpu_info *v = per_cpu(xen_vcpu, i);
471 printk("%d: masked=%d pending=%d event_sel %08lx\n ", i, 471 printk("%d: masked=%d pending=%d event_sel %08lx\n ", i,
472 (get_irq_regs() && i == cpu) ? !(get_irq_regs()->flags & X86_EFLAGS_IF) : v->evtchn_upcall_mask, 472 (get_irq_regs() && i == cpu) ? xen_irqs_disabled(get_irq_regs()) : v->evtchn_upcall_mask,
473 v->evtchn_upcall_pending, 473 v->evtchn_upcall_pending,
474 v->evtchn_pending_sel); 474 v->evtchn_pending_sel);
475 } 475 }
@@ -527,7 +527,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
527 if (__get_cpu_var(nesting_count)++) 527 if (__get_cpu_var(nesting_count)++)
528 goto out; 528 goto out;
529 529
530 /* NB. No need for a barrier here -- XCHG is a barrier on x86. */ 530#ifndef CONFIG_X86 /* No need for a barrier -- XCHG is a barrier on x86. */
531 /* Clear master flag /before/ clearing selector flag. */
532 rmb();
533#endif
531 pending_words = xchg(&vcpu_info->evtchn_pending_sel, 0); 534 pending_words = xchg(&vcpu_info->evtchn_pending_sel, 0);
532 while (pending_words != 0) { 535 while (pending_words != 0) {
533 unsigned long pending_bits; 536 unsigned long pending_bits;
@@ -539,10 +542,8 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
539 int port = (word_idx * BITS_PER_LONG) + bit_idx; 542 int port = (word_idx * BITS_PER_LONG) + bit_idx;
540 int irq = evtchn_to_irq[port]; 543 int irq = evtchn_to_irq[port];
541 544
542 if (irq != -1) { 545 if (irq != -1)
543 regs->orig_ax = ~irq; 546 xen_do_IRQ(irq, regs);
544 do_IRQ(regs);
545 }
546 } 547 }
547 } 548 }
548 549
diff --git a/include/asm-x86/xen/events.h b/include/asm-x86/xen/events.h
new file mode 100644
index 000000000000..596312a7bfc9
--- /dev/null
+++ b/include/asm-x86/xen/events.h
@@ -0,0 +1,22 @@
1#ifndef __XEN_EVENTS_H
2#define __XEN_EVENTS_H
3
4enum ipi_vector {
5 XEN_RESCHEDULE_VECTOR,
6 XEN_CALL_FUNCTION_VECTOR,
7
8 XEN_NR_IPIS,
9};
10
11static inline int xen_irqs_disabled(struct pt_regs *regs)
12{
13 return raw_irqs_disabled_flags(regs->flags);
14}
15
16static inline void xen_do_IRQ(int irq, struct pt_regs *regs)
17{
18 regs->orig_ax = ~irq;
19 do_IRQ(regs);
20}
21
22#endif /* __XEN_EVENTS_H */
diff --git a/include/xen/events.h b/include/xen/events.h
index 2bde54d29be5..d99a3e0df880 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -5,13 +5,7 @@
5 5
6#include <xen/interface/event_channel.h> 6#include <xen/interface/event_channel.h>
7#include <asm/xen/hypercall.h> 7#include <asm/xen/hypercall.h>
8 8#include <asm/xen/events.h>
9enum ipi_vector {
10 XEN_RESCHEDULE_VECTOR,
11 XEN_CALL_FUNCTION_VECTOR,
12
13 XEN_NR_IPIS,
14};
15 9
16int bind_evtchn_to_irq(unsigned int evtchn); 10int bind_evtchn_to_irq(unsigned int evtchn);
17int bind_evtchn_to_irqhandler(unsigned int evtchn, 11int bind_evtchn_to_irqhandler(unsigned int evtchn,