Hi Wei,

On 22/02/18 16:35, Wei Liu wrote:
On Wed, Feb 21, 2018 at 02:02:51PM +0000, Julien Grall wrote:
The function populate_pt_range is used to populate in advance the
page-table but it will not do the actual mapping. So passing the MFN in
parameter is pointless. Note that the only caller pass 0...

At the same time replace 0 by INVALID_MFN to make clear the MFN is

The mfn parameter is the first mfn of a consecutive nr MFNs passed to
map_pages_to_xen. Putting INVALID_MFN isn't helping -- the value written
to page table(s) will wrap around to 0.

And I think starting from 0 to avoid overflow is probably a better
behaviour. If you really want to make sure all entries are filled with
INVALID_MFN you should call map_pages_to_xen for nr times with each

I am not sure to understand this. From its name, populate_pt_range should only create the intermediate tables. The leaf entry will stay invalid. So how the value of mfn matters? Is it because the code is written in a such way that passing INVALID_MFN will result to undefined behavior?


Julien Grall

Xen-devel mailing list

Reply via email to