include/xen/interface/xenpmu.h

Source file repositories/reference/linux-study-clean/include/xen/interface/xenpmu.h

File Facts

System
Linux kernel
Corpus path
include/xen/interface/xenpmu.h
Extension
.h
Size
2528 bytes
Lines
96
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

struct xen_pmu_params {
	/* IN/OUT parameters */
	struct {
		uint32_t maj;
		uint32_t min;
	} version;
	uint64_t val;

	/* IN parameters */
	uint32_t vcpu;
	uint32_t pad;
};

/* PMU modes:
 * - XENPMU_MODE_OFF:   No PMU virtualization
 * - XENPMU_MODE_SELF:  Guests can profile themselves
 * - XENPMU_MODE_HV:    Guests can profile themselves, dom0 profiles
 *                      itself and Xen
 * - XENPMU_MODE_ALL:   Only dom0 has access to VPMU and it profiles
 *                      everyone: itself, the hypervisor and the guests.
 */
#define XENPMU_MODE_OFF           0
#define XENPMU_MODE_SELF          (1<<0)
#define XENPMU_MODE_HV            (1<<1)
#define XENPMU_MODE_ALL           (1<<2)

/*
 * PMU features:
 * - XENPMU_FEATURE_INTEL_BTS: Intel BTS support (ignored on AMD)
 */
#define XENPMU_FEATURE_INTEL_BTS  1

/*
 * Shared PMU data between hypervisor and PV(H) domains.
 *
 * The hypervisor fills out this structure during PMU interrupt and sends an
 * interrupt to appropriate VCPU.
 * Architecture-independent fields of xen_pmu_data are WO for the hypervisor
 * and RO for the guest but some fields in xen_pmu_arch can be writable
 * by both the hypervisor and the guest (see arch-$arch/pmu.h).
 */
struct xen_pmu_data {
	/* Interrupted VCPU */
	uint32_t vcpu_id;

	/*
	 * Physical processor on which the interrupt occurred. On non-privileged
	 * guests set to vcpu_id;
	 */
	uint32_t pcpu_id;

	/*
	 * Domain that was interrupted. On non-privileged guests set to
	 * DOMID_SELF.
	 * On privileged guests can be DOMID_SELF, DOMID_XEN, or, when in
	 * XENPMU_MODE_ALL mode, domain ID of another domain.
	 */
	domid_t  domain_id;

	uint8_t pad[6];

	/* Architecture-specific information */
	struct xen_pmu_arch pmu;
};

#endif /* __XEN_PUBLIC_XENPMU_H__ */

Annotation

Implementation Notes