xen: Modify grub_xen_ptr2mfn() for Xen PVH

grub_xen_ptr2mfn() returns the machine frame number for a given pointer
value. For Xen-PVH guests this is just the PFN. Add the PVH specific
variant.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
This commit is contained in:
Juergen Gross 2018-12-07 13:11:35 +01:00 committed by Daniel Kiper
parent bec9edf53f
commit 3b8d09c774

View file

@ -45,6 +45,8 @@ grub_xen_ptr2mfn (void *ptr)
grub_xen_mfn_t *mfn_list = grub_xen_mfn_t *mfn_list =
(grub_xen_mfn_t *) grub_xen_start_page_addr->mfn_list; (grub_xen_mfn_t *) grub_xen_start_page_addr->mfn_list;
return mfn_list[(grub_addr_t) ptr >> GRUB_XEN_LOG_PAGE_SIZE]; return mfn_list[(grub_addr_t) ptr >> GRUB_XEN_LOG_PAGE_SIZE];
#else
return (grub_addr_t) ptr >> GRUB_XEN_LOG_PAGE_SIZE;
#endif #endif
} }