From patchwork Mon Jan 27 14:34:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11352745 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 69FCF924 for ; Mon, 27 Jan 2020 14:35: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 463FE2064C for ; Mon, 27 Jan 2020 14:35: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="TtjONi3o" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 463FE2064C 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 1iw5TX-0001Sk-5e; Mon, 27 Jan 2020 14:34:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iw5TW-0001Se-Ht for xen-devel@lists.xenproject.org; Mon, 27 Jan 2020 14:34:50 +0000 X-Inumbo-ID: 2c144978-4112-11ea-9fd7-bc764e2007e4 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2c144978-4112-11ea-9fd7-bc764e2007e4; Mon, 27 Jan 2020 14:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1580135690; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=j3yGfAOUhZPugNbrny2xka/4HNVhlA2LDTQGd82Szh0=; b=TtjONi3o/JItkt4BG/MkTiyOO2xonmLkQY44lK/HWz8vLZaEe7Uj4RUl M9o5hCEofRfj+oK5XEW63bLiabGvEx98XJX1nvZZ9Rwbe8aOCHJSErKmG zFaUhTzHU6196Eep6eloyCDA0bOGg0nV3z2086bQsBYp0szUK6uFxaD9m 8=; Authentication-Results: esa1.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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.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=esa1.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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Q87zzMkvxa2qc9hV/hbIkh1smzrKxHFPwcbd7Pi8LdOAUvtnJ/N1h81/aOpB4n3alDCn2nxAOt E93LawGMm4NRvxJRY8oVYGUgrlg9rcu2JV9DuQFEflKySiHDe3IIrg7BVKZNq8P70Ifitn7Ghd bUveLkBbXE2Bvn/kXYi1UZTgd6MO6pcpn8PNvkrFzKl/uqe3/GxWA/jKU1rn0iJrOF0pYeLbC/ G5x/s89jei55P3eM7H58mPP4djYnSE304U6sGE5gZcE+/nCPsDlF1uygEYtbwbr906qIU722uf 7qw= X-SBRS: 2.7 X-MesageID: 11664967 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,370,1574139600"; d="scan'208";a="11664967" From: Andrew Cooper To: Xen-devel Date: Mon, 27 Jan 2020 14:34:27 +0000 Message-ID: <20200127143444.25538-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 00/17] 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?= , Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Here is v2 of the work to plumb CPUID/MSR data into the migration stream. Patches 1 and 2 are cleanup. 3-8 are concerned with introducing the STATIC_DATA_END record. 9-11 are some libxl work to reposition CPUID construction during domain create. 12-14 are the introduction of the X86_{CPUID,MSR}_DATA records, and 15-17 are the final adjustments in libxc and libxl to use them. This series does have a net change in behaviour for CPUID handing in migrated domains. See patch 16 for details. Some acks are carried forwards from the v1 review. Others are not. The majority change has been to shuffle the order of actions to hopefully make the logic much more clear to follow. ~Andrew Andrew Cooper (17): tools/libxl: Remove libxl_cpuid_{set,apply_policy}() from the API tools/libxl: Simplify callback handling in libxl-save-helper 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 handle STATIC_DATA_END libxc/restore: STATIC_DATA_END inference for v2 compatibility libxc/save: Write a v3 stream tools/libxl: Provide a static_data_done callback for domain restore tools/libxl: Plumb a restore boolean down into libxl__build_pre() tools/libxl: Re-position CPUID handling during domain construction docs/migration: Specify X86_{CPUID,MSR}_POLICY records libxc/restore: Handle X86_{CPUID,MSR}_DATA records libxc/save: Write X86_{CPUID,MSR}_DATA records tools/libx[cl]: Plumb 'missing' through static_data_done() up into libxl tools/libxc: Restore CPUID/MSR data found in the migration stream docs/xl.cfg: Rewrite cpuid= section docs/man/xl.cfg.5.pod.in | 74 +++++++++++++----- docs/specs/libxc-migration-stream.pandoc | 81 ++++++++++++++++++- tools/libxc/include/xenguest.h | 11 +++ tools/libxc/xc_cpuid_x86.c | 8 +- tools/libxc/xc_sr_common.c | 3 + tools/libxc/xc_sr_common.h | 35 ++++++++- tools/libxc/xc_sr_common_x86.c | 120 +++++++++++++++++++++++++++++ tools/libxc/xc_sr_common_x86.h | 25 ++++++ tools/libxc/xc_sr_restore.c | 61 ++++++++++++++- tools/libxc/xc_sr_restore_x86_hvm.c | 10 +++ tools/libxc/xc_sr_restore_x86_pv.c | 27 +++++++ tools/libxc/xc_sr_save.c | 20 ++++- tools/libxc/xc_sr_save_x86_hvm.c | 6 ++ tools/libxc/xc_sr_save_x86_pv.c | 14 +++- tools/libxc/xc_sr_stream_format.h | 4 +- tools/libxl/libxl.h | 26 ++++++- tools/libxl/libxl_cpuid.c | 6 +- tools/libxl/libxl_create.c | 37 ++++++++- tools/libxl/libxl_dm.c | 2 +- tools/libxl/libxl_dom.c | 20 +++-- tools/libxl/libxl_internal.h | 10 ++- tools/libxl/libxl_nocpuid.c | 6 +- tools/libxl/libxl_save_helper.c | 16 ++-- tools/libxl/libxl_save_msgs_gen.pl | 3 +- tools/python/scripts/convert-legacy-stream | 13 +++- tools/python/scripts/verify-stream-v2 | 2 +- tools/python/xen/migration/libxc.py | 74 ++++++++++++++++-- 27 files changed, 635 insertions(+), 79 deletions(-)