ia64/xen-unstable

changeset 19674:527b628b8e83

Revert 19661:326b24bfa9f9 "Free pirq_to_evtchn/pirq_mask..."

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri May 29 09:22:50 2009 +0100 (2009-05-29)
parents f3bed18decfc
children ae5bd69227d1
files xen/common/domain.c xen/common/event_channel.c
line diff
     1.1 --- a/xen/common/domain.c	Fri May 29 09:19:30 2009 +0100
     1.2 +++ b/xen/common/domain.c	Fri May 29 09:22:50 2009 +0100
     1.3 @@ -261,6 +261,13 @@ struct domain *domain_create(
     1.4          if ( evtchn_init(d) != 0 )
     1.5              goto fail;
     1.6          init_status |= INIT_evtchn;
     1.7 +        d->pirq_to_evtchn = xmalloc_array(u16, d->nr_pirqs);
     1.8 +        d->pirq_mask = xmalloc_array(unsigned long,
     1.9 +                                     BITS_TO_LONGS(d->nr_pirqs));
    1.10 +        if ( !d->pirq_to_evtchn || !d->pirq_mask )
    1.11 +            goto fail;
    1.12 +        memset(d->pirq_to_evtchn, 0, d->nr_pirqs * sizeof(*d->pirq_to_evtchn));
    1.13 +        bitmap_zero(d->pirq_mask, d->nr_pirqs);
    1.14  
    1.15          if ( grant_table_create(d) != 0 )
    1.16              goto fail;
    1.17 @@ -303,7 +310,11 @@ struct domain *domain_create(
    1.18      if ( init_status & INIT_gnttab )
    1.19          grant_table_destroy(d);
    1.20      if ( init_status & INIT_evtchn )
    1.21 +    {
    1.22 +        xfree(d->pirq_mask);
    1.23 +        xfree(d->pirq_to_evtchn);
    1.24          evtchn_destroy(d);
    1.25 +    }
    1.26      if ( init_status & INIT_rangeset )
    1.27          rangeset_domain_destroy(d);
    1.28      if ( init_status & INIT_xsm )
     2.1 --- a/xen/common/event_channel.c	Fri May 29 09:19:30 2009 +0100
     2.2 +++ b/xen/common/event_channel.c	Fri May 29 09:22:50 2009 +0100
     2.3 @@ -1013,27 +1013,10 @@ void notify_via_xen_event_channel(int lp
     2.4  int evtchn_init(struct domain *d)
     2.5  {
     2.6      spin_lock_init(&d->event_lock);
     2.7 -
     2.8 -    d->pirq_to_evtchn = xmalloc_array(u16, d->nr_pirqs);
     2.9 -    d->pirq_mask = xmalloc_array(
    2.10 -        unsigned long, BITS_TO_LONGS(d->nr_pirqs));
    2.11 -    if ( (d->pirq_to_evtchn == NULL) || (d->pirq_mask == NULL) )
    2.12 -        goto fail;
    2.13 -    memset(d->pirq_to_evtchn, 0, d->nr_pirqs * sizeof(*d->pirq_to_evtchn));
    2.14 -    bitmap_zero(d->pirq_mask, d->nr_pirqs);
    2.15 -
    2.16      if ( get_free_port(d) != 0 )
    2.17 -        goto fail;
    2.18 +        return -EINVAL;
    2.19      evtchn_from_port(d, 0)->state = ECS_RESERVED;
    2.20 -
    2.21      return 0;
    2.22 -
    2.23 - fail:
    2.24 -    xfree(d->pirq_to_evtchn);
    2.25 -    d->pirq_to_evtchn = NULL;
    2.26 -    xfree(d->pirq_mask);
    2.27 -    d->pirq_mask = NULL;
    2.28 -    return -ENOMEM;
    2.29  }
    2.30  
    2.31  
    2.32 @@ -1061,11 +1044,6 @@ void evtchn_destroy(struct domain *d)
    2.33          d->evtchn[i] = NULL;
    2.34      }
    2.35      spin_unlock(&d->event_lock);
    2.36 -
    2.37 -    xfree(d->pirq_to_evtchn);
    2.38 -    d->pirq_to_evtchn = NULL;
    2.39 -    xfree(d->pirq_mask);
    2.40 -    d->pirq_mask = NULL;
    2.41  }
    2.42  
    2.43  static void domain_dump_evtchn_info(struct domain *d)