@@ -3348,6 +3348,7 @@ x.CapHvmDirectio = bool(xc.cap_hvm_directio)
x.CapHap = bool(xc.cap_hap)
x.CapShadow = bool(xc.cap_shadow)
x.CapIommuHapPtShare = bool(xc.cap_iommu_hap_pt_share)
+x.CapVmtrace = bool(xc.cap_vmtrace)
return nil}
@@ -3378,6 +3379,7 @@ xc.cap_hvm_directio = C.bool(x.CapHvmDirectio)
xc.cap_hap = C.bool(x.CapHap)
xc.cap_shadow = C.bool(x.CapShadow)
xc.cap_iommu_hap_pt_share = C.bool(x.CapIommuHapPtShare)
+xc.cap_vmtrace = C.bool(x.CapVmtrace)
return nil
}
@@ -1000,6 +1000,7 @@ CapHvmDirectio bool
CapHap bool
CapShadow bool
CapIommuHapPtShare bool
+CapVmtrace bool
}
type Connectorinfo struct {
@@ -482,6 +482,13 @@
#define LIBXL_HAVE_DEVICE_PCI_NAME 1
/*
+ * LIBXL_HAVE_PHYSINFO_CAP_VMTRACE indicates that libxl_physinfo has a
+ * cap_vmtrace field, which indicates the availability of platform tracing
+ * functionality.
+ */
+#define LIBXL_HAVE_PHYSINFO_CAP_VMTRACE 1
+
+/*
* libxl ABI compatibility
*
* The only guarantee which libxl makes regarding ABI compatibility
@@ -402,6 +402,8 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
!!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_shadow);
physinfo->cap_iommu_hap_pt_share =
!!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_iommu_hap_pt_share);
+ physinfo->cap_vmtrace =
+ !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_vmtrace);
GC_FREE;
return 0;
@@ -1053,6 +1053,7 @@ libxl_physinfo = Struct("physinfo", [
("cap_hap", bool),
("cap_shadow", bool),
("cap_iommu_hap_pt_share", bool),
+ ("cap_vmtrace", bool),
], dir=DIR_OUT)
libxl_connectorinfo = Struct("connectorinfo", [
@@ -116,6 +116,7 @@ type physinfo_cap_flag =
| CAP_HAP
| CAP_Shadow
| CAP_IOMMU_HAP_PT_SHARE
+ | CAP_Vmtrace
type physinfo =
{
@@ -101,6 +101,7 @@ type physinfo_cap_flag =
| CAP_HAP
| CAP_Shadow
| CAP_IOMMU_HAP_PT_SHARE
+ | CAP_Vmtrace
type physinfo = {
threads_per_core : int;
@@ -210,14 +210,15 @@ static void output_physinfo(void)
info.hw_cap[4], info.hw_cap[5], info.hw_cap[6], info.hw_cap[7]
);
- maybe_printf("virt_caps :%s%s%s%s%s%s%s\n",
+ maybe_printf("virt_caps :%s%s%s%s%s%s%s%s\n",
info.cap_pv ? " pv" : "",
info.cap_hvm ? " hvm" : "",
info.cap_hvm && info.cap_hvm_directio ? " hvm_directio" : "",
info.cap_pv && info.cap_hvm_directio ? " pv_directio" : "",
info.cap_hap ? " hap" : "",
info.cap_shadow ? " shadow" : "",
- info.cap_iommu_hap_pt_share ? " iommu_hap_pt_share" : ""
+ info.cap_iommu_hap_pt_share ? " iommu_hap_pt_share" : "",
+ info.cap_vmtrace ? " vmtrace" : ""
);
vinfo = libxl_get_version_info(ctx);
@@ -82,6 +82,8 @@ struct vcpu *idle_vcpu[NR_CPUS] __read_mostly;
vcpu_info_t dummy_vcpu_info;
+bool __read_mostly vmtrace_available;
+
static void __domain_finalise_shutdown(struct domain *d)
{
struct vcpu *v;
@@ -277,6 +277,8 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
if ( iommu_hap_pt_share )
pi->capabilities |= XEN_SYSCTL_PHYSCAP_iommu_hap_pt_share;
}
+ if ( vmtrace_available )
+ pi->capabilities |= XEN_SYSCTL_PHYSCAP_vmtrace;
if ( copy_to_guest(u_sysctl, op, 1) )
ret = -EFAULT;
@@ -100,9 +100,10 @@ struct xen_sysctl_tbuf_op {
#define _XEN_SYSCTL_PHYSCAP_iommu_hap_pt_share 5
#define XEN_SYSCTL_PHYSCAP_iommu_hap_pt_share \
(1u << _XEN_SYSCTL_PHYSCAP_iommu_hap_pt_share)
+#define XEN_SYSCTL_PHYSCAP_vmtrace (1 << 6)
/* Max XEN_SYSCTL_PHYSCAP_* constant. Used for ABI checking. */
-#define XEN_SYSCTL_PHYSCAP_MAX XEN_SYSCTL_PHYSCAP_iommu_hap_pt_share
+#define XEN_SYSCTL_PHYSCAP_MAX XEN_SYSCTL_PHYSCAP_vmtrace
struct xen_sysctl_physinfo {
uint32_t threads_per_core;
@@ -131,4 +131,6 @@ void vnuma_destroy(struct vnuma_info *vnuma);
static inline void vnuma_destroy(struct vnuma_info *vnuma) { ASSERT(!vnuma); }
#endif
+extern bool vmtrace_available;
+
#endif /* __XEN_DOMAIN_H__ */