xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>
Subject: [PATCH] tools/migrate: Prevent PTE truncation from being fatal duing the live phase
Date: Thu, 1 Sep 2016 10:45:03 +0100	[thread overview]
Message-ID: <1472723103-25443-1-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <osstest-100687-mainreport@xen.org>

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@citrix.com>
---
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>

This was hit by OSSTest:
http://logs.test-lab.xenproject.org/osstest/logs/100684/test-amd64-i386-xl-raw/16.ts-guest-localmigrate.log

The patch is untested, but the only plausible option given the circumstances.
---
 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 7043409..f218d17 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
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-09-01  9:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01  8:47 [ovmf test] 100687: all pass - PUSHED osstest service owner
2016-09-01  9:45 ` Andrew Cooper [this message]
2016-09-02  8:30   ` [PATCH] tools/migrate: Prevent PTE truncation from being fatal duing the live phase Wei Liu
2016-09-02  8:56     ` Wei Liu
2016-09-02 10:54       ` Ian Jackson
  -- strict thread matches above, loose matches on Subject: below --
2016-09-01  8:51 [xen-unstable test] 100684: regressions - FAIL osstest service owner
2016-09-01  9:51 ` [PATCH] tools/migrate: Prevent PTE truncation from being fatal duing the live phase Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472723103-25443-1-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).