Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329140
b: refs/heads/master
c: b5e5792
h: refs/heads/master
v: v3
  • Loading branch information
Stefano Stabellini authored and Konrad Rzeszutek Wilk committed Aug 23, 2012
1 parent 76dbb3e commit 9e48ccc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 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: 5c13f8067745efc15f6ad0158b58d57c44104c25
refs/heads/master: b5e579232d635b79a3da052964cb357ccda8d9ea
17 changes: 14 additions & 3 deletions trunk/drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,22 @@ static void unmask_evtchn(int port)
{
struct shared_info *s = HYPERVISOR_shared_info;
unsigned int cpu = get_cpu();
int do_hypercall = 0, evtchn_pending = 0;

BUG_ON(!irqs_disabled());

/* Slow path (hypercall) if this is a non-local port. */
if (unlikely(cpu != cpu_from_evtchn(port))) {
if (unlikely((cpu != cpu_from_evtchn(port))))
do_hypercall = 1;
else
evtchn_pending = sync_test_bit(port, &s->evtchn_pending[0]);

if (unlikely(evtchn_pending && xen_hvm_domain()))
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
* their own implementation of irq_enable). */
if (do_hypercall) {
struct evtchn_unmask unmask = { .port = port };
(void)HYPERVISOR_event_channel_op(EVTCHNOP_unmask, &unmask);
} else {
Expand All @@ -390,7 +401,7 @@ static void unmask_evtchn(int port)
* 'hw_resend_irq'. Just like a real IO-APIC we 'lose
* the interrupt edge' if the channel is masked.
*/
if (sync_test_bit(port, &s->evtchn_pending[0]) &&
if (evtchn_pending &&
!sync_test_and_set_bit(port / BITS_PER_LONG,
&vcpu_info->evtchn_pending_sel))
vcpu_info->evtchn_upcall_pending = 1;
Expand Down

0 comments on commit 9e48ccc

Please sign in to comment.