From patchwork Thu Aug 24 10:14:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 9919733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A8FE60353 for ; Thu, 24 Aug 2017 10:17:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39F8328B66 for ; Thu, 24 Aug 2017 10:17:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EA6428BD3; Thu, 24 Aug 2017 10:17:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 49CCD28B66 for ; Thu, 24 Aug 2017 10:17:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkpAV-0002qR-IO; Thu, 24 Aug 2017 10:15:19 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkpAT-0002nj-Nb for xen-devel@lists.xen.org; Thu, 24 Aug 2017 10:15:17 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id EE/18-01994-537AE995; Thu, 24 Aug 2017 10:15:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsUSuHLSDV2j5fM iDZpP8Fks+biYxYHR4+ju30wBjFGsmXlJ+RUJrBlbjzxnKVjQwlixctkexgbG37FdjFwcLAKf mCS27f/E0sXIwSEhkCmxbF4YhCki8eR/GkiJkMBBJom53UuASjg52ASUJPYePM4IkhARmMgoc fD0PUaQBLOAgsSL51uZQGxhAX+JX4t/gtksAqoSZ07cYgOxeQWMJfbsuA42SEJAXqJ/x3KwGk 4BE4lzC/eD2UJANdu/XWeZwMi7gJFhFaNGcWpRWWqRrpGFXlJRZnpGSW5iZo6uoYGpXm5qcXF iempOYlKxXnJ+7iZGYEDUMzAw7mDsW+V3iFGSg0lJlPeJ9LxIIb6k/JTKjMTijPii0pzU4kOM MhwcShK8usuAcoJFqempFWmZOcDQhElLcPAoifCWgqR5iwsSc4sz0yFSpxh1OTasXv+FSYglL z8vVUqc1wWkSACkKKM0D24ELE4uMcpKCfMyMjAwCPEUpBblZpagyr9iFOdgVBLmvbYUaApPZl 4J3KZXQEcwAR0x6cQckCNKEhFSUg2M+duW8mm66e+cvLtrtU/7q+2n8q210v9H/6+aemDfr9/ nInKUC6tex7bHfuNubs6p0G8Vf3MiMyt1j9fKM2kN33YIlxz6Yrdq1Rsz3gDJqoy4ch+Fr0km 8ptmSZxaPk2pO6HG5d8VWZWwWaKSf9cZfppku0zVI9DncnCCt3PAL58t01i6X1grsRRnJBpqM RcVJwIAneV4FI4CAAA= X-Env-Sender: olaf@aepfle.de X-Msg-Ref: server-8.tower-206.messagelabs.com!1503569714!108512423!1 X-Originating-IP: [81.169.146.216] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6738 invoked from network); 24 Aug 2017 10:15:14 -0000 Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.216) by server-8.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 24 Aug 2017 10:15:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1503569713; s=domk; d=aepfle.de; h=References:In-Reply-To:Date:Subject:Cc:To:From; bh=4S9qg7tsF/S9XbWRMRu8FEBWDQfatfYiVnZLPn4gvmI=; b=aU1NA9QqcdRtfa2FhS8mAEGOV7Tm/TDLUyD5RbARGVpBNnjgDhVPzgsqjM1wJoxMvr S4no7N0/hyiIvE9kIl2nhY/AyQaJRxsAm0mWOFngWfCaiSfOoNJ+FNZoCtwtOCQAWzc8 V2x2/K2DpEONPSzAXtj22MF+7gIDygwg7uksU= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWi/zfN1cLnAYQz4mzReZKAqPT2tb6Nx5EL7HQvAw3tBGHnS2eB9 X-RZG-CLASS-ID: mo00 Received: from sender ([2001:a61:3430:dff:75aa:c36f:225e:fcee]) by smtp.strato.de (RZmta 41.4 AUTH) with ESMTPSA id q03d67t7OAF6AJb (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Thu, 24 Aug 2017 12:15:06 +0200 (CEST) From: Olaf Hering To: xen-devel@lists.xen.org, Andrew Cooper , Ian Jackson , Wei Liu Date: Thu, 24 Aug 2017 12:14:43 +0200 Message-Id: <20170824101443.31345-4-olaf@aepfle.de> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170824101443.31345-1-olaf@aepfle.de> References: <20170824101443.31345-1-olaf@aepfle.de> Cc: Olaf Hering Subject: [Xen-devel] [PATCH v3 3/3] tools/libxc: use superpages during restore of HVM guest X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP During creating of a HVM domU meminit_hvm() tries to map superpages. After save/restore or migration this mapping is lost, everything is allocated in single pages. This causes a performance degradition after migration. Add neccessary code to preallocate a superpage for the chunk of pfns that is received. In case a pfn was not populated on the sending side it must be freed on the receiving side to avoid over-allocation. The existing code for x86_pv is moved unmodified into its own file. Signed-off-by: Olaf Hering --- tools/libxc/xc_sr_common.h | 25 +++-- tools/libxc/xc_sr_restore.c | 75 ++----------- tools/libxc/xc_sr_restore_x86_hvm.c | 202 ++++++++++++++++++++++++++++++++++++ tools/libxc/xc_sr_restore_x86_pv.c | 72 ++++++++++++- 4 files changed, 296 insertions(+), 78 deletions(-) diff --git a/tools/libxc/xc_sr_common.h b/tools/libxc/xc_sr_common.h index 8901af112a..bf2758e91a 100644 --- a/tools/libxc/xc_sr_common.h +++ b/tools/libxc/xc_sr_common.h @@ -139,6 +139,16 @@ struct xc_sr_restore_ops */ int (*setup)(struct xc_sr_context *ctx); + /** + * Populate PFNs + * + * Given a set of pfns, obtain memory from Xen to fill the physmap for the + * unpopulated subset. + */ + int (*populate_pfns)(struct xc_sr_context *ctx, unsigned count, + const xen_pfn_t *original_pfns, const uint32_t *types); + + /** * Process an individual record from the stream. The caller shall take * care of processing common records (e.g. END, PAGE_DATA). @@ -224,6 +234,8 @@ struct xc_sr_context int send_back_fd; unsigned long p2m_size; + unsigned long max_pages; + unsigned long tot_pages; xc_hypercall_buffer_t dirty_bitmap_hbuf; /* From Image Header. */ @@ -336,6 +348,11 @@ struct xc_sr_context /* HVM context blob. */ void *context; size_t contextsz; + + /* Bitmap of currently allocated PFNs during restore. */ + struct xc_sr_bitmap attempted_1g; + struct xc_sr_bitmap attempted_2m; + struct xc_sr_bitmap allocated_pfns; } restore; }; } x86_hvm; @@ -455,14 +472,6 @@ static inline int write_record(struct xc_sr_context *ctx, */ int read_record(struct xc_sr_context *ctx, int fd, struct xc_sr_record *rec); -/* - * This would ideally be private in restore.c, but is needed by - * x86_pv_localise_page() if we receive pagetables frames ahead of the - * contents of the frames they point at. - */ -int populate_pfns(struct xc_sr_context *ctx, unsigned count, - const xen_pfn_t *original_pfns, const uint32_t *types); - #endif /* * Local variables: diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c index d53948e1a6..8cd9289d1a 100644 --- a/tools/libxc/xc_sr_restore.c +++ b/tools/libxc/xc_sr_restore.c @@ -68,74 +68,6 @@ static int read_headers(struct xc_sr_context *ctx) return 0; } -/* - * Given a set of pfns, obtain memory from Xen to fill the physmap for the - * unpopulated subset. If types is NULL, no page type checking is performed - * and all unpopulated pfns are populated. - */ -int populate_pfns(struct xc_sr_context *ctx, unsigned count, - const xen_pfn_t *original_pfns, const uint32_t *types) -{ - xc_interface *xch = ctx->xch; - xen_pfn_t *mfns = malloc(count * sizeof(*mfns)), - *pfns = malloc(count * sizeof(*pfns)); - unsigned i, nr_pfns = 0; - int rc = -1; - - if ( !mfns || !pfns ) - { - ERROR("Failed to allocate %zu bytes for populating the physmap", - 2 * count * sizeof(*mfns)); - goto err; - } - - for ( i = 0; i < count; ++i ) - { - if ( (!types || (types && - (types[i] != XEN_DOMCTL_PFINFO_XTAB && - types[i] != XEN_DOMCTL_PFINFO_BROKEN))) && - !pfn_is_populated(ctx, original_pfns[i]) ) - { - rc = pfn_set_populated(ctx, original_pfns[i]); - if ( rc ) - goto err; - pfns[nr_pfns] = mfns[nr_pfns] = original_pfns[i]; - ++nr_pfns; - } - } - - if ( nr_pfns ) - { - rc = xc_domain_populate_physmap_exact( - xch, ctx->domid, nr_pfns, 0, 0, mfns); - if ( rc ) - { - PERROR("Failed to populate physmap"); - goto err; - } - - for ( i = 0; i < nr_pfns; ++i ) - { - if ( mfns[i] == INVALID_MFN ) - { - ERROR("Populate physmap failed for pfn %u", i); - rc = -1; - goto err; - } - - ctx->restore.ops.set_gfn(ctx, pfns[i], mfns[i]); - } - } - - rc = 0; - - err: - free(pfns); - free(mfns); - - return rc; -} - /* * Given a list of pfns, their types, and a block of page data from the * stream, populate and record their types, map the relevant subset and copy @@ -161,7 +93,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count, goto err; } - rc = populate_pfns(ctx, count, pfns, types); + rc = ctx->restore.ops.populate_pfns(ctx, count, pfns, types); if ( rc ) { ERROR("Failed to populate pfns for batch of %u pages", count); @@ -826,7 +758,12 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, return -1; } + /* See xc_domain_getinfo */ + ctx.restore.max_pages = ctx.dominfo.max_memkb >> (PAGE_SHIFT-10); + ctx.restore.tot_pages = ctx.dominfo.nr_pages; ctx.restore.p2m_size = nr_pfns; + DPRINTF("dom %u p2m_size %lx max_pages %lx", + ctx.domid, ctx.restore.p2m_size, ctx.restore.max_pages); if ( ctx.dominfo.hvm ) { diff --git a/tools/libxc/xc_sr_restore_x86_hvm.c b/tools/libxc/xc_sr_restore_x86_hvm.c index 1dca85354a..135872ca53 100644 --- a/tools/libxc/xc_sr_restore_x86_hvm.c +++ b/tools/libxc/xc_sr_restore_x86_hvm.c @@ -135,6 +135,8 @@ static int x86_hvm_localise_page(struct xc_sr_context *ctx, static int x86_hvm_setup(struct xc_sr_context *ctx) { xc_interface *xch = ctx->xch; + struct xc_sr_bitmap *bm; + unsigned long bits; if ( ctx->restore.guest_type != DHDR_TYPE_X86_HVM ) { @@ -149,7 +151,30 @@ static int x86_hvm_setup(struct xc_sr_context *ctx) return -1; } + bm = &ctx->x86_hvm.restore.attempted_1g; + bits = (ctx->restore.p2m_size >> SUPERPAGE_1GB_SHIFT) + 1; + if ( xc_sr_bitmap_resize(bm, bits) == false ) + goto out; + + bm = &ctx->x86_hvm.restore.attempted_2m; + bits = (ctx->restore.p2m_size >> SUPERPAGE_2MB_SHIFT) + 1; + if ( xc_sr_bitmap_resize(bm, bits) == false ) + goto out; + + bm = &ctx->x86_hvm.restore.allocated_pfns; + bits = ctx->restore.p2m_size + 1; + if ( xc_sr_bitmap_resize(bm, bits) == false ) + goto out; + + /* No superpage in 1st 2MB due to VGA hole */ + xc_sr_set(0, &ctx->x86_hvm.restore.attempted_1g); + xc_sr_set(0, &ctx->x86_hvm.restore.attempted_2m); + return 0; + +out: + ERROR("Unable to allocate memory for pfn bitmaps"); + return -1; } /* @@ -224,10 +249,186 @@ static int x86_hvm_stream_complete(struct xc_sr_context *ctx) static int x86_hvm_cleanup(struct xc_sr_context *ctx) { free(ctx->x86_hvm.restore.context); + xc_sr_bitmap_free(&ctx->x86_hvm.restore.attempted_1g); + xc_sr_bitmap_free(&ctx->x86_hvm.restore.attempted_2m); + xc_sr_bitmap_free(&ctx->x86_hvm.restore.allocated_pfns); + + return 0; +} +/* + * Set a pfn as allocated, expanding the tracking structures if needed. + */ +static int pfn_set_allocated(struct xc_sr_context *ctx, xen_pfn_t pfn) +{ + xc_interface *xch = ctx->xch; + + if ( !xc_sr_set(pfn, &ctx->x86_hvm.restore.allocated_pfns) ) + { + ERROR("Failed to realloc allocated_pfns bitmap"); + errno = ENOMEM; + return -1; + } return 0; } +static bool x86_hvm_do_superpage(struct xc_sr_context *ctx, unsigned int order) +{ + unsigned long count = 1ULL << order; + return ctx->restore.tot_pages + count <= ctx->restore.max_pages; +} + +/* + * Attempt to allocate a superpage where the pfn resides. + */ +static int x86_hvm_allocate_pfn(struct xc_sr_context *ctx, xen_pfn_t pfn) +{ + xc_interface *xch = ctx->xch; + struct xc_sr_bitmap *bm; + bool success = false; + int rc = -1, done; + unsigned int order, shift; + unsigned long i; + unsigned long idx_1g, idx_2m; + unsigned long count; + xen_pfn_t base_pfn = 0, extnt; + + if ( xc_sr_test(pfn, &ctx->x86_hvm.restore.allocated_pfns) ) + return 0; + + idx_1g = pfn >> SUPERPAGE_1GB_SHIFT; + idx_2m = pfn >> SUPERPAGE_2MB_SHIFT; + if ( !xc_sr_bitmap_resize(&ctx->x86_hvm.restore.attempted_1g, idx_1g) ) + { + PERROR("Failed to realloc attempted_1g"); + return -1; + } + if ( !xc_sr_bitmap_resize(&ctx->x86_hvm.restore.attempted_2m, idx_2m) ) + { + PERROR("Failed to realloc attempted_2m"); + return -1; + } + + /* + * Try to allocate a 1GB page for this pfn, but avoid Over-allocation. + * If this succeeds, mark the range of 2MB pages as busy. + */ + bm = &ctx->x86_hvm.restore.attempted_1g; + order = SUPERPAGE_1GB_SHIFT; + if ( !xc_sr_test_and_set(idx_1g, bm) && x86_hvm_do_superpage(ctx, order) ) { + count = 1UL << order; + base_pfn = (pfn >> order) << order; + extnt = base_pfn; + done = xc_domain_populate_physmap(xch, ctx->domid, 1, order, 0, &extnt); + if ( done > 0 ) { + DPRINTF("1G base_pfn %" PRI_xen_pfn "\n", base_pfn); + success = true; + bm = &ctx->x86_hvm.restore.attempted_2m; + shift = SUPERPAGE_1GB_SHIFT - SUPERPAGE_2MB_SHIFT; + for ( i = 0; i < (count >> shift); i++ ) + xc_sr_set((base_pfn >> SUPERPAGE_2MB_SHIFT) + i, bm); + } else if ( done < 0 ) { + PERROR("populate_physmap failed."); + return -1; + } + } + + /* Allocate a 2MB page if the above failed, avoid Over-allocation. */ + bm = &ctx->x86_hvm.restore.attempted_2m; + order = SUPERPAGE_2MB_SHIFT; + if ( !xc_sr_test_and_set(idx_2m, bm) && x86_hvm_do_superpage(ctx, order) ) { + count = 1UL << order; + base_pfn = (pfn >> order) << order; + extnt = base_pfn; + done = xc_domain_populate_physmap(xch, ctx->domid, 1, order, 0, &extnt); + if ( done > 0 ) { + DPRINTF("2M base_pfn %" PRI_xen_pfn "\n", base_pfn); + success = true; + } else if ( done < 0 ) { + PERROR("populate_physmap failed."); + return -1; + } + } + if ( success == false ) { + count = 1; + extnt = base_pfn = pfn; + done = xc_domain_populate_physmap(xch, ctx->domid, count, 0, 0, &extnt); + if ( done > 0 ) { + DPRINTF("4K pfn %" PRI_xen_pfn "\n", pfn); + success = true; + } else if ( done < 0 ) { + PERROR("populate_physmap failed."); + return -1; + } + } + if ( success == true ) { + do { + count--; + ctx->restore.tot_pages++; + rc = pfn_set_allocated(ctx, base_pfn + count); + if ( rc ) + break; + } while ( count ); + } + return rc; +} + +static int x86_hvm_populate_pfns(struct xc_sr_context *ctx, unsigned count, + const xen_pfn_t *original_pfns, + const uint32_t *types) +{ + xc_interface *xch = ctx->xch; + xen_pfn_t min_pfn = original_pfns[0], max_pfn = original_pfns[0]; + unsigned i; + int rc = -1; + + for ( i = 0; i < count; ++i ) + { + if ( original_pfns[i] < min_pfn ) + min_pfn = original_pfns[i]; + if ( original_pfns[i] > max_pfn ) + max_pfn = original_pfns[i]; + if ( (types[i] != XEN_DOMCTL_PFINFO_XTAB && + types[i] != XEN_DOMCTL_PFINFO_BROKEN) && + !pfn_is_populated(ctx, original_pfns[i]) ) + { + rc = x86_hvm_allocate_pfn(ctx, original_pfns[i]); + if ( rc ) + goto err; + rc = pfn_set_populated(ctx, original_pfns[i]); + if ( rc ) + goto err; + } + } + + while ( min_pfn < max_pfn ) + { + if ( !xc_sr_bitmap_resize(&ctx->x86_hvm.restore.allocated_pfns, min_pfn) ) + { + PERROR("Failed to realloc allocated_pfns %" PRI_xen_pfn, min_pfn); + goto err; + } + if ( !pfn_is_populated(ctx, min_pfn) && + xc_sr_test_and_clear(min_pfn, &ctx->x86_hvm.restore.allocated_pfns) ) { + xen_pfn_t pfn = min_pfn; + rc = xc_domain_decrease_reservation_exact(xch, ctx->domid, 1, 0, &pfn); + if ( rc ) + { + PERROR("Failed to release pfn %" PRI_xen_pfn, min_pfn); + goto err; + } + ctx->restore.tot_pages--; + } + min_pfn++; + } + + rc = 0; + + err: + return rc; +} + + struct xc_sr_restore_ops restore_ops_x86_hvm = { .pfn_is_valid = x86_hvm_pfn_is_valid, @@ -236,6 +437,7 @@ struct xc_sr_restore_ops restore_ops_x86_hvm = .set_page_type = x86_hvm_set_page_type, .localise_page = x86_hvm_localise_page, .setup = x86_hvm_setup, + .populate_pfns = x86_hvm_populate_pfns, .process_record = x86_hvm_process_record, .stream_complete = x86_hvm_stream_complete, .cleanup = x86_hvm_cleanup, diff --git a/tools/libxc/xc_sr_restore_x86_pv.c b/tools/libxc/xc_sr_restore_x86_pv.c index 50e25c162c..87957559bc 100644 --- a/tools/libxc/xc_sr_restore_x86_pv.c +++ b/tools/libxc/xc_sr_restore_x86_pv.c @@ -936,6 +936,75 @@ static void x86_pv_set_gfn(struct xc_sr_context *ctx, xen_pfn_t pfn, ((uint32_t *)ctx->x86_pv.p2m)[pfn] = mfn; } +/* + * Given a set of pfns, obtain memory from Xen to fill the physmap for the + * unpopulated subset. If types is NULL, no page type checking is performed + * and all unpopulated pfns are populated. + */ +static int x86_pv_populate_pfns(struct xc_sr_context *ctx, unsigned count, + const xen_pfn_t *original_pfns, + const uint32_t *types) +{ + xc_interface *xch = ctx->xch; + xen_pfn_t *mfns = malloc(count * sizeof(*mfns)), + *pfns = malloc(count * sizeof(*pfns)); + unsigned i, nr_pfns = 0; + int rc = -1; + + if ( !mfns || !pfns ) + { + ERROR("Failed to allocate %zu bytes for populating the physmap", + 2 * count * sizeof(*mfns)); + goto err; + } + + for ( i = 0; i < count; ++i ) + { + if ( (!types || (types && + (types[i] != XEN_DOMCTL_PFINFO_XTAB && + types[i] != XEN_DOMCTL_PFINFO_BROKEN))) && + !pfn_is_populated(ctx, original_pfns[i]) ) + { + rc = pfn_set_populated(ctx, original_pfns[i]); + if ( rc ) + goto err; + pfns[nr_pfns] = mfns[nr_pfns] = original_pfns[i]; + ++nr_pfns; + } + } + + if ( nr_pfns ) + { + rc = xc_domain_populate_physmap_exact( + xch, ctx->domid, nr_pfns, 0, 0, mfns); + if ( rc ) + { + PERROR("Failed to populate physmap"); + goto err; + } + + for ( i = 0; i < nr_pfns; ++i ) + { + if ( mfns[i] == INVALID_MFN ) + { + ERROR("Populate physmap failed for pfn %u", i); + rc = -1; + goto err; + } + + ctx->restore.ops.set_gfn(ctx, pfns[i], mfns[i]); + } + } + + rc = 0; + + err: + free(pfns); + free(mfns); + + return rc; +} + /* * restore_ops function. Convert pfns back to mfns in pagetables. Possibly * needs to populate new frames if a PTE is found referring to a frame which @@ -980,7 +1049,7 @@ static int x86_pv_localise_page(struct xc_sr_context *ctx, } } - if ( to_populate && populate_pfns(ctx, to_populate, pfns, NULL) ) + if ( to_populate && x86_pv_populate_pfns(ctx, to_populate, pfns, NULL) ) return -1; for ( i = 0; i < (PAGE_SIZE / sizeof(uint64_t)); ++i ) @@ -1160,6 +1229,7 @@ struct xc_sr_restore_ops restore_ops_x86_pv = .set_gfn = x86_pv_set_gfn, .localise_page = x86_pv_localise_page, .setup = x86_pv_setup, + .populate_pfns = x86_pv_populate_pfns, .process_record = x86_pv_process_record, .stream_complete = x86_pv_stream_complete, .cleanup = x86_pv_cleanup,