linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel
@ 2025-02-16 17:12 Madhavan Srinivasan
  2025-02-16 17:12 ` [PATCH 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 " Madhavan Srinivasan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Madhavan Srinivasan @ 2025-02-16 17:12 UTC (permalink / raw)
  To: mpe, npiggin, christophe.leroy
  Cc: naveen.n.rao, linuxppc-dev, Madhavan Srinivasan

Platform pmu driver may not be used in the dump kernel.
Avoid loading it.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
 arch/powerpc/perf/core-book3s.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 2b79171ee185..9a009dff63b3 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -22,6 +22,8 @@
 
 #ifdef CONFIG_PPC64
 #include "internal.h"
+#include <asm/fadump.h>
+#include <asm/kexec.h>
 #endif
 
 #define BHRB_MAX_ENTRIES	32
@@ -2571,6 +2573,12 @@ static int __init init_ppc64_pmu(void)
 		return 0;
 	}
 
+	/*
+	 * If the dump kernel is active, skip loading these drivers
+	 */
+	if (is_kdump_kernel() || is_fadump_active())
+		return 0;
+
 	/* run through all the pmu drivers one at a time */
 	if (!init_power5_pmu())
 		return 0;
-- 
2.47.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 during dump kernel
  2025-02-16 17:12 [PATCH 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel Madhavan Srinivasan
@ 2025-02-16 17:12 ` Madhavan Srinivasan
  2025-02-16 17:12 ` [PATCH 3/4] powerpc/perf/hv-gpci: Avoid loading hv-gpci pmu " Madhavan Srinivasan
  2025-02-16 17:12 ` [PATCH 4/4] powerpc/perf/vpa-pmu: Avoid loading vpa-pmy driver " Madhavan Srinivasan
  2 siblings, 0 replies; 4+ messages in thread
From: Madhavan Srinivasan @ 2025-02-16 17:12 UTC (permalink / raw)
  To: mpe, npiggin, christophe.leroy
  Cc: naveen.n.rao, linuxppc-dev, Madhavan Srinivasan

hv-24x7 pmu driver is intended to get system-wide resourse
metrics and may not be used during the dump kernel, avoid
loading it

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
 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] 4+ messages in thread

* [PATCH 3/4] powerpc/perf/hv-gpci: Avoid loading hv-gpci pmu during dump kernel
  2025-02-16 17:12 [PATCH 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel Madhavan Srinivasan
  2025-02-16 17:12 ` [PATCH 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 " Madhavan Srinivasan
@ 2025-02-16 17:12 ` Madhavan Srinivasan
  2025-02-16 17:12 ` [PATCH 4/4] powerpc/perf/vpa-pmu: Avoid loading vpa-pmy driver " Madhavan Srinivasan
  2 siblings, 0 replies; 4+ messages in thread
From: Madhavan Srinivasan @ 2025-02-16 17:12 UTC (permalink / raw)
  To: mpe, npiggin, christophe.leroy
  Cc: naveen.n.rao, linuxppc-dev, Madhavan Srinivasan

hv-gpci pmu driver is intended to get powervm hypervisor
system-wide metrics and this may not be used during the
dump kernel, avoid loading it

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
 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] 4+ messages in thread

* [PATCH 4/4] powerpc/perf/vpa-pmu: Avoid loading vpa-pmy driver during dump kernel
  2025-02-16 17:12 [PATCH 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel Madhavan Srinivasan
  2025-02-16 17:12 ` [PATCH 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 " Madhavan Srinivasan
  2025-02-16 17:12 ` [PATCH 3/4] powerpc/perf/hv-gpci: Avoid loading hv-gpci pmu " Madhavan Srinivasan
@ 2025-02-16 17:12 ` Madhavan Srinivasan
  2 siblings, 0 replies; 4+ messages in thread
From: Madhavan Srinivasan @ 2025-02-16 17:12 UTC (permalink / raw)
  To: mpe, npiggin, christophe.leroy
  Cc: naveen.n.rao, 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.
This may not be used during the dump kernel, avoid loading it

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
 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] 4+ messages in thread

end of thread, other threads:[~2025-02-16 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-16 17:12 [PATCH 1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel Madhavan Srinivasan
2025-02-16 17:12 ` [PATCH 2/4] powerpc/perf/hv-24x7: Avoid loading hv-24x7 " Madhavan Srinivasan
2025-02-16 17:12 ` [PATCH 3/4] powerpc/perf/hv-gpci: Avoid loading hv-gpci pmu " Madhavan Srinivasan
2025-02-16 17:12 ` [PATCH 4/4] powerpc/perf/vpa-pmu: Avoid loading vpa-pmy driver " Madhavan Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).