* [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section
@ 2014-09-29 16:02 Frediano Ziglio
2014-10-01 10:37 ` Ian Campbell
2014-10-01 13:06 ` Julien Grall
0 siblings, 2 replies; 5+ messages in thread
From: Frediano Ziglio @ 2014-09-29 16:02 UTC (permalink / raw)
To: Ian Campbell, Stefano Stabellini, Tim Deegan; +Cc: xen-devel
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.
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.
Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
---
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
+ if ( xenheap_pages > 1<<(30-PAGE_SHIFT) )
+ xenheap_pages = 1<<(30-PAGE_SHIFT);
+#endif
+
domheap_pages = heap_pages - xenheap_pages;
printk("Xen heap: %"PRIpaddr"-%"PRIpaddr" (%lu pages)\n",
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section
2014-09-29 16:02 [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section Frediano Ziglio
@ 2014-10-01 10:37 ` Ian Campbell
2014-10-01 11:29 ` Ian Campbell
2014-10-01 13:06 ` Julien Grall
1 sibling, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2014-10-01 10:37 UTC (permalink / raw)
To: Frediano Ziglio; +Cc: Tim Deegan, Stefano Stabellini, xen-devel
On Mon, 2014-09-29 at 17:02 +0100, 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
> smaller than 1gb leading xenheap_pages to be more than 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.
>
> Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section
2014-10-01 10:37 ` Ian Campbell
@ 2014-10-01 11:29 ` Ian Campbell
0 siblings, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2014-10-01 11:29 UTC (permalink / raw)
To: Frediano Ziglio; +Cc: Stefano Stabellini, Tim Deegan, xen-devel
On Wed, 2014-10-01 at 11:37 +0100, Ian Campbell wrote:
> On Mon, 2014-09-29 at 17:02 +0100, 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
> > smaller than 1gb leading xenheap_pages to be more than 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.
> >
> > Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
WRT the RFC and comment I think this patch is in and of itself correct.
I think the comment about no blocks of memory smaller than 1gb is a bit
misleading though, we will just look for a big enough region, so it's
actually the presence of large enough blocks not the absence of small
ones which is the problem.
The issue which you raise regarding the 32MB alignment is handled by the
call to consider_modules which takes 32MB as the required alignment
parameter, AFAIK it should return something which is suitably aligned,
since it aligns the end address on entry and eventually returns it. I'm
not 100% sure that it doesn't rely on size being 32MB aligned, but I my
99% sure it doesn't ;-).
Ian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section
2014-09-29 16:02 [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section Frediano Ziglio
2014-10-01 10:37 ` Ian Campbell
@ 2014-10-01 13:06 ` Julien Grall
1 sibling, 0 replies; 5+ messages in thread
From: Julien Grall @ 2014-10-01 13:06 UTC (permalink / raw)
To: Frediano Ziglio, Ian Campbell, Stefano Stabellini, Tim Deegan; +Cc: xen-devel
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@huawei.com>
> ---
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section
@ 2014-09-29 15:59 Frediano Ziglio
0 siblings, 0 replies; 5+ messages in thread
From: Frediano Ziglio @ 2014-09-29 15:59 UTC (permalink / raw)
To: xen-devel
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.
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.
Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
---
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
+ if ( xenheap_pages > 1<<(30-PAGE_SHIFT) )
+ xenheap_pages = 1<<(30-PAGE_SHIFT);
+#endif
+
domheap_pages = heap_pages - xenheap_pages;
printk("Xen heap: %"PRIpaddr"-%"PRIpaddr" (%lu pages)\n",
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-10-01 13:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-29 16:02 [RFC PATCH] ARM 32: Workaround for memory problem >1gb on last section Frediano Ziglio
2014-10-01 10:37 ` Ian Campbell
2014-10-01 11:29 ` Ian Campbell
2014-10-01 13:06 ` Julien Grall
-- strict thread matches above, loose matches on Subject: below --
2014-09-29 15:59 Frediano Ziglio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).