[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] The use of evtchn_upcall_mask



Hi, everyone
When I trace code of hypervisor, I can't find the use of evtchn_upcall_mask.
As the comment in include/public/xen.h, evtchn_upcall_mask is read before making an event upcall to the guest.
After I search the mailing lists, I find the following changelog:

[XEN] Replace direct common-code access of evtchn_upcall_mask with local_event_delivery_* accessors.
diff -r ea4829e30092 -r ddc25d4ebf60 xen/common/event_channel.c --- a/xen/common/event_channel.c Sat Jun 10 11:05:11 2006 +0100 +++ b/xen/common/event_channel.c Sat Jun 10 11:07:11 2006 +0100 @@ -499,7 +499,7 @@ void evtchn_set_pending(struct vcpu *v, evtchn_notify(v); } else if ( unlikely(test_bit(_VCPUF_blocked, &v->vcpu_flags) && - v->vcpu_info->evtchn_upcall_mask) ) + !local_event_delivery_is_enabled()) )

diff -r d7543cff88ae -r aced0ee216aa xen/common/event_channel.c --- a/xen/common/event_channel.c Sun Jun 11 14:33:16 2006 +0100 +++ b/xen/common/event_channel.c Sun Jun 11 19:23:31 2006 +0100 @@ -498,14 +498,14 @@ void evtchn_set_pending(struct vcpu *v, { evtchn_notify(v); } - else if ( unlikely(test_bit(_VCPUF_blocked, &v->vcpu_flags) && - !local_event_delivery_is_enabled()) ) - { - /* - * Blocked and masked will usually mean that the VCPU executed - * SCHEDOP_poll. Kick the VCPU in case this port is in its poll list. - */ - vcpu_unblock(v); + + /* Check if some VCPU might be polling for this event. */ + if ( unlikely(test_bit(_DOMF_polling, &d->domain_flags)) && + likely(test_and_clear_bit(_DOMF_polling, &d->domain_flags)) ) + { + for_each_vcpu ( d, v ) + if ( test_and_clear_bit(_VCPUF_polling, &v->vcpu_flags) ) + vcpu_unblock(v); } }

I think evtchn_set_pending() is the function to decide whether to make an event upcall to the guest, and the first patch is the last patch which I see evtchn_upcall_mask in evtchn_set_pending().
I also find that local_event_delivery_is_enabled() is not used in hypervisor.
I don't know if i understand this part correctly, it seems that evtchn_upcall_mask is useless.
Can somebody tell me the use of evtchn_upcall_mask?
Any suggestions will be greatly appreciated, thanks in advance.

--
Best regards,

Yao-Jing Wen
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.