]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen/arm: move evtchn_allocate call out of make_hypervisor_node
authorStefano Stabellini <sstabellini@kernel.org>
Tue, 31 Jul 2018 23:27:49 +0000 (16:27 -0700)
committerJulien Grall <julien.grall@arm.com>
Wed, 22 Aug 2018 15:28:30 +0000 (16:28 +0100)
In the case of domUs, evtchn_irq is allocated by arch_domain_create and
set to GUEST_EVTCHN_PPI.

To make make_hypervisor_node more reusable, move the call to
evtchn_allocate out of make_hypervisor_node, to the dom0 specific caller
(handle_node).

Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/domain_build.c

index 0177492b1c5585347606801a0b9e1be6d350c8dc..2ba0e348680bf168b26be3b2b5dc49e586fe89bf 100644 (file)
@@ -619,11 +619,7 @@ static int __init make_hypervisor_node(struct domain *d,
     if ( res )
         return res;
 
-    /*
-     * It is safe to allocate the event channel here because all the
-     * PPIs used by the hardware domain have been registered.
-     */
-    evtchn_allocate(d);
+    BUG_ON(d->arch.evtchn_irq == 0);
 
     /*
      * Interrupt event channel upcall:
@@ -1293,6 +1289,12 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
         int addrcells = dt_child_n_addr_cells(node);
         int sizecells = dt_child_n_size_cells(node);
 
+        /*
+         * It is safe to allocate the event channel here because all the
+         * PPIs used by the hardware domain have been registered.
+         */
+        evtchn_allocate(d);
+
         /*
          * The hypervisor node should always be created after all nodes
          * from the host DT have been parsed.