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

Re: [Xen-devel] [PATCH] xen/arm: Workaround for memory problem >1gb on last section



setup_xenheap_mappings setup head memory on Arm 32 has a limit of 1gb.
On system with large memory is possible that there are no blocks of memory
smaller than 1gb leading xenheap_pages to be more than 1gb.
This cause memory errors trying to access heap after the 1gb limit.

Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>
---
 xen/arch/arm/setup.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 446de8a..b1a43e6 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -524,6 +524,9 @@ static void __init setup_mm(unsigned long
dtb_paddr, size_t dtb_size)
     if ( ! e )
         panic("Not not enough space for xenheap");

+    if ( xenheap_pages > 1<<(30-PAGE_SHIFT) )
+        xenheap_pages = 1<<(30-PAGE_SHIFT);
+
     domheap_pages = heap_pages - xenheap_pages;

     printk("Xen heap: %"PRIpaddr"-%"PRIpaddr" (%lu pages)\n",
-- 
1.9.1

I don't know if I can add Ian ack by myself as I changed the patch as
suggested by Julien.

Frediano


2014-10-01 14:06 GMT+01:00 Julien Grall <julien.grall@xxxxxxxxxx>:
> Hello Frediano,
>
> On 29/09/2014 17:02, Frediano Ziglio wrote:
>>
>> setup_xenheap_mappings setup head memory on Arm 32 has a limit of 1GB.
>> On system with large memory is possible that there are no blocks of memory
>
>
> it's
>
>> smaller than 1gb leading xenheap_pages to be more than 1gb.
>
>
> Can you be consistent with the way to write 1GB?
>
>> This cause memory errors trying to access heap after the 1gb limit.
>>
>> I actually consider this patch as RFC as the pages are allocated at the
>> end
>> of the block found however I don't think is safe to assume that the end is
>> aligned to 32mb as required.
>
>
> After Ian's comment, I guess this paragraph should be dropped.
>
>> Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>
>> ---
>>   xen/arch/arm/setup.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>>
>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>> index 446de8a..34b55b4 100644
>> --- a/xen/arch/arm/setup.c
>> +++ b/xen/arch/arm/setup.c
>> @@ -524,6 +524,11 @@ static void __init setup_mm(unsigned long
>> dtb_paddr, size_t dtb_size)
>>       if ( ! e )
>>           panic("Not not enough space for xenheap");
>>
>> +#ifdef CONFIG_ARM_32
>
>
> This version of setup_mm is only compiled for arm32, therefore the #ifdef is
> not necessary.
>
> Regards,
>
>
> --
> Julien Grall

_______________________________________________
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®.