From: Andrew Cooper Date: Thu, 1 Sep 2016 09:45:03 +0000 (+0100) Subject: tools/migrate: Prevent PTE truncation from being fatal duing the live phase X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~491 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a335a58e757232249d7f33503ab5d8f849518a47;p=xen.git 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 Reviewed-by: Wei Liu --- diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c index 7043409231..f218d17bce 100644 --- a/tools/libxc/xc_sr_save_x86_pv.c +++ b/tools/libxc/xc_sr_save_x86_pv.c @@ -949,9 +949,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