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

Re: [Xen-devel] [PATCH] xen/arm: skip first page when RAM starts at 0x0



Hi Stefano,

On 25/04/2019 18:51, Stefano Stabellini wrote:
> Xen assumes that RAM starts at addresses greater than 0x0 in a few
> places. The PDX code is one of them but there are more.

A bit more context in the commit message would have been useful. Imagine 
if we have to look at the commit message it in 2 years time.

> 
> For now, skip the first page in memory when the start addess is 0x0.
> 
> Signed-off-by: Stefano Stabellini <stefanos@xxxxxxxxxx>
> ---
>   xen/arch/arm/bootfdt.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
> index 891b4b6..2ae4238 100644
> --- a/xen/arch/arm/bootfdt.c
> +++ b/xen/arch/arm/bootfdt.c
> @@ -157,6 +157,13 @@ static void __init process_memory_node(const void *fdt, 
> int node,
>           device_tree_get_reg(&cell, address_cells, size_cells, &start, 
> &size);
>           if ( !size )
>               continue;
> +
> +        /*
> +         * Xen cannot deal with memory starting at 0x0. Burn the first
> +         * page.
> +         */
> +        if ( start == 0 )
> +            start += PAGE_SIZE;

I am afraid this is not enough. This does not cover the case where Xen 
is booting using UEFI (either DT or ACPI). The banks will be created 
from the UEFI memory map (see efi_process_memory_map_bootinfo()).

I also want to avoid mixing populating bootinfo.mem.bank and trying to 
workaround Xen allocator/PDX.

For a first we need to gather feedback from contributors that know a bit 
more of the code that may be affected. AFAICT, there are only two pieces 
where we hand over memory to common code:
     - PDX: The problem is passing 0 to pdx_init_mask() will result to a 
~0 mask defeating the compression later on.
     - Buddy allocator: Jan has been suggesting to stick a check in 
init_xenheap_pages(). This would go the other ugliness existing to deal 
with the buddy allocator.

If we fix in those two places, then I think we cover all the issues in 
common code and make easier to port Xen to a new arch.

Cheers,

-- 
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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