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@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Paul Durrant <paul@xen.org>
master commit: 6f6f07b64c
master date: 2020-10-02 08:37:35 +0200
This commit is contained in:
Jan Beulich committed 2020-10-20 15:05:02 +02:00
1 parent 68ff540de1
commit a9382052b8
1 file changed
+2 -2
+2 -2
View File
@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.