diff mbox series

[v1] tools: remove get_platform_info from xg_save_restore.h

Message ID 20210105150247.2340-1-olaf@aepfle.de (mailing list archive)
State New, archived
Headers show
Series [v1] tools: remove get_platform_info from xg_save_restore.h | expand

Commit Message

Olaf Hering Jan. 5, 2021, 3:02 p.m. UTC
Last user was removed with commit 4ddf474e2b7c045fadeaf765ac6157de745e84d6
Previously it was also used in migration code, which was removed with commit
b15bc4345e772df92e5ffdbc4c1e9ae2a6206617

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/libs/guest/xg_domain.c       |  2 +-
 tools/libs/guest/xg_save_restore.h | 60 ------------------------------
 2 files changed, 1 insertion(+), 61 deletions(-)
diff mbox series

Patch

diff --git a/tools/libs/guest/xg_domain.c b/tools/libs/guest/xg_domain.c
index 58713cd35d..5019c84e0e 100644
--- a/tools/libs/guest/xg_domain.c
+++ b/tools/libs/guest/xg_domain.c
@@ -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)");
diff --git a/tools/libs/guest/xg_save_restore.h b/tools/libs/guest/xg_save_restore.h
index 88120eb54b..e4fe747c4e 100644
--- a/tools/libs/guest/xg_save_restore.h
+++ b/tools/libs/guest/xg_save_restore.h
@@ -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.