From: Jan Beulich Date: Tue, 1 Dec 2020 16:34:38 +0000 (+0100) Subject: evtchn/fifo: use stable fields when recording "last queue" information X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1fdcfdbfb2b1920a0bbaf8281cb8a7f6e37b2a6f;p=xen.git 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 Reviewed-by: Julien Grall Reviewed-by: Paul Durrant master commit: 6f6f07b64cbe90e54f8e62b4d6f2404cf5306536 master date: 2020-10-02 08:37:35 +0200 --- diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c index 45c024739d..98742ba9cb 100644 --- a/xen/common/event_fifo.c +++ b/xen/common/event_fifo.c @@ -224,8 +224,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);