On 29.05.2020 13:11, Hongyan Xia wrote: > From: Hongyan Xia <hongy...@amazon.com> > > Signed-off-by: Wei Liu <wei.l...@citrix.com> > Signed-off-by: Hongyan Xia <hongy...@amazon.com>
Reviewed-by: Jan Beulich <jbeul...@suse.com> 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