bus: arm-ccn: Add missing event attribute exclusions for host/guest
authorPawel Moll <pawel.moll@arm.com>
Thu, 11 Aug 2016 11:00:36 +0000 (12:00 +0100)
committerPawel Moll <pawel.moll@arm.com>
Wed, 17 Aug 2016 10:42:46 +0000 (11:42 +0100)
CCN PMUs have no knowledge into VM-related origins of the memory
traffic, therefore can't handle requests for host-only or guest-only
events.

Added appropriate exclusions (they should have been there from the
beginning). This required changing the error code returned, as the
userspace tool only re-negotiates the options (exclude_guest is true by
default) only for EINVAL.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
drivers/bus/arm-ccn.c

index ddb65c117012cab5e070abcd8f2cf36401c7fc95..02f81e308dff5a2c4818004a4d80a8d3dee750a8 100644 (file)
@@ -745,9 +745,10 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
 
        if (has_branch_stack(event) || event->attr.exclude_user ||
                        event->attr.exclude_kernel || event->attr.exclude_hv ||
-                       event->attr.exclude_idle) {
+                       event->attr.exclude_idle || event->attr.exclude_host ||
+                       event->attr.exclude_guest) {
                dev_warn(ccn->dev, "Can't exclude execution levels!\n");
-               return -EOPNOTSUPP;
+               return -EINVAL;
        }
 
        if (event->cpu < 0) {