|
@@ -209,6 +209,15 @@ static int perf_ibs_precise_event(struct perf_event *event, u64 *config)
|
|
|
return -EOPNOTSUPP;
|
|
|
}
|
|
|
|
|
|
+static const struct perf_event_attr ibs_notsupp = {
|
|
|
+ .exclude_user = 1,
|
|
|
+ .exclude_kernel = 1,
|
|
|
+ .exclude_hv = 1,
|
|
|
+ .exclude_idle = 1,
|
|
|
+ .exclude_host = 1,
|
|
|
+ .exclude_guest = 1,
|
|
|
+};
|
|
|
+
|
|
|
static int perf_ibs_init(struct perf_event *event)
|
|
|
{
|
|
|
struct hw_perf_event *hwc = &event->hw;
|
|
@@ -229,6 +238,9 @@ static int perf_ibs_init(struct perf_event *event)
|
|
|
if (event->pmu != &perf_ibs->pmu)
|
|
|
return -ENOENT;
|
|
|
|
|
|
+ if (perf_flags(&event->attr) & perf_flags(&ibs_notsupp))
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
if (config & ~perf_ibs->config_mask)
|
|
|
return -EINVAL;
|
|
|
|