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

[Xen-devel] [PATCH] arm/domain: allocate pages according to the order of struct domain size



As the number of CPUs supported on the system grows, number of
GIC redistributors and mmio handlers increase.  We need to increase
MAX_RDIST_COUNT and MAX_IO_HANDLER which makes size of struct domain
bigger than one page.

Remove the BUILD_BUG_ON check for if size of struct domain is greater
than PAGE_SIZE.  And allocate xenheap pages according to the order of
the size of struct domain.

Signed-off-by: Jiandi An <anjiandi@xxxxxxxxxxxxxx>
---
 xen/arch/arm/domain.c      | 5 +++--
 xen/include/asm-arm/gic.h  | 2 +-
 xen/include/asm-arm/mmio.h | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 1365b4a..7f69236 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -438,8 +438,9 @@ void startup_cpu_idle_loop(void)
 struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
-    BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
-    d = alloc_xenheap_pages(0, 0);
+    unsigned int order = get_order_from_bytes(sizeof(*d));
+
+    d = alloc_xenheap_pages(order, 0);
     if ( d == NULL )
         return NULL;
 
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index cd97bb2..8165de6 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -20,7 +20,7 @@
 
 #define NR_GIC_LOCAL_IRQS  NR_LOCAL_IRQS
 #define NR_GIC_SGI         16
-#define MAX_RDIST_COUNT    4
+#define MAX_RDIST_COUNT    64 
 
 #define GICD_CTLR       (0x000)
 #define GICD_TYPER      (0x004)
diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h
index da1cc2e..798d373 100644
--- a/xen/include/asm-arm/mmio.h
+++ b/xen/include/asm-arm/mmio.h
@@ -23,7 +23,7 @@
 #include <asm/processor.h>
 #include <asm/regs.h>
 
-#define MAX_IO_HANDLER  16
+#define MAX_IO_HANDLER  32
 
 typedef struct
 {
-- 
Jiandi An
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux 
Foundation Collaborative Project


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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