This reverts commit
6c21cb36e263de2db8716b477157a5b6cd531e1e.
The Linux = issue which this works around was fixed in v3.13 via
f52bb722547f
"ARM: mm: Correct virt_to_phys patching for 64 bit physical addresses".
This is the second attempt to revert this. Now that we have fixed
allocate_memory_11 to allocate accessible memory on 32-bit this is safe to do.
This is not quite a straight revert since we need to ensure that for 32-bit
domain 0 we do not allocate dom0's memory above 4GB where the domain cannot
access it without paging (which is disabled at start of day) and LPAE (which
the kernel may not support) enabled.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
[ ijc -- dropped debug code ]
{
paddr_t start;
paddr_t size;
- struct page_info *pg = NULL;
+ struct page_info *pg;
unsigned int order = get_order_from_bytes(dom0_mem);
int res;
paddr_t spfn;
- unsigned int bits;
-
- for ( bits = PAGE_SHIFT + 1; bits < PADDR_BITS; bits++ )
- {
- pg = alloc_domheap_pages(d, order, MEMF_bits(bits));
- if ( pg != NULL )
- break;
- }
+ if ( is_32bit_domain(d) )
+ pg = alloc_domheap_pages(d, order, MEMF_bits(32));
+ else
+ pg = alloc_domheap_pages(d, order, 0);
if ( !pg )
panic("Failed to allocate contiguous memory for dom0");