summaryrefslogtreecommitdiff
path: root/xen/include
diff options
context:
space:
mode:
authorMichal Orzel <michal.orzel@arm.com>2021-10-13 14:33:52 +0200
committerIan Jackson <iwj@xenproject.org>2021-10-13 15:10:38 +0100
commitdbb948110a0e23a8081882a980038e9c0f6aab88 (patch)
treec168641cd3f8298e0fdf2202e42301cba1adca3a /xen/include
parentc8c6cd9eee9aa98c696607adb9d1e422da161110 (diff)
xen: Expose the PMU to the guests
Add parameter vpmu to xl domain configuration syntax to enable the access to PMU registers by disabling the PMU traps(currently only for ARM). The current status is that the PMU registers are not virtualized and the physical registers are directly accessible when this parameter is enabled. There is no interrupt support and Xen will not save/restore the register values on context switches. According to Arm Arm, section D7.1: "The Performance Monitors Extension is common to AArch64 operation and AArch32 operation." That means we have an ensurance that if PMU is present in one exception state, it must also be present in the other. Please note that this feature is experimental. Signed-off-by: Michal Orzel <michal.orzel@arm.com> Signed-off-by: Julien Grall <julien@xen.org> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Jackson <iwj@xenproject.org>
Diffstat (limited to 'xen/include')
-rw-r--r--xen/include/asm-arm/domain.h1
-rw-r--r--xen/include/public/domctl.h4
2 files changed, 4 insertions, 1 deletions
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index c9277b5c6d..14e575288f 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -166,6 +166,7 @@ struct arch_vcpu
/* HYP configuration */
register_t hcr_el2;
+ register_t mdcr_el2;
uint32_t teecr, teehbr; /* ThumbEE, 32-bit guests only */
#ifdef CONFIG_ARM_32
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 4cb3f662c2..a53cbd16f4 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -71,9 +71,11 @@ struct xen_domctl_createdomain {
#define _XEN_DOMCTL_CDF_nested_virt 6
#define XEN_DOMCTL_CDF_nested_virt (1U << _XEN_DOMCTL_CDF_nested_virt)
#define XEN_DOMCTL_CDF_vpci (1U << 7)
+/* Should we expose the vPMU to the guest? */
+#define XEN_DOMCTL_CDF_vpmu (1U << 8)
/* Max XEN_DOMCTL_CDF_* constant. Used for ABI checking. */
-#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_vpci
+#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_vpmu
uint32_t flags;