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

[Embedded-pv-devel] [PATCH RFC 18/18] arm: Add ability to allocate Xen heap in lowmem



From: Iurii Konovalenko <iurii.konovalenko@xxxxxxxxxxxxxxx>

Add abiliyty to allocate Xen heap in 32-bit address range for ARM32.
Due to architecture features some ARM32 platforms require Xen heap
to be allocated in lowmem.

Signed-off-by: Iurii Konovalenko <iurii.konovalenko@xxxxxxxxxxxxxxx>
---
 xen/Rules.mk         |  1 +
 xen/arch/arm/setup.c | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 51f7124..30f5227 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -66,6 +66,7 @@ CFLAGS-$(HAS_PDX)       += -DHAS_PDX
 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
 CFLAGS-$(ARM32_RELOCATE_OVER_4GB) += -DARM32_RELOCATE_OVER_4GB
 CFLAGS-$(ARM32_SEPAR_MEM_SPLIT) += -DARM32_SEPAR_MEM_SPLIT
+CFLAGS-$(ARM32_XENHEAP_IN_LOWMEM) += -DARM32_XENHEAP_IN_LOWMEM
 
 ifneq ($(max_phys_cpus),)
 CFLAGS-y                += -DMAX_PHYS_CPUS=$(max_phys_cpus)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 7e507bc..5510a34 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -475,7 +475,11 @@ static void init_pdx(void)
 #ifdef CONFIG_ARM_32
 static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 {
+#ifdef ARM32_XENHEAP_IN_LOWMEM
+    paddr_t ram_start, ram_end, ram_size, dma32_end;
+#else
     paddr_t ram_start, ram_end, ram_size;
+#endif
     paddr_t s, e;
     unsigned long ram_pages;
     unsigned long heap_pages, xenheap_pages, domheap_pages;
@@ -492,6 +496,9 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t 
dtb_size)
     ram_start = bootinfo.mem.bank[0].start;
     ram_size  = bootinfo.mem.bank[0].size;
     ram_end   = ram_start + ram_size;
+#ifdef ARM32_XENHEAP_IN_LOWMEM
+    dma32_end = ram_end > 0x100000000ULL ? 0 : ram_end;
+#endif
 
     for ( i = 1; i < bootinfo.mem.nr_banks; i++ )
     {
@@ -502,6 +509,9 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t 
dtb_size)
         ram_size  = ram_size + bank_size;
         ram_start = min(ram_start,bank_start);
         ram_end   = max(ram_end,bank_end);
+#ifdef ARM32_XENHEAP_IN_LOWMEM
+        dma32_end = bank_end > 0x100000000ULL ? dma32_end : bank_end;
+#endif
     }
 
     total_pages = ram_pages = ram_size >> PAGE_SHIFT;
@@ -530,7 +540,11 @@ static void __init setup_mm(unsigned long dtb_paddr, 
size_t dtb_size)
 
     do
     {
+#ifdef ARM32_XENHEAP_IN_LOWMEM
+        e = consider_modules(ram_start, dma32_end,
+#else
         e = consider_modules(ram_start, ram_end,
+#endif
                              pfn_to_paddr(xenheap_pages),
                              32<<20, 0);
         if ( e )
-- 
2.8.2


_______________________________________________
Embedded-pv-devel mailing list
Embedded-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/embedded-pv-devel

 


Rackspace

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