From nobody Tue May 7 05:34:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1609859012; cv=none; d=zohomail.com; s=zohoarc; b=ftAgOj2XR7K3z3mW0ED7D0rbr+DE+Yz7lo5FvDS+oM7e2Ds8MYFq3/3uKyajeyHAyJeARPoKqfVtCbHRLlwgjqOQZCAPtvbnXRlA3De9AxqHcekYq0io96F2B2epK1+DzBDPyb/gS36L0E7xDvV7dqr4dcA+wKI/3JdONr/5taE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609859012; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=R5uc+dnxfwlGfSTbEpuaS28Fi4u/sQjshYr1/3gULHw=; b=d93l21nWGPnyBZhkLZuEg2IChaL1veroYxevKbeYM3Ihh6p9xbwKHmaJx40AOuEieBB27s8/c1+DeToeaHZmNlSa9M1m2+WpXBvuvwXVLJITfdlxtYQ/zVerP+ZZmMORh5egPqXmRVzA0LVk8cdbLm+pb46xAvs+W29IYE0edFQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1609859012407718.2525908302113; Tue, 5 Jan 2021 07:03:32 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.62029.109538 (Exim 4.92) (envelope-from ) id 1kwnrS-0004sx-Fc; Tue, 05 Jan 2021 15:03:02 +0000 Received: by outflank-mailman (output) from mailman id 62029.109538; Tue, 05 Jan 2021 15:03:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kwnrS-0004sq-CI; Tue, 05 Jan 2021 15:03:02 +0000 Received: by outflank-mailman (input) for mailman id 62029; Tue, 05 Jan 2021 15:03:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kwnrQ-0004sl-VV for xen-devel@lists.xenproject.org; Tue, 05 Jan 2021 15:03:01 +0000 Received: from mo4-p00-ob.smtp.rzone.de (unknown [81.169.146.162]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d333e1ca-83a9-47ef-b1ce-b9758a197d96; Tue, 05 Jan 2021 15:02:58 +0000 (UTC) Received: from sender by smtp.strato.de (RZmta 47.12.1 DYNA|AUTH) with ESMTPSA id h0968ex05F2n1W3 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Tue, 5 Jan 2021 16:02:49 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d333e1ca-83a9-47ef-b1ce-b9758a197d96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1609858977; s=strato-dkim-0002; d=aepfle.de; h=Message-Id:Date:Subject:Cc:To:From:From:Subject:Sender; bh=R5uc+dnxfwlGfSTbEpuaS28Fi4u/sQjshYr1/3gULHw=; b=BXxSEQ9zmdyVx/FP6di96zc98gss8TxbQgIPpEHMb3wOvLFF4DIKVh1McBb3xBs6G3 3NMalWeYaPSUFXO495Pb1TQgGNeHqnZ3W8Sa2Pim6RSKSPjuhca7UnbOvI+VKOocUgE+ Xkblxg4yFpVKbjTDMSkP5w+Q3hmDunt1kB2k17apO1iOcLsn4SqEXROyFo5mq4GOUS23 166iol6z1wnirHIqsErOAw+bhRBidQfXp+xEzfsHnKkXCgY6/6g39BWosRe+AB+3TEZC uocCb+Iy+4vsAfZ+PzUuob20gCILQzdNz0UntcKphdVTitl+oXqBpDOIpz2cUFSHviYC mQpQ== X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS321Mjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: xen-devel@lists.xenproject.org Cc: Olaf Hering , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH v1] tools: remove get_platform_info from xg_save_restore.h Date: Tue, 5 Jan 2021 16:02:47 +0100 Message-Id: <20210105150247.2340-1-olaf@aepfle.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 --- tools/libs/guest/xg_domain.c | 2 +- tools/libs/guest/xg_save_restore.h | 60 ------------------------------ 2 files changed, 1 insertion(+), 61 deletions(-) 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 dom= id, } _di.guest_width =3D minfo->guest_width; =20 - /* 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 =20 -/* -** 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 =3D ""; - xen_platform_parameters_t xen_params; - - if (xc_version(xch, XENVER_platform_parameters, &xen_params) !=3D 0) - return 0; - - if (xc_version(xch, XENVER_capabilities, &xen_caps) !=3D 0) - return 0; - - if (xc_maximum_ram_page(xch, max_mfn)) - return 0; - - *hvirt_start =3D xen_params.virt_start; - - if ( xc_domain_get_guest_width(xch, dom, guest_width) !=3D 0) - return 0;=20 - - /* 64-bit tools will see the 64-bit hvirt_start, but 32-bit guests=20 - * 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 =3D 0xf5800000; - - if (strstr(xen_caps, "xen-3.0-x86_64")) - /* Depends on whether it's a compat 32-on-64 guest */ - *pt_levels =3D ( (*guest_width =3D=3D 8) ? 4 : 3 ); - else if (strstr(xen_caps, "xen-3.0-x86_32p")) - *pt_levels =3D 3; - else - return 0; - - return 1; -} - =20 /* ** Save/restore deal with the mfn_to_pfn (M2P) and pfn_to_mfn (P2M) tables.