xen/21373-dummy-domain-io-caps.patch

49 lines
1.5 KiB
Diff

# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1273741742 -3600
# Node ID 1ec412805622fd7ec0e88bf3b7ab681d024994bc
# Parent 6c22d2dfed4882d5febf98d2afbb96ec9bedd043
Even 'dummy' domains (e.g., dom_xen a.k.a. DOMID_XEN) must have valid I/O caps.
Ensure the rangesets are always initialised. Certain (privileged)
invocations of hypercalls such as mmu_update can end up interrogating
these special domains for possible I/O capabilities.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -245,12 +245,17 @@ struct domain *domain_create(
d->disable_migrate = 1;
}
- if ( domcr_flags & DOMCRF_dummy )
- return d;
-
rangeset_domain_initialise(d);
init_status |= INIT_rangeset;
+ d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex);
+ d->irq_caps = rangeset_new(d, "Interrupts", 0);
+ if ( (d->iomem_caps == NULL) || (d->irq_caps == NULL) )
+ goto fail;
+
+ if ( domcr_flags & DOMCRF_dummy )
+ return d;
+
if ( !is_idle_domain(d) )
{
if ( xsm_domain_create(d, ssidref) != 0 )
@@ -285,11 +290,6 @@ struct domain *domain_create(
goto fail;
init_status |= INIT_arch;
- d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex);
- d->irq_caps = rangeset_new(d, "Interrupts", 0);
- if ( (d->iomem_caps == NULL) || (d->irq_caps == NULL) )
- goto fail;
-
if ( sched_init_domain(d) != 0 )
goto fail;