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

Re: [Xen-devel] [PATCH] evtchn: simplify sending of notifications



On 12/01/15 08:57, Jan Beulich wrote:
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -152,10 +152,11 @@ static inline void evtchn_port_init(stru
         d->evtchn_port_ops->init(d, evtchn);
 }

-static inline void evtchn_port_set_pending(struct vcpu *v,
+static inline void evtchn_port_set_pending(struct domain *d,
+                                           unsigned int vcpu_id,
                                            struct evtchn *evtchn)

I would rename this to the, now vacant, evtchn_set_pending().  It takes an evtchn* not a port.  (Its sole caller was evtchn_set_pending(), so the patch won't grow)

Furthermore, all callers except send_guest_vcpu_virq() currently use evtchn->notify_vcpu_id to get a struct vcpu* to pass.  I think you can drop the vcpu_id parameter and use evtchn->notify_vcpu_id directly, which reduces the likelyhood of a bug where the evtchn is bound to one vcpu but a caller gets the wrong id and raises the event channel on the wrong vcpu.

~Andrew

 {
-    v->domain->evtchn_port_ops->set_pending(v, evtchn);
+    d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
 }

 static inline void evtchn_port_clear_pending(struct domain *d,




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

_______________________________________________
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®.