From patchwork Tue Dec 24 15:19:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11309511 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7462213A4 for ; Tue, 24 Dec 2019 15:20:46 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4326E2071A for ; Tue, 24 Dec 2019 15:20:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="U6VLFYXN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4326E2071A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ijlyE-0000CQ-Ti; Tue, 24 Dec 2019 15:19:38 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ijlyE-0000CL-5l for xen-devel@lists.xenproject.org; Tue, 24 Dec 2019 15:19:38 +0000 X-Inumbo-ID: cbed502f-2660-11ea-97e5-12813bfff9fa Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id cbed502f-2660-11ea-97e5-12813bfff9fa; Tue, 24 Dec 2019 15:19:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1577200777; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fPpMSPzxyVkKbCFSG1R5MyiMP9tqAycTXJrpvGvGSlI=; b=U6VLFYXNuXNtl7Jhaf8NOSy5/RlNFjqEDpwM+Zgi+xm+hIiCLZMLGbwf OGGPGzZMCFhXOQz+CrnCglbWj+3HXssKa184ZXnrnffKRSdssnfpDWHLu KzcL/I1BnYlkatjOsB6RaBKu32cDnVXYUzSGX9r4MLPZ/rOa2LMIquuUv 0=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: OOslYa7pxoydrUt/Q4YtFqhJaRggNJ6FNmOzZrUdl1l1wPm6GIy24TQ9FVVza4eMvFvvu+CAUT v3O4Fo24QPgps+mMUtcX6FlcaILyWG1MLosA2cs++5kt/QIaW6AnW+tAB+VNXn0KVCXrnZRojO qeeNalRPxkMdnvt4v4iFyXDs1iOm3rCqGFTAIawGYjzM19bAh5ef14yyKg2LP2dfh9hmujAiYE h3RZAPaYuv0DYnbq8vQpDvIIdcObyBiRBToD2WhiI3xM9KWbqF+MfvWjvUXHggwZsyMTvRFSt2 1zs= X-SBRS: 2.7 X-MesageID: 10482744 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,351,1571716800"; d="scan'208";a="10482744" From: Andrew Cooper To: Xen-devel Date: Tue, 24 Dec 2019 15:19:20 +0000 Message-ID: <20191224151932.6304-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 00/12] Support CPUID/MSR data in migration streams X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=C3=B3recki?= , Jan Beulich , Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" As an early christmas present, here is the pumbing work to include CPUID/MSR data in migration streams. For bisectability reasons, this is a large amount of plumbing with no overall change in behaviour. Switching to use the CPUID/MSR data in the stream is going to require some careful coordinated changes with libxl, which I haven't quite managed to get working yet. However, this subset of the work is now in a position to review. The first 6 patches are various bits of cleanup. Patches 7-9 introduce Migration v3 and the STATIC_DATA_END record. Patches 10-12 introduce the X86_{CPUID,MSR}_POLICY records. ~Andrew Andrew Cooper (12): libxc/save: Shrink code volume where possible libxc/restore: Introduce functionality to simplify blob handling libxc/migration: Rationalise the 'checkpointed' field to 'stream_type' libxc/migration: Adjust layout of struct xc_sr_context tools/migration: Drop IHDR_VERSION constant from libxc and python docs/migration Specify migration v3 and STATIC_DATA_END python/migration: Update validation logic to understand a v3 stream libxc/restore: Support v3 streams, and cope with v2 compatibilty libxc/save: Write a v3 stream docs/migration: Specify X86_{CPUID,MSR}_POLICY records libxc/restore: Handle X86_{CPUID,MSR}_DATA records libxc/save: Write X86_{CPUID,MSR}_DATA records docs/specs/libxc-migration-stream.pandoc | 81 +++++++- tools/libxc/include/xenguest.h | 15 +- tools/libxc/xc_nomigrate.c | 4 +- tools/libxc/xc_sr_common.c | 3 + tools/libxc/xc_sr_common.h | 205 ++++++++++++------- tools/libxc/xc_sr_common_x86.c | 97 +++++++++ tools/libxc/xc_sr_common_x86.h | 25 +++ tools/libxc/xc_sr_common_x86_pv.c | 50 ++--- tools/libxc/xc_sr_common_x86_pv.h | 4 +- tools/libxc/xc_sr_restore.c | 82 ++++++-- tools/libxc/xc_sr_restore_x86_hvm.c | 35 ++-- tools/libxc/xc_sr_restore_x86_pv.c | 316 +++++++++++++++-------------- tools/libxc/xc_sr_save.c | 65 +++--- tools/libxc/xc_sr_save_x86_hvm.c | 31 +-- tools/libxc/xc_sr_save_x86_pv.c | 225 +++++++++----------- tools/libxc/xc_sr_stream_format.h | 4 +- tools/libxl/libxl_save_helper.c | 4 +- tools/python/scripts/convert-legacy-stream | 13 +- tools/python/scripts/verify-stream-v2 | 2 +- tools/python/xen/migration/libxc.py | 74 ++++++- 20 files changed, 854 insertions(+), 481 deletions(-)