Hi Jan > -----Original Message----- > From: Jan Beulich <jbeul...@suse.com> > Sent: Wednesday, March 30, 2022 5:59 PM > To: Penny Zheng <penny.zh...@arm.com> > Cc: Wei Chen <wei.c...@arm.com>; Henry Wang <henry.w...@arm.com>; > Andrew Cooper <andrew.coop...@citrix.com>; George Dunlap > <george.dun...@citrix.com>; Julien Grall <jul...@xen.org>; Stefano Stabellini > <sstabell...@kernel.org>; Wei Liu <w...@xen.org>; xen- > de...@lists.xenproject.org > Subject: Re: [PATCH v1 4/5] xen/arm: retrieve reserved pages on > populate_physmap > > On 30.03.2022 11:36, Penny Zheng wrote: > > --- a/xen/common/memory.c > > +++ b/xen/common/memory.c > > @@ -249,6 +249,26 @@ static void populate_physmap(struct memop_args > *a) > > > > mfn = _mfn(gpfn); > > } > > +#ifdef CONFIG_STATIC_MEMORY > > + else if ( is_domain_on_static_allocation(d) ) > > + { > > + for ( j = 0; j < (1U << a->extent_order); j++ ) > > + { > > + page = page_list_remove_head(&d->resv_page_list); > > How do you guarantee the pages are contiguous, as required by a non-zero > a->extent_order? Did you perhaps mean to forbid non-zero-order requests > in this configuration?,
True, true, thanks for pointing that out. I would not intend to add complex algorithm here to find contiguous pages of requested order, forbidding non-zero-order with error message shall be added here. > > > + if ( unlikely(!page) ) > > + { > > + gdprintk(XENLOG_INFO, > > + "Could not allocate guest page number > > %lx\n", > > + gfn_x(_gfn(gpfn))); > > + goto out; > > And earlier allocated pages are simply lost / leaked? > That was unconsidered, thanks for pointing that out. Since now we are forbidding non-zero-order requests, earlier allocated pages shall not need to be considered. > Jan