Hi Julien > -----Original Message----- > From: Julien Grall <jul...@xen.org> > Sent: Tuesday, May 18, 2021 6:21 PM > To: Penny Zheng <penny.zh...@arm.com>; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis <bertrand.marq...@arm.com>; Wei Chen > <wei.c...@arm.com>; nd <n...@arm.com> > Subject: Re: [PATCH 06/10] xen: replace order with nr_pfns in assign_pages > for better compatibility > > Hi Penny, > > On 18/05/2021 06:21, Penny Zheng wrote: > > Function parameter order in assign_pages is always used as 1ul << > > order, referring to 2@order pages. > > > > Now, for better compatibility with new static memory, order shall be > > replaced with nr_pfns pointing to page count with no constraint, like > > 250MB. > > We have similar requirements for LiveUpdate because are preserving the > memory with a number of pages (rather than a power-of-two). With the > current interface would be need to split the range in a power of 2 which is a > bit of pain. > > However, I think I would prefer if we introduce a new interface (maybe > assign_pages_nr()) rather than change the meaning of the field. This is for > two reasons: > 1) We limit the risk to make mistake when backporting a patch touch > assign_pages(). > 2) Adding (1UL << order) for pretty much all the caller is not nice. >
Ok. I will create a new interface assign_pages_nr(), and let assign_pages to call it with 2@order. > Cheers, > > -- > Julien Grall Cheers Penny Zheng