xen+tools: Introduce XEN_SYSCTL_PHYSCAP_vmtrace

We're about to introduce support for Intel Processor Trace, but similar
functionality exists in other platforms.

Aspects of vmtrace can reasonably can be common, so start with
XEN_SYSCTL_PHYSCAP_vmtrace and plumb the signal from Xen all the way down into
`xl info`.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Andrew Cooper committed 2021-01-30 03:21:33 +00:00
1 parent 6fe64b150c
commit a48066d25c
12 files changed
+26 -3

No files matched your search

+2
View File
@@ -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
}
+1
View File
@@ -1000,6 +1000,7 @@ CapHvmDirectio bool
CapHap bool
CapShadow bool
CapIommuHapPtShare bool
CapVmtrace bool
}
type Connectorinfo struct {
+7
View File
@@ -481,6 +481,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
*
+2
View File
@@ -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;
+1
View File
@@ -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", [
+1
View File
@@ -116,6 +116,7 @@ type physinfo_cap_flag =
| CAP_HAP
| CAP_Shadow
| CAP_IOMMU_HAP_PT_SHARE
| CAP_Vmtrace
type physinfo =
{
+1
View File
@@ -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;
+3 -2
View File
@@ -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);
+2
View File
@@ -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;
+2
View File
@@ -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;
+2 -1
View File
@@ -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;
+2
View File
@@ -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__ */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.