On 15/11/2018 11:03, Roger Pau Monné wrote: > On Fri, Nov 02, 2018 at 01:37:32PM +0100, Juergen Gross wrote: >> Initialize the needed Xen specific data. This is: >> >> - the Xen start of day page containing the console and Xenstore ring >> page PFN and event channel >> - the grant table >> - the shared info page >> >> Write back the possibly modified memory map to the hypervisor in case >> the guest is reading it from there again. >> >> Set the RSDP address for the guest from the start_info page passed >> as boot parameter. >> >> Signed-off-by: Juergen Gross <jgr...@suse.com> >> --- >> V4: write back memory map to Xen (Roger Pau Monné) >> --- >> grub-core/kern/i386/xen/pvh.c | 119 >> ++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 119 insertions(+) >> >> diff --git a/grub-core/kern/i386/xen/pvh.c b/grub-core/kern/i386/xen/pvh.c >> +static grub_uint64_t >> +grub_xen_find_page (grub_uint64_t start) >> +{ >> + unsigned int i, j; >> + grub_uint64_t last = start; >> + >> + /* Try to find a e820 map hole below 4G. */ >> + for (i = 0; i < nr_map_entries; i++) >> + { >> + if (last > map[i].addr + map[i].len) >> + continue; >> + if (last < map[i].addr) > > Shouldn't this be last + PAGE_SIZE <= map[i].addr? > > grub_xen_sort_mmap already aligns memory map entries to page > boundaries, so the result will be correct as long as 'start' is also > page aligned.
Correct, page alignment is a requirement (which is met currently). I'll add a comment to point that out. Juergen _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel