* [PATCH v2 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 during dump kernel
2025-03-01 18:23 [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel Madhavan Srinivasan
@ 2025-03-01 18:23 ` Madhavan Srinivasan
2025-03-02 12:20 ` kernel test robot
2025-03-01 18:23 ` [PATCH v2 3/4] powerpc/perf/hv-gpci: Avoid loading hv-gpci pmu " Madhavan Srinivasan
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Madhavan Srinivasan @ 2025-03-01 18:23 UTC (permalink / raw)
To: mpe, npiggin, christophe.leroy; +Cc: linuxppc-dev, Madhavan Srinivasan
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(+)
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;
--
2.47.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 during dump kernel
2025-03-01 18:23 ` [PATCH v2 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 " Madhavan Srinivasan
@ 2025-03-02 12:20 ` kernel test robot
0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-03-02 12:20 UTC (permalink / raw)
To: Madhavan Srinivasan, mpe, npiggin, christophe.leroy
Cc: oe-kbuild-all, linuxppc-dev, Madhavan Srinivasan
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
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 3/4] powerpc/perf/hv-gpci: Avoid loading hv-gpci pmu during dump kernel
2025-03-01 18:23 [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel Madhavan Srinivasan
2025-03-01 18:23 ` [PATCH v2 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 " Madhavan Srinivasan
@ 2025-03-01 18:23 ` Madhavan Srinivasan
2025-03-01 18:23 ` [PATCH v2 4/4] powerpc/perf/vpa-pmu: Avoid loading vpa-pmu driver " Madhavan Srinivasan
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Madhavan Srinivasan @ 2025-03-01 18:23 UTC (permalink / raw)
To: mpe, npiggin, christophe.leroy; +Cc: linuxppc-dev, Madhavan Srinivasan
hv-gpci pmu driver is intended to get powervm hypervisor
system-wide metrics and these are built-in. hv-gpci pmu
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-gpci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c
index 241551d1282f..e0c3df0a048f 100644
--- a/arch/powerpc/perf/hv-gpci.c
+++ b/arch/powerpc/perf/hv-gpci.c
@@ -989,6 +989,9 @@ static int hv_gpci_init(void)
struct hv_perf_caps caps;
struct hv_gpci_request_buffer *arg;
+ if (is_kdump_kernel() || is_fadump_active())
+ return 0;
+
hv_gpci_assert_offsets_correct();
if (!firmware_has_feature(FW_FEATURE_LPAR)) {
--
2.47.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v2 4/4] powerpc/perf/vpa-pmu: Avoid loading vpa-pmu driver during dump kernel
2025-03-01 18:23 [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel Madhavan Srinivasan
2025-03-01 18:23 ` [PATCH v2 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 " Madhavan Srinivasan
2025-03-01 18:23 ` [PATCH v2 3/4] powerpc/perf/hv-gpci: Avoid loading hv-gpci pmu " Madhavan Srinivasan
@ 2025-03-01 18:23 ` Madhavan Srinivasan
2025-03-02 10:13 ` [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu " kernel test robot
2025-03-05 15:29 ` kernel test robot
4 siblings, 0 replies; 7+ messages in thread
From: Madhavan Srinivasan @ 2025-03-01 18:23 UTC (permalink / raw)
To: mpe, npiggin, christophe.leroy; +Cc: linuxppc-dev, Madhavan Srinivasan
vpa-pmu driver is used to collect latency metrics for host to guest
or guest to host context switches in a PowerVM KVM guest scenario.
These are enabled using CONFIG_VPA_PMU and when these are compiled
as built-in, add check for kdump and fadump kernel to avoids
loading them, since there are no commandline option to disable them.
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
Changelog v1:
- Added more details to commmit message
arch/powerpc/perf/vpa-pmu.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/powerpc/perf/vpa-pmu.c b/arch/powerpc/perf/vpa-pmu.c
index 6a5bfd2a13b5..f7f72b976c1d 100644
--- a/arch/powerpc/perf/vpa-pmu.c
+++ b/arch/powerpc/perf/vpa-pmu.c
@@ -10,6 +10,8 @@
#include <linux/perf_event.h>
#include <asm/kvm_ppc.h>
#include <asm/kvm_book3s_64.h>
+#include <asm/fadump.h>
+#include <asm/kexec.h>
#define MODULE_VERS "1.0"
#define MODULE_NAME "pseries_vpa_pmu"
@@ -183,6 +185,9 @@ static int __init pseries_vpa_pmu_init(void)
if (!firmware_has_feature(FW_FEATURE_LPAR) || is_kvm_guest())
return -ENODEV;
+ if (is_kdump_kernel() || is_fadump_active())
+ return 0;
+
perf_pmu_register(&vpa_pmu, vpa_pmu.name, -1);
pr_info("Virtual Processor Area PMU registered.\n");
--
2.47.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel
2025-03-01 18:23 [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel Madhavan Srinivasan
` (2 preceding siblings ...)
2025-03-01 18:23 ` [PATCH v2 4/4] powerpc/perf/vpa-pmu: Avoid loading vpa-pmu driver " Madhavan Srinivasan
@ 2025-03-02 10:13 ` kernel test robot
2025-03-05 15:29 ` kernel test robot
4 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-03-02 10:13 UTC (permalink / raw)
To: Madhavan Srinivasan, mpe, npiggin, christophe.leroy
Cc: oe-kbuild-all, linuxppc-dev, Madhavan Srinivasan
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-1-maddy%40linux.ibm.com
patch subject: [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel
config: powerpc64-randconfig-001-20250302 (https://download.01.org/0day-ci/archive/20250302/202503021712.eVdjymsT-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/202503021712.eVdjymsT-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/202503021712.eVdjymsT-lkp@intel.com/
All errors (new ones prefixed by >>):
arch/powerpc/perf/core-book3s.c: In function 'init_ppc64_pmu':
>> arch/powerpc/perf/core-book3s.c:2599:13: error: implicit declaration of function 'is_kdump_kernel' [-Wimplicit-function-declaration]
2599 | if (is_kdump_kernel() || is_fadump_active())
| ^~~~~~~~~~~~~~~
vim +/is_kdump_kernel +2599 arch/powerpc/perf/core-book3s.c
2587
2588 static int __init init_ppc64_pmu(void)
2589 {
2590 if (cpu_has_feature(CPU_FTR_HVMODE) && pmu_override) {
2591 pr_warn("disabling perf due to pmu_override= command line option.\n");
2592 on_each_cpu(do_pmu_override, NULL, 1);
2593 return 0;
2594 }
2595
2596 /*
2597 * If the dump kernel is active, skip loading these drivers
2598 */
> 2599 if (is_kdump_kernel() || is_fadump_active())
2600 return 0;
2601
2602 /* run through all the pmu drivers one at a time */
2603 if (!init_power5_pmu())
2604 return 0;
2605 else if (!init_power5p_pmu())
2606 return 0;
2607 else if (!init_power6_pmu())
2608 return 0;
2609 else if (!init_power7_pmu())
2610 return 0;
2611 else if (!init_power8_pmu())
2612 return 0;
2613 else if (!init_power9_pmu())
2614 return 0;
2615 else if (!init_power10_pmu())
2616 return 0;
2617 else if (!init_power11_pmu())
2618 return 0;
2619 else if (!init_ppc970_pmu())
2620 return 0;
2621 else
2622 return init_generic_compat_pmu();
2623 }
2624 early_initcall(init_ppc64_pmu);
2625
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel
2025-03-01 18:23 [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel Madhavan Srinivasan
` (3 preceding siblings ...)
2025-03-02 10:13 ` [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu " kernel test robot
@ 2025-03-05 15:29 ` kernel test robot
4 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-03-05 15:29 UTC (permalink / raw)
To: Madhavan Srinivasan, mpe, npiggin, christophe.leroy
Cc: llvm, oe-kbuild-all, linuxppc-dev, Madhavan Srinivasan
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-rc5 next-20250305]
[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-1-maddy%40linux.ibm.com
patch subject: [PATCH v2 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel
config: powerpc64-randconfig-001-20250305 (https://download.01.org/0day-ci/archive/20250305/202503052346.eTbppObo-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250305/202503052346.eTbppObo-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/202503052346.eTbppObo-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/powerpc/perf/core-book3s.c:2599:6: error: call to undeclared function 'is_kdump_kernel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2599 | if (is_kdump_kernel() || is_fadump_active())
| ^
1 error generated.
vim +/is_kdump_kernel +2599 arch/powerpc/perf/core-book3s.c
2587
2588 static int __init init_ppc64_pmu(void)
2589 {
2590 if (cpu_has_feature(CPU_FTR_HVMODE) && pmu_override) {
2591 pr_warn("disabling perf due to pmu_override= command line option.\n");
2592 on_each_cpu(do_pmu_override, NULL, 1);
2593 return 0;
2594 }
2595
2596 /*
2597 * If the dump kernel is active, skip loading these drivers
2598 */
> 2599 if (is_kdump_kernel() || is_fadump_active())
2600 return 0;
2601
2602 /* run through all the pmu drivers one at a time */
2603 if (!init_power5_pmu())
2604 return 0;
2605 else if (!init_power5p_pmu())
2606 return 0;
2607 else if (!init_power6_pmu())
2608 return 0;
2609 else if (!init_power7_pmu())
2610 return 0;
2611 else if (!init_power8_pmu())
2612 return 0;
2613 else if (!init_power9_pmu())
2614 return 0;
2615 else if (!init_power10_pmu())
2616 return 0;
2617 else if (!init_power11_pmu())
2618 return 0;
2619 else if (!init_ppc970_pmu())
2620 return 0;
2621 else
2622 return init_generic_compat_pmu();
2623 }
2624 early_initcall(init_ppc64_pmu);
2625
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread