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

Re: [Xen-devel] [PATCH v2] evtchn: clean last_vcpu_id on EVTCHNOP_reset to avoid crash



>>> On 11.08.14 at 18:29, <vkuznets@xxxxxxxxxx> 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


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