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

Re: [PATCH v7 14/15] x86: switch to use domheap page for page tables



On 29.05.2020 13:11, Hongyan Xia wrote:
> From: Hongyan Xia <hongyxia@xxxxxxxxxx>
> 
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> Signed-off-by: Hongyan Xia <hongyxia@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with a sufficiently minor remark:

> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -4918,10 +4918,11 @@ mfn_t alloc_xen_pagetable_new(void)
>  {
>      if ( system_state != SYS_STATE_early_boot )
>      {
> -        void *ptr = alloc_xenheap_page();
>  
> -        BUG_ON(!hardware_domain && !ptr);
> -        return ptr ? virt_to_mfn(ptr) : INVALID_MFN;
> +        struct page_info *pg = alloc_domheap_page(NULL, 0);
> +
> +        BUG_ON(!hardware_domain && !pg);
> +        return pg ? page_to_mfn(pg) : INVALID_MFN;

pg doesn't even get de-referenced, let alone modified. Hence it
would better be pointer-to-const, despite this possibly feeling a
little odd to some of us given this is a freshly allocated page.

Jan



 


Rackspace

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