From patchwork Wed Dec 30 02:37:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Congyang X-Patchwork-Id: 7931631 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 00BB6BEEE5 for ; Wed, 30 Dec 2015 02:40:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1041220220 for ; Wed, 30 Dec 2015 02:40:37 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8745E20211 for ; Wed, 30 Dec 2015 02:40:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aE6f0-0002qI-Pl; Wed, 30 Dec 2015 02:38:46 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aE6ex-0002gn-2m for xen-devel@lists.xen.org; Wed, 30 Dec 2015 02:38:43 +0000 Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id 84/C3-24450-2B343865; Wed, 30 Dec 2015 02:38:42 +0000 X-Env-Sender: wency@cn.fujitsu.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1451443108!13748866!3 X-Originating-IP: [59.151.112.132] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30372 invoked from network); 30 Dec 2015 02:38:41 -0000 Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by server-9.tower-27.messagelabs.com with SMTP; 30 Dec 2015 02:38:41 -0000 X-IronPort-AV: E=Sophos;i="5.20,346,1444665600"; d="scan'208";a="2080169" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 30 Dec 2015 10:38:22 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 72C5A41887FC; Wed, 30 Dec 2015 10:38:00 +0800 (CST) Received: from G08FNSTD140052.g08.fujitsu.local (10.167.226.52) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Wed, 30 Dec 2015 10:38:00 +0800 From: Wen Congyang To: xen devel , Andrew Cooper , Ian Campbell , Ian Jackson , Wei Liu Date: Wed, 30 Dec 2015 10:37:33 +0800 Message-ID: <1451443075-27428-4-git-send-email-wency@cn.fujitsu.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1451443075-27428-1-git-send-email-wency@cn.fujitsu.com> References: <1451443075-27428-1-git-send-email-wency@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.52] X-yoursite-MailScanner-ID: 72C5A41887FC.A89BF X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: wency@cn.fujitsu.com X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Cc: Lars Kurth , Changlong Xie , Wen Congyang , Gui Jianfeng , Jiang Yunhong , Dong Eddie , Shriram Rajagopalan , Yang Hongyang Subject: [Xen-devel] [PATCH v9 03/25] libxc/migration: Specification update for DIRTY_PFN_LIST records X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Used by secondary to send it's dirty bitmap to primary under COLO. Signed-off-by: Yang Hongyang Signed-off-by: Wen Congyang --- docs/specs/libxc-migration-stream.pandoc | 24 +++++++++++++++++++++++- tools/libxc/xc_sr_common.c | 1 + tools/libxc/xc_sr_stream_format.h | 1 + tools/python/xen/migration/libxc.py | 8 ++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/libxc-migration-stream.pandoc index 8cd678f..ae1f1d0 100644 --- a/docs/specs/libxc-migration-stream.pandoc +++ b/docs/specs/libxc-migration-stream.pandoc @@ -227,7 +227,9 @@ type 0x00000000: END 0x0000000E: CHECKPOINT - 0x0000000F - 0x7FFFFFFF: Reserved for future _mandatory_ + 0x0000000F: DIRTY_PFN_LIST + + 0x00000010 - 0x7FFFFFFF: Reserved for future _mandatory_ records. 0x80000000 - 0xFFFFFFFF: Reserved for future _optional_ @@ -599,6 +601,26 @@ CHECKPOINT record or an END record. \clearpage +DIRTY_PFN_LIST +------------ + +A dirty pfn list record is used to convey information about dirty memory +in the VM. It is an unordered list of PFNs. Currently only applicable in +the backchannel of a checkpointed stream. + + 0 1 2 3 4 5 6 7 octet + +-------------------------------------------------+ + | pfn[0] | + +-------------------------------------------------+ + ... + +-------------------------------------------------+ + | pfn[C-1] | + +-------------------------------------------------+ + +The count of pfns is: record->length/sizeof(uint64_t). + +\clearpage + Layout ====== diff --git a/tools/libxc/xc_sr_common.c b/tools/libxc/xc_sr_common.c index 945cfa6..8150140 100644 --- a/tools/libxc/xc_sr_common.c +++ b/tools/libxc/xc_sr_common.c @@ -35,6 +35,7 @@ static const char *mandatory_rec_types[] = [REC_TYPE_X86_PV_VCPU_MSRS] = "x86 PV vcpu msrs", [REC_TYPE_VERIFY] = "Verify", [REC_TYPE_CHECKPOINT] = "Checkpoint", + [REC_TYPE_DIRTY_PFN_LIST] = "Dirty pfn list", }; const char *rec_type_to_str(uint32_t type) diff --git a/tools/libxc/xc_sr_stream_format.h b/tools/libxc/xc_sr_stream_format.h index 6d0f8fd..8b8533f 100644 --- a/tools/libxc/xc_sr_stream_format.h +++ b/tools/libxc/xc_sr_stream_format.h @@ -75,6 +75,7 @@ struct xc_sr_rhdr #define REC_TYPE_X86_PV_VCPU_MSRS 0x0000000cU #define REC_TYPE_VERIFY 0x0000000dU #define REC_TYPE_CHECKPOINT 0x0000000eU +#define REC_TYPE_DIRTY_PFN_LIST 0x0000000fU #define REC_TYPE_OPTIONAL 0x80000000U diff --git a/tools/python/xen/migration/libxc.py b/tools/python/xen/migration/libxc.py index b0255ac..47da5e3 100644 --- a/tools/python/xen/migration/libxc.py +++ b/tools/python/xen/migration/libxc.py @@ -60,6 +60,7 @@ REC_TYPE_toolstack = 0x0000000b REC_TYPE_x86_pv_vcpu_msrs = 0x0000000c REC_TYPE_verify = 0x0000000d REC_TYPE_checkpoint = 0x0000000e +REC_TYPE_dirty_pfn_list = 0x0000000f rec_type_to_str = { REC_TYPE_end : "End", @@ -77,6 +78,7 @@ rec_type_to_str = { REC_TYPE_x86_pv_vcpu_msrs : "x86 PV vcpu msrs", REC_TYPE_verify : "Verify", REC_TYPE_checkpoint : "Checkpoint", + REC_TYPE_dirty_pfn_list : "Dirty pfn list" } # page_data @@ -403,6 +405,10 @@ class VerifyLibxc(VerifyBase): if len(content) != 0: raise RecordError("Checkpoint record with non-zero length") + def verify_record_dirty_pfn_list(self, content): + """ dirty pfn list """ + raise RecordError("Found dirty pfn list record in stream") + record_verifiers = { REC_TYPE_end: @@ -443,4 +449,6 @@ record_verifiers = { VerifyLibxc.verify_record_verify, REC_TYPE_checkpoint: VerifyLibxc.verify_record_checkpoint, + REC_TYPE_dirty_pfn_list: + VerifyLibxc.verify_record_dirty_pfn_list, }