This record is specific to x86, and should have had a prefix to being with.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
0x00000007: SHARED_INFO
- 0x00000008: TSC_INFO
+ 0x00000008: X86_TSC_INFO
0x00000009: HVM_CONTEXT
\clearpage
-TSC_INFO
---------
+X86_TSC_INFO
+------------
Domain TSC information, as accessed by the
XEN_DOMCTL_{get,set}tscinfo hypercall sub-ops.
* 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
* Image header
* Domain header
* Many PAGE_DATA records
-* TSC_INFO
+* X86_TSC_INFO
* HVM_PARAMS
* HVM_CONTEXT
[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",
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);
}
#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
};
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;
}
#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
/*
{
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);
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;
int rc;
/* Write the TSC record. */
- rc = write_tsc_info(ctx);
+ rc = write_x86_tsc_info(ctx);
if ( rc )
return rc;
{
int rc;
- rc = write_tsc_info(ctx);
+ rc = write_x86_tsc_info(ctx);
if ( rc )
return rc;
#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
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;
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):
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)
# 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"
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"
(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),
):