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

Re: [PATCH v2 3/4] mini-os: fix number of pages for PVH



Juergen Gross, le dim. 19 juin 2022 08:52:52 +0200, a ecrit:
> When getting the current allocation from Xen, this value includes the
> pages allocated in the MMIO area. Fix the highest available RAM page
> by subtracting the size of that area.
> 
> This requires to read the E820 map before needing this value. Add two
> functions returning the current and the maximum number of RAM pages
> taking this correction into account.
> 
> At the same time add the LAPIC page to the memory map in order to
> avoid reusing that PFN for internal purposes.
> 
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> ---
> V2:
> - make e820_initial_reserved_pfns static (Samuel Thibault)
> - add e820_get_current_pages() and e820_get_max_pages()
> ---

> diff --git a/include/e820.h b/include/e820.h
> index 5438a7c8..6f15fcd2 100644
> --- a/include/e820.h
> +++ b/include/e820.h
> @@ -52,6 +52,8 @@ struct __packed e820entry {
>  extern struct e820entry e820_map[];
>  extern unsigned e820_entries;
>  
> +unsigned int e820_get_current_pages(void);
> +unsigned int e820_get_max_pages(void);

Why an int rather than a long int? Yes 4TiB memory is large for mini-os,
but better keep numbers of pages a long?

Apart from that,

Reviewed-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

Samuel



 


Rackspace

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