mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/libxenguest: remove get_platform_info from xg_save_restore.h
Last user was removed with commit4ddf474e2bPreviously it was also used in migration code, which was removed with commitb15bc4345eSigned-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
c992efd06a
commit
7a83d9d53d
2 files changed
+1
-61
No files matched your search
@@ -67,7 +67,7 @@ int xc_map_domain_meminfo(xc_interface *xch, uint32_t domid,
|
||||
}
|
||||
_di.guest_width = minfo->guest_width;
|
||||
|
||||
/* Get page table levels (see get_platform_info() in xg_save_restore.h */
|
||||
/* Get page table levels */
|
||||
if ( xc_version(xch, XENVER_capabilities, &xen_caps) )
|
||||
{
|
||||
PERROR("Could not get Xen capabilities (for page table levels)");
|
||||
|
||||
@@ -29,66 +29,6 @@
|
||||
/* When pinning page tables at the end of restore, we also use batching. */
|
||||
#define MAX_PIN_BATCH 1024
|
||||
|
||||
/*
|
||||
** Determine various platform information required for save/restore, in
|
||||
** particular:
|
||||
**
|
||||
** - the maximum MFN on this machine, used to compute the size of
|
||||
** the M2P table;
|
||||
**
|
||||
** - the starting virtual address of the the hypervisor; we use this
|
||||
** to determine which parts of guest address space(s) do and don't
|
||||
** require canonicalization during save/restore; and
|
||||
**
|
||||
** - the number of page-table levels for save/ restore. This should
|
||||
** be a property of the domain, but for the moment we just read it
|
||||
** from the hypervisor.
|
||||
**
|
||||
** - The width of a guest word (unsigned long), in bytes.
|
||||
**
|
||||
** Returns 1 on success, 0 on failure.
|
||||
*/
|
||||
static inline int get_platform_info(xc_interface *xch, uint32_t dom,
|
||||
/* OUT */ unsigned long *max_mfn,
|
||||
/* OUT */ unsigned long *hvirt_start,
|
||||
/* OUT */ unsigned int *pt_levels,
|
||||
/* OUT */ unsigned int *guest_width)
|
||||
{
|
||||
xen_capabilities_info_t xen_caps = "";
|
||||
xen_platform_parameters_t xen_params;
|
||||
|
||||
if (xc_version(xch, XENVER_platform_parameters, &xen_params) != 0)
|
||||
return 0;
|
||||
|
||||
if (xc_version(xch, XENVER_capabilities, &xen_caps) != 0)
|
||||
return 0;
|
||||
|
||||
if (xc_maximum_ram_page(xch, max_mfn))
|
||||
return 0;
|
||||
|
||||
*hvirt_start = xen_params.virt_start;
|
||||
|
||||
if ( xc_domain_get_guest_width(xch, dom, guest_width) != 0)
|
||||
return 0;
|
||||
|
||||
/* 64-bit tools will see the 64-bit hvirt_start, but 32-bit guests
|
||||
* will be using the compat one. */
|
||||
if ( *guest_width < sizeof (unsigned long) )
|
||||
/* XXX need to fix up a way of extracting this value from Xen if
|
||||
* XXX it becomes variable for domU */
|
||||
*hvirt_start = 0xf5800000;
|
||||
|
||||
if (strstr(xen_caps, "xen-3.0-x86_64"))
|
||||
/* Depends on whether it's a compat 32-on-64 guest */
|
||||
*pt_levels = ( (*guest_width == 8) ? 4 : 3 );
|
||||
else if (strstr(xen_caps, "xen-3.0-x86_32p"))
|
||||
*pt_levels = 3;
|
||||
else
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Save/restore deal with the mfn_to_pfn (M2P) and pfn_to_mfn (P2M) tables.
|
||||
|
||||