aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/domain.c
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2011-05-02 12:00:40 +0100
committerKeir Fraser <keir@xen.org>2011-05-02 12:00:40 +0100
commitd0ef88916f3ab8bda754b175b299e3d5a73fe851 (patch)
tree1ca943cf84f69289ffda79497151277a64c35583 /xen/common/domain.c
parent76ce27755b87aa5a91ce0f5a02e560ab5c0515e4 (diff)
downloadxen-d0ef88916f3ab8bda754b175b299e3d5a73fe851.tar.gz
xen-d0ef88916f3ab8bda754b175b299e3d5a73fe851.tar.bz2
xen-d0ef88916f3ab8bda754b175b299e3d5a73fe851.zip
Revert 23295:4891f1f41ba5 and 23296:24346f749826
Fails current lock checking mechanism in spinlock.c in debug=y builds. Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/domain.c')
-rw-r--r--xen/common/domain.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 40a2833762..852c968bba 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -290,7 +290,13 @@ struct domain *domain_create(
if ( d->nr_pirqs > nr_irqs )
d->nr_pirqs = nr_irqs;
- INIT_RADIX_TREE(&d->pirq_tree, 0);
+ d->pirq_to_evtchn = xmalloc_array(u16, d->nr_pirqs);
+ d->pirq_mask = xmalloc_array(
+ unsigned long, BITS_TO_LONGS(d->nr_pirqs));
+ if ( (d->pirq_to_evtchn == NULL) || (d->pirq_mask == NULL) )
+ goto fail;
+ memset(d->pirq_to_evtchn, 0, d->nr_pirqs * sizeof(*d->pirq_to_evtchn));
+ bitmap_zero(d->pirq_mask, d->nr_pirqs);
if ( evtchn_init(d) != 0 )
goto fail;
@@ -340,7 +346,6 @@ struct domain *domain_create(
{
evtchn_destroy(d);
evtchn_destroy_final(d);
- radix_tree_destroy(&d->pirq_tree, free_pirq_struct, NULL);
}
if ( init_status & INIT_rangeset )
rangeset_domain_destroy(d);
@@ -348,6 +353,8 @@ struct domain *domain_create(
watchdog_domain_destroy(d);
if ( init_status & INIT_xsm )
xsm_free_security_domain(d);
+ xfree(d->pirq_mask);
+ xfree(d->pirq_to_evtchn);
free_cpumask_var(d->domain_dirty_cpumask);
free_domain_struct(d);
return NULL;
@@ -673,7 +680,8 @@ static void complete_domain_destroy(struct rcu_head *head)
evtchn_destroy_final(d);
- radix_tree_destroy(&d->pirq_tree, free_pirq_struct, NULL);
+ xfree(d->pirq_mask);
+ xfree(d->pirq_to_evtchn);
xsm_free_security_domain(d);
free_cpumask_var(d->domain_dirty_cpumask);
@@ -955,20 +963,6 @@ long vm_assist(struct domain *p, unsigned int cmd, unsigned int type)
return -ENOSYS;
}
-struct pirq *pirq_get_info(struct domain *d, int pirq)
-{
- struct pirq *info = pirq_info(d, pirq);
-
- if ( !info && (info = alloc_pirq_struct(d)) != NULL &&
- radix_tree_insert(&d->pirq_tree, pirq, info, NULL, NULL) )
- {
- free_pirq_struct(info);
- info = NULL;
- }
-
- return info;
-}
-
struct migrate_info {
long (*func)(void *data);
void *data;