From patchwork Fri Dec 20 17:30:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11306081 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 6FA6513A4 for ; Fri, 20 Dec 2019 17:32:05 +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 4025A206CB for ; Fri, 20 Dec 2019 17:32:05 +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="CLPTYjXF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4025A206CB 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 1iiM79-0008SE-0f; Fri, 20 Dec 2019 17:30:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iiM77-0008S7-Iq for xen-devel@lists.xenproject.org; Fri, 20 Dec 2019 17:30:57 +0000 X-Inumbo-ID: 75b007e8-234e-11ea-a914-bc764e2007e4 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 75b007e8-234e-11ea-a914-bc764e2007e4; Fri, 20 Dec 2019 17:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1576863048; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=b1QM/hrwUoBtYdRqa+o2vzHZ8dLMRzukDOG9/QYP+5w=; b=CLPTYjXF7HBipy7VejlxvO0wJnSalU6J71JTkLB4XRxnwEUU0GRsNMRy mGZYhoTv+QnLS1C5muI28BIa7RJV3XTkzvIa3tFi/SWWTsG1VsPDxj38T 5LR2jHn8rFoiKMLOkcYNrjPsI6q9/LSN1F2XgaG1TXKGYzbgNYO8KLTDO A=; Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: evg/ZR5xkshV6liSbTEcd3fotqPPlT5biMKeh32vwwgLOAHNDHzrW6chSR3ldw00NKRRb6alE3 wONw48FSYwLU1GCLRyIIw0fJPFtit+Zg7CSmzHcQVh/SEPGgiEQM1w9LtWynTGuPzPEXQR9vof fKFniHrEgy1XJAeRSdPXzVFw1D27y5PALe5ImeP+3A1l8Bbkh0nT+lMwjX1XuwxavQGRuLBeiX mYRjj3MUSNk6xvejq9XjrxG8HYrwIz9jUjZMfLgUuZOKWuHYUsLpdDDix/OwME9RPB0yUDxgHP +AM= X-SBRS: 2.7 X-MesageID: 10591013 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,336,1571716800"; d="scan'208";a="10591013" From: Andrew Cooper To: Xen-devel Date: Fri, 20 Dec 2019 17:30:44 +0000 Message-ID: <20191220173044.12714-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] libxc/migration: Rename TSC_INFO to X86_TSC_INFO 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" This record is specific to x86, and should have had a prefix to being with. No functional change. 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: Wei Liu CC: Julien Grall CC: Marek Marczykowski-Górecki --- docs/specs/libxc-migration-stream.pandoc | 10 +++++----- tools/libxc/xc_sr_common.c | 4 ++-- tools/libxc/xc_sr_common_x86.c | 12 ++++++------ tools/libxc/xc_sr_common_x86.h | 8 ++++---- tools/libxc/xc_sr_restore_x86_hvm.c | 4 ++-- tools/libxc/xc_sr_restore_x86_pv.c | 4 ++-- tools/libxc/xc_sr_save_x86_hvm.c | 2 +- tools/libxc/xc_sr_save_x86_pv.c | 2 +- tools/libxc/xc_sr_stream_format.h | 6 +++--- tools/python/scripts/convert-legacy-stream | 4 ++-- tools/python/xen/migration/libxc.py | 10 +++++----- tools/python/xen/migration/tests.py | 2 +- 12 files changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/libxc-migration-stream.pandoc index a365dba0c8..313be3e80d 100644 --- a/docs/specs/libxc-migration-stream.pandoc +++ b/docs/specs/libxc-migration-stream.pandoc @@ -215,7 +215,7 @@ type 0x00000000: END 0x00000007: SHARED_INFO - 0x00000008: TSC_INFO + 0x00000008: X86_TSC_INFO 0x00000009: HVM_CONTEXT @@ -460,8 +460,8 @@ shared_info Contents of the shared info page. This record \clearpage -TSC_INFO --------- +X86_TSC_INFO +------------ Domain TSC information, as accessed by the XEN_DOMCTL_{get,set}tscinfo hypercall sub-ops. @@ -646,7 +646,7 @@ A typical save record for an x86 PV guest image would look like: * X86_PV_INFO record * X86_PV_P2M_FRAMES record * Many PAGE_DATA records -* TSC_INFO +* X86_TSC_INFO * SHARED_INFO record * VCPU context records for each online VCPU * X86_PV_VCPU_BASIC record @@ -672,7 +672,7 @@ A typical save record for an x86 HVM guest image would look like: * Image header * Domain header * Many PAGE_DATA records -* TSC_INFO +* X86_TSC_INFO * HVM_PARAMS * HVM_CONTEXT diff --git a/tools/libxc/xc_sr_common.c b/tools/libxc/xc_sr_common.c index 6b887b3053..370d98d94a 100644 --- a/tools/libxc/xc_sr_common.c +++ b/tools/libxc/xc_sr_common.c @@ -30,7 +30,7 @@ static const char *mandatory_rec_types[] = [REC_TYPE_X86_PV_VCPU_EXTENDED] = "x86 PV vcpu extended", [REC_TYPE_X86_PV_VCPU_XSAVE] = "x86 PV vcpu xsave", [REC_TYPE_SHARED_INFO] = "Shared info", - [REC_TYPE_TSC_INFO] = "TSC info", + [REC_TYPE_X86_TSC_INFO] = "x86 TSC info", [REC_TYPE_HVM_CONTEXT] = "HVM context", [REC_TYPE_HVM_PARAMS] = "HVM params", [REC_TYPE_TOOLSTACK] = "Toolstack", @@ -151,7 +151,7 @@ static void __attribute__((unused)) build_assertions(void) BUILD_BUG_ON(sizeof(struct xc_sr_rec_x86_pv_info) != 8); BUILD_BUG_ON(sizeof(struct xc_sr_rec_x86_pv_p2m_frames) != 8); BUILD_BUG_ON(sizeof(struct xc_sr_rec_x86_pv_vcpu_hdr) != 8); - BUILD_BUG_ON(sizeof(struct xc_sr_rec_tsc_info) != 24); + BUILD_BUG_ON(sizeof(struct xc_sr_rec_x86_tsc_info) != 24); BUILD_BUG_ON(sizeof(struct xc_sr_rec_hvm_params_entry) != 16); BUILD_BUG_ON(sizeof(struct xc_sr_rec_hvm_params) != 8); } diff --git a/tools/libxc/xc_sr_common_x86.c b/tools/libxc/xc_sr_common_x86.c index 98f1cef30f..1dee840a03 100644 --- a/tools/libxc/xc_sr_common_x86.c +++ b/tools/libxc/xc_sr_common_x86.c @@ -1,12 +1,12 @@ #include "xc_sr_common_x86.h" -int write_tsc_info(struct xc_sr_context *ctx) +int write_x86_tsc_info(struct xc_sr_context *ctx) { xc_interface *xch = ctx->xch; - struct xc_sr_rec_tsc_info tsc = { 0 }; + struct xc_sr_rec_x86_tsc_info tsc = {}; struct xc_sr_record rec = { - .type = REC_TYPE_TSC_INFO, + .type = REC_TYPE_X86_TSC_INFO, .length = sizeof(tsc), .data = &tsc }; @@ -21,14 +21,14 @@ int write_tsc_info(struct xc_sr_context *ctx) return write_record(ctx, &rec); } -int handle_tsc_info(struct xc_sr_context *ctx, struct xc_sr_record *rec) +int handle_x86_tsc_info(struct xc_sr_context *ctx, struct xc_sr_record *rec) { xc_interface *xch = ctx->xch; - struct xc_sr_rec_tsc_info *tsc = rec->data; + struct xc_sr_rec_x86_tsc_info *tsc = rec->data; if ( rec->length != sizeof(*tsc) ) { - ERROR("TSC_INFO record wrong size: length %u, expected %zu", + ERROR("X86_TSC_INFO record wrong size: length %u, expected %zu", rec->length, sizeof(*tsc)); return -1; } diff --git a/tools/libxc/xc_sr_common_x86.h b/tools/libxc/xc_sr_common_x86.h index 1d42da9af2..ebc4355bd1 100644 --- a/tools/libxc/xc_sr_common_x86.h +++ b/tools/libxc/xc_sr_common_x86.h @@ -4,15 +4,15 @@ #include "xc_sr_common.h" /* - * Obtains a domains TSC information from Xen and writes a TSC_INFO record + * Obtains a domains TSC information from Xen and writes a X86_TSC_INFO record * into the stream. */ -int write_tsc_info(struct xc_sr_context *ctx); +int write_x86_tsc_info(struct xc_sr_context *ctx); /* - * Parses a TSC_INFO record and applies the result to the domain. + * Parses a X86_TSC_INFO record and applies the result to the domain. */ -int handle_tsc_info(struct xc_sr_context *ctx, struct xc_sr_record *rec); +int handle_x86_tsc_info(struct xc_sr_context *ctx, struct xc_sr_record *rec); #endif /* diff --git a/tools/libxc/xc_sr_restore_x86_hvm.c b/tools/libxc/xc_sr_restore_x86_hvm.c index 9763aaa8dc..4a24dc0137 100644 --- a/tools/libxc/xc_sr_restore_x86_hvm.c +++ b/tools/libxc/xc_sr_restore_x86_hvm.c @@ -171,8 +171,8 @@ static int x86_hvm_process_record(struct xc_sr_context *ctx, { switch ( rec->type ) { - case REC_TYPE_TSC_INFO: - return handle_tsc_info(ctx, rec); + case REC_TYPE_X86_TSC_INFO: + return handle_x86_tsc_info(ctx, rec); case REC_TYPE_HVM_CONTEXT: return handle_hvm_context(ctx, rec); diff --git a/tools/libxc/xc_sr_restore_x86_pv.c b/tools/libxc/xc_sr_restore_x86_pv.c index 70b8d2ad95..b64f79d4d5 100644 --- a/tools/libxc/xc_sr_restore_x86_pv.c +++ b/tools/libxc/xc_sr_restore_x86_pv.c @@ -1098,8 +1098,8 @@ static int x86_pv_process_record(struct xc_sr_context *ctx, case REC_TYPE_SHARED_INFO: return handle_shared_info(ctx, rec); - case REC_TYPE_TSC_INFO: - return handle_tsc_info(ctx, rec); + case REC_TYPE_X86_TSC_INFO: + return handle_x86_tsc_info(ctx, rec); default: return RECORD_NOT_PROCESSED; diff --git a/tools/libxc/xc_sr_save_x86_hvm.c b/tools/libxc/xc_sr_save_x86_hvm.c index 97a8c49807..90ff35a439 100644 --- a/tools/libxc/xc_sr_save_x86_hvm.c +++ b/tools/libxc/xc_sr_save_x86_hvm.c @@ -195,7 +195,7 @@ static int x86_hvm_end_of_checkpoint(struct xc_sr_context *ctx) int rc; /* Write the TSC record. */ - rc = write_tsc_info(ctx); + rc = write_x86_tsc_info(ctx); if ( rc ) return rc; diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c index e4b099cfd0..09b6efeee3 100644 --- a/tools/libxc/xc_sr_save_x86_pv.c +++ b/tools/libxc/xc_sr_save_x86_pv.c @@ -1104,7 +1104,7 @@ static int x86_pv_end_of_checkpoint(struct xc_sr_context *ctx) { int rc; - rc = write_tsc_info(ctx); + rc = write_x86_tsc_info(ctx); if ( rc ) return rc; diff --git a/tools/libxc/xc_sr_stream_format.h b/tools/libxc/xc_sr_stream_format.h index 15ff1c7efb..051afa7dcd 100644 --- a/tools/libxc/xc_sr_stream_format.h +++ b/tools/libxc/xc_sr_stream_format.h @@ -68,7 +68,7 @@ struct xc_sr_rhdr #define REC_TYPE_X86_PV_VCPU_EXTENDED 0x00000005U #define REC_TYPE_X86_PV_VCPU_XSAVE 0x00000006U #define REC_TYPE_SHARED_INFO 0x00000007U -#define REC_TYPE_TSC_INFO 0x00000008U +#define REC_TYPE_X86_TSC_INFO 0x00000008U #define REC_TYPE_HVM_CONTEXT 0x00000009U #define REC_TYPE_HVM_PARAMS 0x0000000aU #define REC_TYPE_TOOLSTACK 0x0000000bU @@ -114,8 +114,8 @@ struct xc_sr_rec_x86_pv_vcpu_hdr uint8_t context[0]; }; -/* TSC_INFO */ -struct xc_sr_rec_tsc_info +/* X86_TSC_INFO */ +struct xc_sr_rec_x86_tsc_info { uint32_t mode; uint32_t khz; diff --git a/tools/python/scripts/convert-legacy-stream b/tools/python/scripts/convert-legacy-stream index 6b68ef5923..a5da30b1ce 100755 --- a/tools/python/scripts/convert-legacy-stream +++ b/tools/python/scripts/convert-legacy-stream @@ -153,7 +153,7 @@ def write_page_data(pfns, pages): def write_libxc_tsc_info(mode, khz, nsec, incarn): write_record(libxc.REC_TYPE_tsc_info, - pack(libxc.TSC_INFO_FORMAT, + pack(libxc.X86_TSC_INFO_FORMAT, mode, khz, nsec, incarn, 0)) def write_libxc_hvm_params(params): @@ -435,7 +435,7 @@ def read_chunks(vm): elif marker == legacy.CHUNK_tsc_info: mode, nsec, khz, incarn = unpack_exact("=IQII") - info(" TSC_INFO: mode %s, %d ns, %d khz, %d incarn" + info(" X86_TSC_INFO: mode %s, %d ns, %d khz, %d incarn" % (mode, nsec, khz, incarn)) write_libxc_tsc_info(mode, khz, nsec, incarn) diff --git a/tools/python/xen/migration/libxc.py b/tools/python/xen/migration/libxc.py index 0a329c2090..70bcb8d15b 100644 --- a/tools/python/xen/migration/libxc.py +++ b/tools/python/xen/migration/libxc.py @@ -109,8 +109,8 @@ # x86_pv_vcpu_{basic,extended,xsave,msrs} X86_PV_VCPU_HDR_FORMAT = "II" -# tsc_info -TSC_INFO_FORMAT = "IIQII" +# x86_tsc_info +X86_TSC_INFO_FORMAT = "IIQII" # hvm_params HVM_PARAMS_ENTRY_FORMAT = "QQ" @@ -354,15 +354,15 @@ def verify_record_shared_info(self, content): def verify_record_tsc_info(self, content): """ tsc info record """ - sz = calcsize(TSC_INFO_FORMAT) + sz = calcsize(X86_TSC_INFO_FORMAT) if len(content) != sz: raise RecordError("Length should be %u bytes" % (sz, )) - mode, khz, nsec, incarn, res1 = unpack(TSC_INFO_FORMAT, content) + mode, khz, nsec, incarn, res1 = unpack(X86_TSC_INFO_FORMAT, content) if res1 != 0: - raise StreamError("Reserved bits set in TSC_INFO: 0x%08x" + raise StreamError("Reserved bits set in X86_TSC_INFO: 0x%08x" % (res1, )) self.info(" Mode %u, %u kHz, %u ns, incarnation %d" diff --git a/tools/python/xen/migration/tests.py b/tools/python/xen/migration/tests.py index 026cf38012..ff2768946b 100644 --- a/tools/python/xen/migration/tests.py +++ b/tools/python/xen/migration/tests.py @@ -23,7 +23,7 @@ def test_format_sizes(self): (libxc.X86_PV_INFO_FORMAT, 8), (libxc.X86_PV_P2M_FRAMES_FORMAT, 8), (libxc.X86_PV_VCPU_HDR_FORMAT, 8), - (libxc.TSC_INFO_FORMAT, 24), + (libxc.X86_TSC_INFO_FORMAT, 24), (libxc.HVM_PARAMS_ENTRY_FORMAT, 16), (libxc.HVM_PARAMS_FORMAT, 8), ):