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

[Xen-changelog] [xen-unstable] arm: map GICV in all domains, not just dom0.


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Wed, 04 Jul 2012 04:11:38 +0000
  • Delivery-date: Wed, 04 Jul 2012 04:11:55 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1341309145 -3600
# Node ID d3dd28a6cdd066959869d7f77fb4bc7284c101ab
# Parent  47a289c3b8f50b2b11d3e4b767395a8acfd027bc
arm: map GICV in all domains, not just dom0.

This requires that we allocate all p2m pages from domheap without a particular
dom because max pages is not setup yet so there is no allocation available to
us.

At some point we should create a separate p2m allocation (similar to x86's 
shadow allocation) and use that.

Also we seem to have been calling p2m_alloc_table twice for dom0.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 47a289c3b8f5 -r d3dd28a6cdd0 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c     Tue Jul 03 10:52:25 2012 +0100
+++ b/xen/arch/arm/domain.c     Tue Jul 03 10:52:25 2012 +0100
@@ -323,17 +323,21 @@ int arch_domain_create(struct domain *d,
 
         if ( (rc = p2m_alloc_table(d)) != 0 )
             goto fail;
+
+        if ( (rc = gicv_setup(d)) != 0 )
+            goto fail;
+
+        if ( (rc = domain_vgic_init(d)) != 0 )
+            goto fail;
     }
 
-    if ( (rc = domain_vgic_init(d)) != 0 )
-        goto fail;
-
     /* Domain 0 gets a real UART not an emulated one */
     if ( d->domain_id && (rc = domain_uart0_init(d)) != 0 )
         goto fail;
 
     rc = 0;
 fail:
+    /*XXX unwind allocations etc */
     return rc;
 }
 
diff -r 47a289c3b8f5 -r d3dd28a6cdd0 xen/arch/arm/domain_build.c
--- a/xen/arch/arm/domain_build.c       Tue Jul 03 10:52:25 2012 +0100
+++ b/xen/arch/arm/domain_build.c       Tue Jul 03 10:52:25 2012 +0100
@@ -270,9 +270,6 @@ int construct_dom0(struct domain *d)
 
     d->max_pages = ~0U;
 
-    if ( (rc = p2m_alloc_table(d)) != 0 )
-        return rc;
-
     rc = prepare_dtb(d, &kinfo);
     if ( rc < 0 )
         return rc;
@@ -288,8 +285,6 @@ int construct_dom0(struct domain *d)
     printk("Map VGIC MMIO regions 1:1 in the P2M %#llx->%#llx\n", 
0x2C008000ULL, 0x2DFFFFFFULL);
     map_mmio_regions(d, 0x2C008000, 0x2DFFFFFF, 0x2C008000);
 
-    gicv_setup(d);
-
     printk("Routing peripheral interrupts to guest\n");
     /* TODO Get from device tree */
     gic_route_irq_to_guest(d, 34, "timer0");
diff -r 47a289c3b8f5 -r d3dd28a6cdd0 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c        Tue Jul 03 10:52:25 2012 +0100
+++ b/xen/arch/arm/gic.c        Tue Jul 03 10:52:25 2012 +0100
@@ -541,14 +541,11 @@ void gic_interrupt(struct cpu_user_regs 
     do_IRQ(regs, irq, is_fiq);
 }
 
-void gicv_setup(struct domain *d)
+int gicv_setup(struct domain *d)
 {
     /* map the gic virtual cpu interface in the gic cpu interface region of
      * the guest */
-    printk("mapping GICC at %#"PRIx32" to %#"PRIx32"\n",
-           GIC_BASE_ADDRESS + GIC_CR_OFFSET,
-           GIC_BASE_ADDRESS + GIC_VR_OFFSET);
-    map_mmio_regions(d, GIC_BASE_ADDRESS + GIC_CR_OFFSET,
+    return map_mmio_regions(d, GIC_BASE_ADDRESS + GIC_CR_OFFSET,
                         GIC_BASE_ADDRESS + GIC_CR_OFFSET + (2 * PAGE_SIZE) - 1,
                         GIC_BASE_ADDRESS + GIC_VR_OFFSET);
 }
diff -r 47a289c3b8f5 -r d3dd28a6cdd0 xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h        Tue Jul 03 10:52:25 2012 +0100
+++ b/xen/arch/arm/gic.h        Tue Jul 03 10:52:25 2012 +0100
@@ -148,7 +148,7 @@ extern void gic_init_secondary_cpu(void)
 /* Take down a CPU's per-CPU GIC interface */
 extern void gic_disable_cpu(void);
 /* setup the gic virtual interface for a guest */
-extern void gicv_setup(struct domain *d);
+extern int gicv_setup(struct domain *d);
 
 /* Context switch */
 extern void gic_save_state(struct vcpu *v);
diff -r 47a289c3b8f5 -r d3dd28a6cdd0 xen/arch/arm/p2m.c
--- a/xen/arch/arm/p2m.c        Tue Jul 03 10:52:25 2012 +0100
+++ b/xen/arch/arm/p2m.c        Tue Jul 03 10:52:25 2012 +0100
@@ -4,6 +4,7 @@
 #include <xen/errno.h>
 #include <xen/domain_page.h>
 #include <asm/flushtlb.h>
+#include "gic.h"
 
 void dump_p2m_lookup(struct domain *d, paddr_t addr)
 {
@@ -102,7 +103,7 @@ static int p2m_create_table(struct domai
 
     BUG_ON(entry->p2m.valid);
 
-    page = alloc_domheap_page(d, 0);
+    page = alloc_domheap_page(NULL, 0);
     if ( page == NULL )
         return -ENOMEM;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.