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

[xen staging] evtchn/fifo: use stable fields when recording "last queue" information



commit 6f6f07b64cbe90e54f8e62b4d6f2404cf5306536
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Oct 2 08:37:35 2020 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Oct 2 08:37:35 2020 +0200

    evtchn/fifo: use stable fields when recording "last queue" information
    
    Both evtchn->priority and evtchn->notify_vcpu_id could change behind the
    back of evtchn_fifo_set_pending(), as for it - in the case of
    interdomain channels - only the remote side's per-channel lock is held.
    Neither the queue's priority nor the vCPU's vcpu_id fields have similar
    properties, so they seem better suited for the purpose. In particular
    they reflect the respective evtchn fields' values at the time they were
    used to determine queue and vCPU.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
    Reviewed-by: Paul Durrant <paul@xxxxxxx>
---
 xen/common/event_fifo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 68d0c7a632..27ab3a1c3f 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -225,8 +225,8 @@ static void evtchn_fifo_set_pending(struct vcpu *v, struct 
evtchn *evtchn)
         /* Moved to a different queue? */
         if ( old_q != q )
         {
-            evtchn->last_vcpu_id = evtchn->notify_vcpu_id;
-            evtchn->last_priority = evtchn->priority;
+            evtchn->last_vcpu_id = v->vcpu_id;
+            evtchn->last_priority = q->priority;
 
             spin_unlock_irqrestore(&old_q->lock, flags);
             spin_lock_irqsave(&q->lock, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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