From nobody Mon Feb 9 19:42:26 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1580136093066171.6840824051069; Mon, 27 Jan 2020 06:41:33 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iw5ZP-0003BJ-TW; Mon, 27 Jan 2020 14:40:55 +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 1iw5ZO-0003Aw-Ly for xen-devel@lists.xenproject.org; Mon, 27 Jan 2020 14:40:54 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 040dfe5a-4113-11ea-855d-12813bfff9fa; Mon, 27 Jan 2020 14:40:51 +0000 (UTC) X-Inumbo-ID: 040dfe5a-4113-11ea-855d-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1580136052; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bXEprMdLnMAsSlQbR/hJu92Hzj+lCqsYWq7oAUAnzeg=; b=fV/VkvHcZt3J05l9voE0EN3kw+1gbjeOG59TgTfK6Md7V0CcbqgZ/xHk gfWvc4v7S65Jocrke71fmlhZUIUS1THa7D9QsHznwYgqUAH7c0ZyM6YB/ ei2CgUMrrP4c29pJL1pTNNJMw8ferHHZRnNidTsqtupqHw3/IjyS8ELsy o=; 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 (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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: 5ta3NHyMIsvbjn5n4a9nDm4JM5WjFGU22wYj+RmH4qmzd3htd9KNC6H2U4u6ZYfvTtbbwsqB2m NqO62RAdLKAFDUoctaePIhsTg01mmX+Q36eL49v0ox7LtMfV+eqMFlda4e3fm/DBDhHd/gdHlH xEUAS7+zimHtHTaSEc3zwNkGHnJx32tVu/gzlpS7Bs3YH75R51+XU15rPTeISJXOLwg+J66Uki 6FwEXWEDCbZS6h/Z4YNFxk0rhj7kdVTP/DMY2yuzsLS3Ftlh4xdZ35JJ9QnKZ0bSoW1BSBbJmJ b/0= X-SBRS: 2.7 X-MesageID: 11665355 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="11665355" From: Andrew Cooper To: Xen-devel Date: Mon, 27 Jan 2020 14:34:39 +0000 Message-ID: <20200127143444.25538-13-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200127143444.25538-1-andrew.cooper3@citrix.com> References: <20200127143444.25538-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 12/17] docs/migration: Specify X86_{CPUID, MSR}_POLICY records 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 , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Tim Deegan , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Julien Grall , Ian Jackson Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) These two records move blobs from the XEN_DOMCTL_{get,set}_cpu_policy hypercall. Signed-off-by: Andrew Cooper Acked-by: Ian Jackson --- CC: George Dunlap CC: Ian Jackson CC: Jan Beulich CC: Konrad Rzeszutek Wilk CC: Stefano Stabellini CC: Tim Deegan CC: Wei Liu CC: Julien Grall CC: Marek Marczykowski-G=C3=B3recki --- docs/specs/libxc-migration-stream.pandoc | 42 ++++++++++++++++++++++++++++= +++ tools/libxc/xc_sr_common.c | 2 ++ tools/libxc/xc_sr_stream_format.h | 2 ++ tools/python/xen/migration/libxc.py | 43 ++++++++++++++++++++++++++++= ++++ 4 files changed, 89 insertions(+) diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/libxc-mi= gration-stream.pandoc index 22ff306e0b..3a0915b795 100644 --- a/docs/specs/libxc-migration-stream.pandoc +++ b/docs/specs/libxc-migration-stream.pandoc @@ -634,6 +634,46 @@ The end record contains no fields; its body_length is = 0. =20 \clearpage =20 +X86_CPUID_POLICY +---------------- + +CPUID policy content, as accessed by the XEN_DOMCTL_{get,set}_cpu_policy +hypercall sub-ops. + + 0 1 2 3 4 5 6 7 octet + +-------------------------------------------------+ + | CPUID_policy | + ... + +-------------------------------------------------+ + +-------------------------------------------------------------------- +Field Description +------------ --------------------------------------------------- +CPUID_policy Array of xen_cpuid_leaf_t[]'s +-------------------------------------------------------------------- + +\clearpage + +X86_MSR_POLICY +-------------- + +MSR policy content, as accessed by the XEN_DOMCTL_{get,set}_cpu_policy +hypercall sub-ops. + + 0 1 2 3 4 5 6 7 octet + +-------------------------------------------------+ + | MSR_policy | + ... + +-------------------------------------------------+ + +-------------------------------------------------------------------- +Field Description +---------- --------------------------------------------------- +MSR_policy Array of xen_msr_entry_t[]'s +-------------------------------------------------------------------- + +\clearpage + =20 Layout =3D=3D=3D=3D=3D=3D @@ -656,6 +696,7 @@ A typical save record for an x86 PV guest image would l= ook like: * Domain header * Static data records: * X86_PV_INFO record + * X86_{CPUID,MSR}_POLICY * STATIC_DATA_END * X86_PV_P2M_FRAMES record * Many PAGE_DATA records @@ -685,6 +726,7 @@ A typical save record for an x86 HVM guest image would = look like: * Image header * Domain header * Static data records: + * X86_{CPUID,MSR}_POLICY * STATIC_DATA_END * Many PAGE_DATA records * X86_TSC_INFO diff --git a/tools/libxc/xc_sr_common.c b/tools/libxc/xc_sr_common.c index 7f22cf0365..7c54b03414 100644 --- a/tools/libxc/xc_sr_common.c +++ b/tools/libxc/xc_sr_common.c @@ -37,6 +37,8 @@ static const char *const mandatory_rec_types[] =3D [REC_TYPE_CHECKPOINT] =3D "Checkpoint", [REC_TYPE_CHECKPOINT_DIRTY_PFN_LIST] =3D "Checkpoint dirty pfn list= ", [REC_TYPE_STATIC_DATA_END] =3D "Static data end", + [REC_TYPE_X86_CPUID_POLICY] =3D "x86 CPUID policy", + [REC_TYPE_X86_MSR_POLICY] =3D "x86 MSR policy", }; =20 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_f= ormat.h index 81c9765b0a..8a0da26f75 100644 --- a/tools/libxc/xc_sr_stream_format.h +++ b/tools/libxc/xc_sr_stream_format.h @@ -74,6 +74,8 @@ struct xc_sr_rhdr #define REC_TYPE_CHECKPOINT 0x0000000eU #define REC_TYPE_CHECKPOINT_DIRTY_PFN_LIST 0x0000000fU #define REC_TYPE_STATIC_DATA_END 0x00000010U +#define REC_TYPE_X86_CPUID_POLICY 0x00000011U +#define REC_TYPE_X86_MSR_POLICY 0x00000012U =20 #define REC_TYPE_OPTIONAL 0x80000000U =20 diff --git a/tools/python/xen/migration/libxc.py b/tools/python/xen/migrati= on/libxc.py index 5fb51b56ac..9881f5ced4 100644 --- a/tools/python/xen/migration/libxc.py +++ b/tools/python/xen/migration/libxc.py @@ -57,6 +57,8 @@ REC_TYPE_checkpoint =3D 0x0000000e REC_TYPE_checkpoint_dirty_pfn_list =3D 0x0000000f REC_TYPE_static_data_end =3D 0x00000010 +REC_TYPE_x86_cpuid_policy =3D 0x00000011 +REC_TYPE_x86_msr_policy =3D 0x00000012 =20 rec_type_to_str =3D { REC_TYPE_end : "End", @@ -76,6 +78,8 @@ REC_TYPE_checkpoint : "Checkpoint", REC_TYPE_checkpoint_dirty_pfn_list : "Checkpoint dirty pfn list", REC_TYPE_static_data_end : "Static data end", + REC_TYPE_x86_cpuid_policy : "x86 CPUID policy", + REC_TYPE_x86_msr_policy : "x86 MSR policy", } =20 # page_data @@ -113,6 +117,12 @@ HVM_PARAMS_ENTRY_FORMAT =3D "QQ" HVM_PARAMS_FORMAT =3D "II" =20 +# x86_cpuid_policy =3D> xen_cpuid_leaf_t[] +X86_CPUID_POLICY_FORMAT =3D "IIIIII" + +# x86_msr_policy =3D> xen_msr_entry_t[] +X86_MSR_POLICY_FORMAT =3D "QII" + class VerifyLibxc(VerifyBase): """ Verify a Libxc v2 (or later) stream """ =20 @@ -439,6 +449,34 @@ def verify_record_static_data_end(self, content): raise RecordError("Static data end record found in v2 stream") =20 =20 + def verify_record_x86_cpuid_policy(self, content): + """ x86 CPUID policy record """ + + if self.version < 3: + raise RecordError("x86 CPUID policy record found in v2 stream") + + sz =3D calcsize(X86_CPUID_POLICY_FORMAT) + contentsz =3D len(content) + + if contentsz < sz or (contentsz % sz) !=3D 0: + raise RecordError("Record length %u, expected multiple of %u" % + (contentsz, sz)) + + + def verify_record_x86_msr_policy(self, content): + """ x86 MSR policy record """ + + if self.version < 3: + raise RecordError("x86 MSR policy record found in v2 stream") + + sz =3D calcsize(X86_MSR_POLICY_FORMAT) + contentsz =3D len(content) + + if contentsz < sz or (contentsz % sz) !=3D 0: + raise RecordError("Record length %u, expected multiple of %u" % + (contentsz, sz)) + + record_verifiers =3D { REC_TYPE_end: VerifyLibxc.verify_record_end, @@ -483,4 +521,9 @@ def verify_record_static_data_end(self, content): =20 REC_TYPE_static_data_end: VerifyLibxc.verify_record_static_data_end, + + REC_TYPE_x86_cpuid_policy: + VerifyLibxc.verify_record_x86_cpuid_policy, + REC_TYPE_x86_msr_policy: + VerifyLibxc.verify_record_x86_msr_policy, } --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel