From patchwork Mon Jul 24 15:41:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9859755 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 AE22F60349 for ; Mon, 24 Jul 2017 15:44:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F3D9207A7 for ; Mon, 24 Jul 2017 15:44:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9397F26E97; Mon, 24 Jul 2017 15:44:49 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 C4CF026E96 for ; Mon, 24 Jul 2017 15:44:47 +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 1dZfUX-0004ue-3b; Mon, 24 Jul 2017 15:41:53 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZfUV-0004uX-O3 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2017 15:41:51 +0000 Received: from [193.109.254.147] by server-8.bemta-6.messagelabs.com id AA/0A-09901-F3516795; Mon, 24 Jul 2017 15:41:51 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRWlGSWpSXmKPExsXitHRDpK6daFm kwb3rqhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a+lw8YC96IVvzY1sHWwLhPoIuRg0NCwF+i bWZMFyMnB4uAqsSnK01MIDabgLLEz85eNhBbREBX4tmCZ2A2s8B3Romv3wtBbGEBc4n5544xg ti8AhYSv09+Y+1i5OIQEvjJKPHm5mcWiISgxMmZT1ggmnUkFuz+xAayl1lAWmL5Pw6QMKeApc TSA/2sILaogIpE59I5YOVCAgoSHdOPMU1g5JuFZNIsJJNmIUxawMi8ilGjOLWoLLVI18hML6k oMz2jJDcxM0fX0MBMLze1uDgxPTUnMalYLzk/dxMjMNAYgGAH45kFgYcYJTmYlER5hZjKIoX4 kvJTKjMSizPii0pzUosPMcpwcChJ8LIKA+UEi1LTUyvSMnOAIQ+TluDgURLhfSAElOYtLkjML c5Mh0idYlSUEuftBekTAElklObBtcHi7BKjrJQwLyPQIUI8BalFuZklqPKvGMU5GJWEIbbzZO aVwE1/BbSYCWjxnBmlIItLEhFSUg2MpgI1mbPnzItoqZfotaie+5SvfabN5S01r2+zJ89MTJs +e6PgsvY11hdqP1VJfVPhK9Pzf337aYVD2fUHitNfPBeaazv/vNYDr7BXdhsnN/Me7FnXeTgx 41Dbqt8TzgQInuATznYwrbO4avnBj2Xik5AbEsX6H4wOOoudqc3N82jy/HLqcF2yEktxRqKhF nNRcSIAFYAd864CAAA= X-Env-Sender: prvs=371ba8a1d=wei.liu2@citrix.com X-Msg-Ref: server-8.tower-27.messagelabs.com!1500910909!98344216!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22541 invoked from network); 24 Jul 2017 15:41:50 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 24 Jul 2017 15:41:50 -0000 X-IronPort-AV: E=Sophos;i="5.40,407,1496102400"; d="scan'208";a="432719804" Date: Mon, 24 Jul 2017 16:41:47 +0100 From: Wei Liu To: Andrew Cooper Message-ID: <20170724154147.za5yun5a4jgczdot@citrix.com> References: <20170724140208.1571-1-wei.liu2@citrix.com> <65fc4d30-d722-3354-a320-919bee323206@citrix.com> <20170724144458.wvijs5eiviyrkgl2@citrix.com> <20170724152252.yfvdsbcvalpjkvvc@citrix.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170724152252.yfvdsbcvalpjkvvc@citrix.com> User-Agent: NeoMutt/20170113 (1.7.2) Cc: Wei Liu , George Dunlap , Ian Jackson , Jan Beulich , Xen-devel Subject: Re: [Xen-devel] [PATCH 0/3] x86: nuke PV superpage support 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jul 24, 2017 at 04:22:52PM +0100, Wei Liu wrote: > On Mon, Jul 24, 2017 at 04:01:55PM +0100, Andrew Cooper wrote: > > On 24/07/17 15:44, Wei Liu wrote: > > > On Mon, Jul 24, 2017 at 03:25:22PM +0100, Andrew Cooper wrote: > > >> On 24/07/17 15:02, Wei Liu wrote: > > >>> Wei Liu (3): > > >>> x86: nuke PV superpage option and code > > >>> tools: nuke superpage parameters in code > > >>> docs: delete PV superpage option > > >> If you are doing this, can you modify > > >> xc_sr_save_x86_pv.c:normalise_pagetable() to fail immediately if a > > >> superpage is found. Currently, this condition is deferred until the > > >> live phase is complete. > > >> > > > Why was it done like that in the first place? > > > > Because if a PV guest shatters all of its superpages during the live > > phase, it can be successfully moved. > > > > This work was mixed up in the question of the time as to whether PV > > migraiton worked with superpages at all, seeing as the legacy code took > > a (non-working) stab at attempting the migration. > > > > OK. This makes sense. I will submit a separate patch for the thing you > asked for, since it is more like an improvement to the code. ---8<--- From fd4934b754eb3a1b8a98167aa4432a105caac185 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Mon, 24 Jul 2017 16:35:09 +0100 Subject: [PATCH] libxc: bail immediately when PV superpage is discovered The original code was added with the hope that PV superpage migration might work. But it was never proven that the code actually worked. Now that PV superpage is gone, simplify the code by returning error immediately. Suggested-by: Andrew Cooper Signed-off-by: Wei Liu Reviewed-by: Andrew Cooper --- tools/libxc/xc_sr_save_x86_pv.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c index 36b10583d6..ff5efe954b 100644 --- a/tools/libxc/xc_sr_save_x86_pv.c +++ b/tools/libxc/xc_sr_save_x86_pv.c @@ -975,14 +975,9 @@ static int normalise_pagetable(struct xc_sr_context *ctx, const uint64_t *src, if ( (type > XEN_DOMCTL_PFINFO_L1TAB) && (pte & _PAGE_PSE) ) { - if ( !ctx->dominfo.paused ) - errno = EAGAIN; - else - { - ERROR("Cannot migrate superpage (L%lu[%u]: 0x%016"PRIx64")", - type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT, i, pte); - errno = E2BIG; - } + ERROR("Cannot migrate superpage (L%lu[%u]: 0x%016"PRIx64")", + type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT, i, pte); + errno = E2BIG; return -1; }