From: "Jan Beulich" Subject: Re: [PATCH v2] evtchn: clean last_vcpu_id on EVTCHNOP_reset to avoid crash Date: Tue, 12 Aug 2014 10:13:10 +0100 Message-ID: <53E9F6C6020000780002B71E@mail.emea.novell.com> References: <1407774575-18235-1-git-send-email-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XH88n-0007yp-Fr for xen-devel@lists.xenproject.org; Tue, 12 Aug 2014 09:13:13 +0000 In-Reply-To: <1407774575-18235-1-git-send-email-vkuznets@redhat.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vitaly Kuznetsov Cc: xen-devel@lists.xenproject.org, Andrew Jones , David Vrabel List-Id: xen-devel@lists.xenproject.org >>> On 11.08.14 at 18:29, wrote: > --- a/xen/common/event_fifo.c > +++ b/xen/common/event_fifo.c > @@ -37,10 +37,24 @@ static inline event_word_t > *evtchn_fifo_word_from_port(struct domain *d, > static void evtchn_fifo_init(struct domain *d, struct evtchn *evtchn) > { > event_word_t *word; > + struct vcpu *v; > > evtchn->priority = EVTCHN_FIFO_PRIORITY_DEFAULT; > > /* > + * Check that and evtchn->last_vcpu_id has its control block initialized > + * and reset to notify_vcpu_id in case it is not. > + */ > + v = d->vcpu[evtchn->last_vcpu_id]; > + if ( !v->evtchn_fifo ) > + { > + printk("%pv: event channel %d has last_vcpu_id=%d with uninitialized " > + "control block, reset to VCPU %d !\n", v, evtchn->port, > + evtchn->last_vcpu_id, evtchn->notify_vcpu_id); This still lacks a XENLOG_G_* prefix. > @@ -588,10 +602,24 @@ int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array) > void evtchn_fifo_destroy(struct domain *d) > { > struct vcpu *v; > + struct evtchn *chn; > + int i; unsigned int please. Jan