Re: [PATCH 2/6] drivers: perf: hisi: Add support for HiSilicon SoC uncore PMU driver

2017-06-27 Thread Zhangshaokun
Hi,

On 2017/6/28 9:49, kbuild test robot wrote:
> Hi Shaokun,
> 
> [auto build test ERROR on next-20170619]
> [also build test ERROR on v4.12-rc7]
> [cannot apply to linus/master linux/master arm64/for-next/core v4.12-rc6 
> v4.12-rc5 v4.12-rc4]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Shaokun-Zhang/Add-HiSilicon-SoC-uncore-Performance-Monitoring-Unit-driver/20170628-070841
> config: x86_64-allmodconfig (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
>drivers/perf/hisilicon/hisi_uncore_pmu.c: In function 
> 'hisi_read_scl_and_ccl_id':
>>> drivers/perf/hisilicon/hisi_uncore_pmu.c:72:10: error: implicit declaration 
>>> of function 'read_cpuid_mpidr' [-Werror=implicit-function-declaration]
>  mpidr = read_cpuid_mpidr();
>  ^~~~
>>> drivers/perf/hisilicon/hisi_uncore_pmu.c:73:14: error: 'MPIDR_MT_BITMASK' 
>>> undeclared (first use in this function)
>  if (mpidr & MPIDR_MT_BITMASK) {
>  ^~~~
>drivers/perf/hisilicon/hisi_uncore_pmu.c:73:14: note: each undeclared 
> identifier is reported only once for each function it appears in
>>> drivers/perf/hisilicon/hisi_uncore_pmu.c:75:14: error: implicit declaration 
>>> of function 'MPIDR_AFFINITY_LEVEL' [-Werror=implicit-function-declaration]
>*scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 3);
>  ^~~~
>cc1: some warnings being treated as errors
> 

Apologies for my modified drivers/perf/Kconfig for HISI_PMU.
It depends on ARM64 and i shall remove COMPILE_TEST to fix it.

Thanks.
Shaokun

> vim +/read_cpuid_mpidr +72 drivers/perf/hisilicon/hisi_uncore_pmu.c
> 
> 66
> 67/* Read Super CPU cluster and CPU cluster ID from MPIDR_EL1 */
> 68void hisi_read_scl_and_ccl_id(u32 *scl_id, u32 *ccl_id)
> 69{
> 70u64 mpidr;
> 71
>   > 72mpidr = read_cpuid_mpidr();
>   > 73if (mpidr & MPIDR_MT_BITMASK) {
> 74if (scl_id)
>   > 75*scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 
> 3);
> 76if (ccl_id)
> 77*ccl_id = MPIDR_AFFINITY_LEVEL(mpidr, 
> 2);
> 78} else {
> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation
> 
> 
> 
> ___
> linuxarm mailing list
> linux...@huawei.com
> http://rnd-openeuler.huawei.com/mailman/listinfo/linuxarm
> 



Re: [PATCH 2/6] drivers: perf: hisi: Add support for HiSilicon SoC uncore PMU driver

2017-06-27 Thread Zhangshaokun
Hi,

On 2017/6/28 9:49, kbuild test robot wrote:
> Hi Shaokun,
> 
> [auto build test ERROR on next-20170619]
> [also build test ERROR on v4.12-rc7]
> [cannot apply to linus/master linux/master arm64/for-next/core v4.12-rc6 
> v4.12-rc5 v4.12-rc4]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Shaokun-Zhang/Add-HiSilicon-SoC-uncore-Performance-Monitoring-Unit-driver/20170628-070841
> config: x86_64-allmodconfig (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
>drivers/perf/hisilicon/hisi_uncore_pmu.c: In function 
> 'hisi_read_scl_and_ccl_id':
>>> drivers/perf/hisilicon/hisi_uncore_pmu.c:72:10: error: implicit declaration 
>>> of function 'read_cpuid_mpidr' [-Werror=implicit-function-declaration]
>  mpidr = read_cpuid_mpidr();
>  ^~~~
>>> drivers/perf/hisilicon/hisi_uncore_pmu.c:73:14: error: 'MPIDR_MT_BITMASK' 
>>> undeclared (first use in this function)
>  if (mpidr & MPIDR_MT_BITMASK) {
>  ^~~~
>drivers/perf/hisilicon/hisi_uncore_pmu.c:73:14: note: each undeclared 
> identifier is reported only once for each function it appears in
>>> drivers/perf/hisilicon/hisi_uncore_pmu.c:75:14: error: implicit declaration 
>>> of function 'MPIDR_AFFINITY_LEVEL' [-Werror=implicit-function-declaration]
>*scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 3);
>  ^~~~
>cc1: some warnings being treated as errors
> 

Apologies for my modified drivers/perf/Kconfig for HISI_PMU.
It depends on ARM64 and i shall remove COMPILE_TEST to fix it.

Thanks.
Shaokun

> vim +/read_cpuid_mpidr +72 drivers/perf/hisilicon/hisi_uncore_pmu.c
> 
> 66
> 67/* Read Super CPU cluster and CPU cluster ID from MPIDR_EL1 */
> 68void hisi_read_scl_and_ccl_id(u32 *scl_id, u32 *ccl_id)
> 69{
> 70u64 mpidr;
> 71
>   > 72mpidr = read_cpuid_mpidr();
>   > 73if (mpidr & MPIDR_MT_BITMASK) {
> 74if (scl_id)
>   > 75*scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 
> 3);
> 76if (ccl_id)
> 77*ccl_id = MPIDR_AFFINITY_LEVEL(mpidr, 
> 2);
> 78} else {
> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation
> 
> 
> 
> ___
> linuxarm mailing list
> linux...@huawei.com
> http://rnd-openeuler.huawei.com/mailman/listinfo/linuxarm
> 



Re: [PATCH 2/6] drivers: perf: hisi: Add support for HiSilicon SoC uncore PMU driver

2017-06-27 Thread kbuild test robot
Hi Shaokun,

[auto build test ERROR on next-20170619]
[also build test ERROR on v4.12-rc7]
[cannot apply to linus/master linux/master arm64/for-next/core v4.12-rc6 
v4.12-rc5 v4.12-rc4]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Shaokun-Zhang/Add-HiSilicon-SoC-uncore-Performance-Monitoring-Unit-driver/20170628-070841
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/perf/hisilicon/hisi_uncore_pmu.c: In function 
'hisi_read_scl_and_ccl_id':
>> drivers/perf/hisilicon/hisi_uncore_pmu.c:72:10: error: implicit declaration 
>> of function 'read_cpuid_mpidr' [-Werror=implicit-function-declaration]
 mpidr = read_cpuid_mpidr();
 ^~~~
>> drivers/perf/hisilicon/hisi_uncore_pmu.c:73:14: error: 'MPIDR_MT_BITMASK' 
>> undeclared (first use in this function)
 if (mpidr & MPIDR_MT_BITMASK) {
 ^~~~
   drivers/perf/hisilicon/hisi_uncore_pmu.c:73:14: note: each undeclared 
identifier is reported only once for each function it appears in
>> drivers/perf/hisilicon/hisi_uncore_pmu.c:75:14: error: implicit declaration 
>> of function 'MPIDR_AFFINITY_LEVEL' [-Werror=implicit-function-declaration]
   *scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 3);
 ^~~~
   cc1: some warnings being treated as errors

vim +/read_cpuid_mpidr +72 drivers/perf/hisilicon/hisi_uncore_pmu.c

66  
67  /* Read Super CPU cluster and CPU cluster ID from MPIDR_EL1 */
68  void hisi_read_scl_and_ccl_id(u32 *scl_id, u32 *ccl_id)
69  {
70  u64 mpidr;
71  
  > 72  mpidr = read_cpuid_mpidr();
  > 73  if (mpidr & MPIDR_MT_BITMASK) {
74  if (scl_id)
  > 75  *scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 3);
76  if (ccl_id)
77  *ccl_id = MPIDR_AFFINITY_LEVEL(mpidr, 2);
78  } else {

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [PATCH 2/6] drivers: perf: hisi: Add support for HiSilicon SoC uncore PMU driver

2017-06-27 Thread kbuild test robot
Hi Shaokun,

[auto build test ERROR on next-20170619]
[also build test ERROR on v4.12-rc7]
[cannot apply to linus/master linux/master arm64/for-next/core v4.12-rc6 
v4.12-rc5 v4.12-rc4]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Shaokun-Zhang/Add-HiSilicon-SoC-uncore-Performance-Monitoring-Unit-driver/20170628-070841
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/perf/hisilicon/hisi_uncore_pmu.c: In function 
'hisi_read_scl_and_ccl_id':
>> drivers/perf/hisilicon/hisi_uncore_pmu.c:72:10: error: implicit declaration 
>> of function 'read_cpuid_mpidr' [-Werror=implicit-function-declaration]
 mpidr = read_cpuid_mpidr();
 ^~~~
>> drivers/perf/hisilicon/hisi_uncore_pmu.c:73:14: error: 'MPIDR_MT_BITMASK' 
>> undeclared (first use in this function)
 if (mpidr & MPIDR_MT_BITMASK) {
 ^~~~
   drivers/perf/hisilicon/hisi_uncore_pmu.c:73:14: note: each undeclared 
identifier is reported only once for each function it appears in
>> drivers/perf/hisilicon/hisi_uncore_pmu.c:75:14: error: implicit declaration 
>> of function 'MPIDR_AFFINITY_LEVEL' [-Werror=implicit-function-declaration]
   *scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 3);
 ^~~~
   cc1: some warnings being treated as errors

vim +/read_cpuid_mpidr +72 drivers/perf/hisilicon/hisi_uncore_pmu.c

66  
67  /* Read Super CPU cluster and CPU cluster ID from MPIDR_EL1 */
68  void hisi_read_scl_and_ccl_id(u32 *scl_id, u32 *ccl_id)
69  {
70  u64 mpidr;
71  
  > 72  mpidr = read_cpuid_mpidr();
  > 73  if (mpidr & MPIDR_MT_BITMASK) {
74  if (scl_id)
  > 75  *scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 3);
76  if (ccl_id)
77  *ccl_id = MPIDR_AFFINITY_LEVEL(mpidr, 2);
78  } else {

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[PATCH 2/6] drivers: perf: hisi: Add support for HiSilicon SoC uncore PMU driver

2017-06-27 Thread Shaokun Zhang
This patch adds support HiSilicon SoC uncore PMU driver framework and
interfaces.

Signed-off-by: Shaokun Zhang 
Signed-off-by: Anurup M 
---
 drivers/perf/Kconfig |   7 +
 drivers/perf/Makefile|   1 +
 drivers/perf/hisilicon/Makefile  |   1 +
 drivers/perf/hisilicon/hisi_uncore_pmu.c | 416 +++
 drivers/perf/hisilicon/hisi_uncore_pmu.h | 116 +
 5 files changed, 541 insertions(+)
 create mode 100644 drivers/perf/hisilicon/Makefile
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_pmu.c
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_pmu.h

diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig
index e5197ff..14b7b9d 100644
--- a/drivers/perf/Kconfig
+++ b/drivers/perf/Kconfig
@@ -17,6 +17,13 @@ config ARM_PMU_ACPI
depends on ARM_PMU && ACPI
def_bool y
 
+config HISI_PMU
+   bool "HiSilicon SoC PMU"
+   depends on ACPI && (ARM64 || COMPILE_TEST)
+   help
+ Support for HiSilicon SoC uncore performance monitoring
+ unit (PMU), such as: L3C, HHA and DDRC.
+
 config QCOM_L2_PMU
bool "Qualcomm Technologies L2-cache PMU"
depends on ARCH_QCOM && ARM64 && ACPI
diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile
index 6420bd4..41d3342 100644
--- a/drivers/perf/Makefile
+++ b/drivers/perf/Makefile
@@ -1,5 +1,6 @@
 obj-$(CONFIG_ARM_PMU) += arm_pmu.o arm_pmu_platform.o
 obj-$(CONFIG_ARM_PMU_ACPI) += arm_pmu_acpi.o
+obj-$(CONFIG_HISI_PMU) += hisilicon/
 obj-$(CONFIG_QCOM_L2_PMU)  += qcom_l2_pmu.o
 obj-$(CONFIG_QCOM_L3_PMU) += qcom_l3_pmu.o
 obj-$(CONFIG_XGENE_PMU) += xgene_pmu.o
diff --git a/drivers/perf/hisilicon/Makefile b/drivers/perf/hisilicon/Makefile
new file mode 100644
index 000..2783bb3
--- /dev/null
+++ b/drivers/perf/hisilicon/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_HISI_PMU) += hisi_uncore_pmu.o
diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c 
b/drivers/perf/hisilicon/hisi_uncore_pmu.c
new file mode 100644
index 000..3a21c9e
--- /dev/null
+++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c
@@ -0,0 +1,416 @@
+/*
+ * HiSilicon SoC Hardware event counters support
+ *
+ * Copyright (C) 2017 Hisilicon Limited
+ * Author: Anurup M 
+ * Shaokun Zhang 
+ *
+ * This code is based on the uncore PMUs like arm-cci and arm-ccn.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see .
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "hisi_uncore_pmu.h"
+
+/*
+ * PMU format attributes
+ */
+ssize_t hisi_format_sysfs_show(struct device *dev,
+  struct device_attribute *attr, char *buf)
+{
+   struct dev_ext_attribute *eattr;
+
+   eattr = container_of(attr, struct dev_ext_attribute, attr);
+
+   return sprintf(buf, "%s\n", (char *)eattr->var);
+}
+
+/*
+ * PMU event attributes
+ */
+ssize_t hisi_event_sysfs_show(struct device *dev,
+ struct device_attribute *attr, char *page)
+{
+   struct dev_ext_attribute *eattr;
+
+   eattr = container_of(attr, struct dev_ext_attribute, attr);
+
+   return sprintf(page, "config=0x%lx\n", (unsigned long)eattr->var);
+}
+
+/*
+ * sysfs cpumask attributes
+ */
+ssize_t hisi_cpumask_sysfs_show(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   struct pmu *pmu = dev_get_drvdata(dev);
+   struct hisi_pmu *hisi_pmu = to_hisi_pmu(pmu);
+
+   return cpumap_print_to_pagebuf(true, buf, _pmu->cpus);
+}
+
+/* Read Super CPU cluster and CPU cluster ID from MPIDR_EL1 */
+void hisi_read_scl_and_ccl_id(u32 *scl_id, u32 *ccl_id)
+{
+   u64 mpidr;
+
+   mpidr = read_cpuid_mpidr();
+   if (mpidr & MPIDR_MT_BITMASK) {
+   if (scl_id)
+   *scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 3);
+   if (ccl_id)
+   *ccl_id = MPIDR_AFFINITY_LEVEL(mpidr, 2);
+   } else {
+   if (scl_id)
+   *scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 2);
+   if (ccl_id)
+   *ccl_id = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+   }
+}
+
+static bool hisi_validate_event_group(struct perf_event *event)
+{
+   struct perf_event *sibling, *leader = event->group_leader;
+   struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu);
+   /* Include 

[PATCH 2/6] drivers: perf: hisi: Add support for HiSilicon SoC uncore PMU driver

2017-06-27 Thread Shaokun Zhang
This patch adds support HiSilicon SoC uncore PMU driver framework and
interfaces.

Signed-off-by: Shaokun Zhang 
Signed-off-by: Anurup M 
---
 drivers/perf/Kconfig |   7 +
 drivers/perf/Makefile|   1 +
 drivers/perf/hisilicon/Makefile  |   1 +
 drivers/perf/hisilicon/hisi_uncore_pmu.c | 416 +++
 drivers/perf/hisilicon/hisi_uncore_pmu.h | 116 +
 5 files changed, 541 insertions(+)
 create mode 100644 drivers/perf/hisilicon/Makefile
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_pmu.c
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_pmu.h

diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig
index e5197ff..14b7b9d 100644
--- a/drivers/perf/Kconfig
+++ b/drivers/perf/Kconfig
@@ -17,6 +17,13 @@ config ARM_PMU_ACPI
depends on ARM_PMU && ACPI
def_bool y
 
+config HISI_PMU
+   bool "HiSilicon SoC PMU"
+   depends on ACPI && (ARM64 || COMPILE_TEST)
+   help
+ Support for HiSilicon SoC uncore performance monitoring
+ unit (PMU), such as: L3C, HHA and DDRC.
+
 config QCOM_L2_PMU
bool "Qualcomm Technologies L2-cache PMU"
depends on ARCH_QCOM && ARM64 && ACPI
diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile
index 6420bd4..41d3342 100644
--- a/drivers/perf/Makefile
+++ b/drivers/perf/Makefile
@@ -1,5 +1,6 @@
 obj-$(CONFIG_ARM_PMU) += arm_pmu.o arm_pmu_platform.o
 obj-$(CONFIG_ARM_PMU_ACPI) += arm_pmu_acpi.o
+obj-$(CONFIG_HISI_PMU) += hisilicon/
 obj-$(CONFIG_QCOM_L2_PMU)  += qcom_l2_pmu.o
 obj-$(CONFIG_QCOM_L3_PMU) += qcom_l3_pmu.o
 obj-$(CONFIG_XGENE_PMU) += xgene_pmu.o
diff --git a/drivers/perf/hisilicon/Makefile b/drivers/perf/hisilicon/Makefile
new file mode 100644
index 000..2783bb3
--- /dev/null
+++ b/drivers/perf/hisilicon/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_HISI_PMU) += hisi_uncore_pmu.o
diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c 
b/drivers/perf/hisilicon/hisi_uncore_pmu.c
new file mode 100644
index 000..3a21c9e
--- /dev/null
+++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c
@@ -0,0 +1,416 @@
+/*
+ * HiSilicon SoC Hardware event counters support
+ *
+ * Copyright (C) 2017 Hisilicon Limited
+ * Author: Anurup M 
+ * Shaokun Zhang 
+ *
+ * This code is based on the uncore PMUs like arm-cci and arm-ccn.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see .
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "hisi_uncore_pmu.h"
+
+/*
+ * PMU format attributes
+ */
+ssize_t hisi_format_sysfs_show(struct device *dev,
+  struct device_attribute *attr, char *buf)
+{
+   struct dev_ext_attribute *eattr;
+
+   eattr = container_of(attr, struct dev_ext_attribute, attr);
+
+   return sprintf(buf, "%s\n", (char *)eattr->var);
+}
+
+/*
+ * PMU event attributes
+ */
+ssize_t hisi_event_sysfs_show(struct device *dev,
+ struct device_attribute *attr, char *page)
+{
+   struct dev_ext_attribute *eattr;
+
+   eattr = container_of(attr, struct dev_ext_attribute, attr);
+
+   return sprintf(page, "config=0x%lx\n", (unsigned long)eattr->var);
+}
+
+/*
+ * sysfs cpumask attributes
+ */
+ssize_t hisi_cpumask_sysfs_show(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   struct pmu *pmu = dev_get_drvdata(dev);
+   struct hisi_pmu *hisi_pmu = to_hisi_pmu(pmu);
+
+   return cpumap_print_to_pagebuf(true, buf, _pmu->cpus);
+}
+
+/* Read Super CPU cluster and CPU cluster ID from MPIDR_EL1 */
+void hisi_read_scl_and_ccl_id(u32 *scl_id, u32 *ccl_id)
+{
+   u64 mpidr;
+
+   mpidr = read_cpuid_mpidr();
+   if (mpidr & MPIDR_MT_BITMASK) {
+   if (scl_id)
+   *scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 3);
+   if (ccl_id)
+   *ccl_id = MPIDR_AFFINITY_LEVEL(mpidr, 2);
+   } else {
+   if (scl_id)
+   *scl_id = MPIDR_AFFINITY_LEVEL(mpidr, 2);
+   if (ccl_id)
+   *ccl_id = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+   }
+}
+
+static bool hisi_validate_event_group(struct perf_event *event)
+{
+   struct perf_event *sibling, *leader = event->group_leader;
+   struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu);
+   /* Include count for the event */
+   int counters = 1;
+
+   /*
+* We must NOT create groups