Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361872
b: refs/heads/master
c: c26377e
h: refs/heads/master
v: v3
  • Loading branch information
David Vrabel authored and Konrad Rzeszutek Wilk committed Mar 27, 2013
1 parent 6f0fd9c commit 6f8b6a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3eb2c89e7ba996e8781b22a6e7d0a895ef55630
refs/heads/master: c26377e62f4e6bfb4d99ef88526047209701a83f
20 changes: 15 additions & 5 deletions trunk/drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,23 @@ static void unmask_evtchn(int port)

if (unlikely((cpu != cpu_from_evtchn(port))))
do_hypercall = 1;
else
else {
/*
* Need to clear the mask before checking pending to
* avoid a race with an event becoming pending.
*
* EVTCHNOP_unmask will only trigger an upcall if the
* mask bit was set, so if a hypercall is needed
* remask the event.
*/
sync_clear_bit(port, BM(&s->evtchn_mask[0]));
evtchn_pending = sync_test_bit(port, BM(&s->evtchn_pending[0]));

if (unlikely(evtchn_pending && xen_hvm_domain()))
do_hypercall = 1;
if (unlikely(evtchn_pending && xen_hvm_domain())) {
sync_set_bit(port, BM(&s->evtchn_mask[0]));
do_hypercall = 1;
}
}

/* Slow path (hypercall) if this is a non-local port or if this is
* an hvm domain and an event is pending (hvm domains don't have
Expand All @@ -418,8 +430,6 @@ static void unmask_evtchn(int port)
} else {
struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu);

sync_clear_bit(port, BM(&s->evtchn_mask[0]));

/*
* The following is basically the equivalent of
* 'hw_resend_irq'. Just like a real IO-APIC we 'lose
Expand Down

0 comments on commit 6f8b6a8

Please sign in to comment.