diff mbox series

[v2,2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 during dump kernel

Message ID 20250301182310.6832-2-maddy@linux.ibm.com (mailing list archive)
State Superseded
Headers show
Series [v2,1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel | expand

Commit Message

Madhavan Srinivasan March 1, 2025, 6:23 p.m. UTC
hv-24x7 pmu driver are intended to get system-wide resourse
metrics and these are built-in. hv-24x7 pmu does not have
commandline option to disable them. Add check for kdump and
fadump kernel to avoids loading them.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
Changelog v1:
- Added more details to commmit message

 arch/powerpc/perf/hv-24x7.c   | 3 +++
 arch/powerpc/perf/hv-common.h | 2 ++
 2 files changed, 5 insertions(+)

Comments

kernel test robot March 2, 2025, 12:20 p.m. UTC | #1
Hi Madhavan,

kernel test robot noticed the following build errors:

[auto build test ERROR on powerpc/next]
[also build test ERROR on powerpc/fixes linus/master v6.14-rc4 next-20250228]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Madhavan-Srinivasan/powerpc-perf-hv-24x7-Avoid-loading-hv-24x7-during-dump-kernel/20250302-022531
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
patch link:    https://lore.kernel.org/r/20250301182310.6832-2-maddy%40linux.ibm.com
patch subject: [PATCH v2 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 during dump kernel
config: powerpc64-randconfig-001-20250302 (https://download.01.org/0day-ci/archive/20250302/202503021908.Ed1gO0Gi-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250302/202503021908.Ed1gO0Gi-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503021908.Ed1gO0Gi-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/powerpc/perf/hv-24x7.c: In function 'hv_24x7_init':
>> arch/powerpc/perf/hv-24x7.c:1701:13: error: implicit declaration of function 'is_kdump_kernel' [-Wimplicit-function-declaration]
    1701 |         if (is_kdump_kernel() || is_fadump_active())
         |             ^~~~~~~~~~~~~~~


vim +/is_kdump_kernel +1701 arch/powerpc/perf/hv-24x7.c

  1693	
  1694	static int hv_24x7_init(void)
  1695	{
  1696		int r;
  1697		unsigned long hret;
  1698		unsigned int pvr = mfspr(SPRN_PVR);
  1699		struct hv_perf_caps caps;
  1700	
> 1701		if (is_kdump_kernel() || is_fadump_active())
  1702			return 0;
  1703	
  1704		if (!firmware_has_feature(FW_FEATURE_LPAR)) {
  1705			pr_debug("not a virtualized system, not enabling\n");
  1706			return -ENODEV;
  1707		}
  1708	
  1709		/* POWER8 only supports v1, while POWER9 only supports v2. */
  1710		if (PVR_VER(pvr) == PVR_POWER8 || PVR_VER(pvr) == PVR_POWER8E ||
  1711		    PVR_VER(pvr) == PVR_POWER8NVL)
  1712			interface_version = 1;
  1713		else {
  1714			interface_version = 2;
  1715	
  1716			/* SMT8 in POWER9 needs to aggregate result elements. */
  1717			if (threads_per_core == 8)
  1718				aggregate_result_elements = true;
  1719		}
  1720	
  1721		hret = hv_perf_caps_get(&caps);
  1722		if (hret) {
  1723			pr_debug("could not obtain capabilities, not enabling, rc=%ld\n",
  1724					hret);
  1725			return -ENODEV;
  1726		}
  1727	
  1728		hv_page_cache = kmem_cache_create("hv-page-4096", 4096, 4096, 0, NULL);
  1729		if (!hv_page_cache)
  1730			return -ENOMEM;
  1731	
  1732		/* sampling not supported */
  1733		h_24x7_pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
  1734	
  1735		r = create_events_from_catalog(&event_group.attrs,
  1736					   &event_desc_group.attrs,
  1737					   &event_long_desc_group.attrs);
  1738	
  1739		if (r)
  1740			return r;
  1741	
  1742		/* init cpuhotplug */
  1743		r = hv_24x7_cpu_hotplug_init();
  1744		if (r)
  1745			return r;
  1746	
  1747		r = perf_pmu_register(&h_24x7_pmu, h_24x7_pmu.name, -1);
  1748		if (r)
  1749			return r;
  1750	
  1751		read_24x7_sys_info();
  1752	
  1753		return 0;
  1754	}
  1755
diff mbox series

Patch

diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index d400fa391c27..3a626cd8cf54 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -1698,6 +1698,9 @@  static int hv_24x7_init(void)
 	unsigned int pvr = mfspr(SPRN_PVR);
 	struct hv_perf_caps caps;
 
+	if (is_kdump_kernel() || is_fadump_active())
+		return 0;
+
 	if (!firmware_has_feature(FW_FEATURE_LPAR)) {
 		pr_debug("not a virtualized system, not enabling\n");
 		return -ENODEV;
diff --git a/arch/powerpc/perf/hv-common.h b/arch/powerpc/perf/hv-common.h
index 2cce17bc321c..a4c062d2264e 100644
--- a/arch/powerpc/perf/hv-common.h
+++ b/arch/powerpc/perf/hv-common.h
@@ -4,6 +4,8 @@ 
 
 #include <linux/perf_event.h>
 #include <linux/types.h>
+#include <asm/fadump.h>
+#include <asm/kexec.h>
 
 struct hv_perf_caps {
 	u16 version;