[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.6] tools/migrate: Prevent PTE truncation from being fatal duing the live phase



commit cc977b7ab0334d8d9890faece7ec0ffe14956da5
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu Sep 1 10:45:03 2016 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Mon Sep 19 16:33:53 2016 +0100

    tools/migrate: Prevent PTE truncation from being fatal duing the live phase
    
    It is possible, when normalising a PV pagetable that the table has been 
freed
    and reused for something else by the guest.
    
    In such a case, data read might no longer be a pagetable, and fail the
    truncation check.  However, this should only be fatal if we encounter such a
    page in the paused phase.
    
    This check is now consistent with all other checks in the same area.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    (cherry picked from commit a335a58e757232249d7f33503ab5d8f849518a47)
    (cherry picked from commit 7e17174735034803c55a4650e42fbe657846d318)
---
 tools/libxc/xc_sr_save_x86_pv.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c
index f63f40b..f29cfc9 100644
--- a/tools/libxc/xc_sr_save_x86_pv.c
+++ b/tools/libxc/xc_sr_save_x86_pv.c
@@ -695,9 +695,14 @@ static int normalise_pagetable(struct xc_sr_context *ctx, 
const uint64_t *src,
 #ifdef __i386__
             if ( mfn == INVALID_MFN )
             {
-                ERROR("PTE truncation detected.  L%lu[%u] = %016"PRIx64,
-                      type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT, i, pte);
-                errno = E2BIG;
+                if ( !ctx->dominfo.paused )
+                    errno = EAGAIN;
+                else
+                {
+                    ERROR("PTE truncation detected.  L%lu[%u] = %016"PRIx64,
+                          type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT, i, pte);
+                    errno = E2BIG;
+                }
                 return -1;
             }
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.