]> xenbits.xensource.com Git - xen.git/commitdiff
libxc: correct max_pfn calculation for saving domain
authorJuergen Gross <jgross@suse.com>
Fri, 26 Aug 2016 11:58:55 +0000 (13:58 +0200)
committerWei Liu <wei.liu2@citrix.com>
Tue, 30 Aug 2016 12:43:31 +0000 (13:43 +0100)
Commit 91e204d37f44913913776d0a89279721694f8b32 ("libxc: try to find
last used pfn when migrating") introduced a bug for the case of a
domain supporting the virtual mapped linear p2m list: the maximum pfn
of the domain calculated from the p2m memory allocation might be too
low.

Correct this.

Reported-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxc/xc_sr_save_x86_pv.c

index 4a29460a313a50038185298232132c783d333dd9..7043409231935e36e1b2dd1c840adc993cc1b5e8 100644 (file)
@@ -430,6 +430,8 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
 
         if ( level == 2 )
         {
+            if ( saved_idx == idx_end )
+                saved_idx++;
             max_pfn = ((xen_pfn_t)saved_idx << 9) * fpp - 1;
             if ( max_pfn < ctx->x86_pv.max_pfn )
             {