aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/xenoprof.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-08-02 11:00:56 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-08-02 11:00:56 +0100
commit89de5a8f164045da99b5dff2e6620c5c869ffb9c (patch)
treea174e275f3487d52dbc72ab8740e1c7c154d1709 /xen/common/xenoprof.c
parentafc6c57b6d604614433d214eca24ad16bc770d08 (diff)
downloadxen-89de5a8f164045da99b5dff2e6620c5c869ffb9c.tar.gz
xen-89de5a8f164045da99b5dff2e6620c5c869ffb9c.tar.bz2
xen-89de5a8f164045da99b5dff2e6620c5c869ffb9c.zip
xenoprofile: Add IBS support
Add IBS support for AMD family 10h processors. The major implementation is derived from latest Linux. Two hypercalls are added, which is necessary for IBS feature detection and user mode parameter read. Signed-off-by: Wei Wang <wei.wang2@amd.com>
Diffstat (limited to 'xen/common/xenoprof.c')
-rw-r--r--xen/common/xenoprof.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 9390d8dc9b..ab95d92aaf 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -49,6 +49,9 @@ static u64 passive_samples;
static u64 idle_samples;
static u64 others_samples;
+/* AMD IBS support */
+extern u32 ibs_caps;
+
int acquire_pmu_ownership(int pmu_ownship)
{
spin_lock(&pmu_owner_lock);
@@ -881,6 +884,20 @@ int do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg)
ret = -EFAULT;
break;
+ case XENOPROF_ibs_counter:
+ if ( (xenoprof_state != XENOPROF_COUNTERS_RESERVED) ||
+ (adomains == 0) )
+ {
+ ret = -EPERM;
+ break;
+ }
+ ret = xenoprof_arch_ibs_counter(arg);
+ break;
+
+ case XENOPROF_get_ibs_caps:
+ ret = ibs_caps;
+ break;
+
default:
ret = -ENOSYS;
}