Home Home > GIT Browse > SLE15-SP1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-07-19 17:10:24 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-07-19 22:44:48 +0200
commit25ba0fca496ffa486a59121774b1a408e8061df4 (patch)
tree326ee8e901c2582125681b1895e92fec3e5cc031
parent66b95ee15da83ab672f811f6f01b5bd7b1159a5c (diff)
s390/cpum_cf: introduce kernel_cpumcf_avail() function
(jsc#SLE-6904 FATE#327581).
-rw-r--r--patches.suse/s390-cpum_cf-introduce-kernel_cpumcf_avail-function71
-rw-r--r--series.conf1
2 files changed, 72 insertions, 0 deletions
diff --git a/patches.suse/s390-cpum_cf-introduce-kernel_cpumcf_avail-function b/patches.suse/s390-cpum_cf-introduce-kernel_cpumcf_avail-function
new file mode 100644
index 0000000000..01098831af
--- /dev/null
+++ b/patches.suse/s390-cpum_cf-introduce-kernel_cpumcf_avail-function
@@ -0,0 +1,71 @@
+From: Hendrik Brueckner <brueckner@linux.ibm.com>
+Date: Thu, 25 Oct 2018 16:58:15 +0200
+Subject: s390/cpum_cf: introduce kernel_cpumcf_avail() function
+Git-commit: 869f4f98fafadddb3a871b9513f24a44479d8296
+Patch-mainline: v5.1-rc1
+References: jsc#SLE-6904 FATE#327581
+
+A preparation to move out common CPU-MF counter facility support
+functions, first introduce a function that indicates whether the
+support is ready to use.
+
+Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Acked-by: Petr Tesarik <ptesarik@suse.com>
+---
+ arch/s390/include/asm/cpu_mcf.h | 1 +
+ arch/s390/kernel/perf_cpum_cf.c | 20 +++++++++++++++++---
+ 2 files changed, 18 insertions(+), 3 deletions(-)
+
+--- a/arch/s390/include/asm/cpu_mcf.h
++++ b/arch/s390/include/asm/cpu_mcf.h
+@@ -59,6 +59,7 @@ struct cpu_cf_events {
+ };
+ DECLARE_PER_CPU(struct cpu_cf_events, cpu_cf_events);
+
++bool kernel_cpumcf_avail(void);
+ int __kernel_cpumcf_begin(void);
+ unsigned long kernel_cpumcf_alert(int clear);
+ void __kernel_cpumcf_end(void);
+--- a/arch/s390/kernel/perf_cpum_cf.c
++++ b/arch/s390/kernel/perf_cpum_cf.c
+@@ -36,6 +36,9 @@ DEFINE_PER_CPU(struct cpu_cf_events, cpu
+ .txn_flags = 0,
+ };
+
++/* Indicator whether the CPU-Measurement Counter Facility Support is ready */
++static bool cpum_cf_initalized;
++
+ static enum cpumf_ctr_set get_counter_set(u64 event)
+ {
+ int set = CPUMF_CTR_SET_MAX;
+@@ -236,6 +239,12 @@ static void setup_pmc_cpu(void *flags)
+ lcctl(0);
+ }
+
++bool kernel_cpumcf_avail(void)
++{
++ return cpum_cf_initalized;
++}
++EXPORT_SYMBOL(kernel_cpumcf_avail);
++
+ /* Reserve/release functions for sharing perf hardware */
+ static DEFINE_SPINLOCK(cpumcf_owner_lock);
+ static void *cpumcf_owner;
+@@ -712,8 +721,13 @@ static int __init cpumf_pmu_init(void)
+ cpumf_measurement_alert);
+ return rc;
+ }
+- return cpuhp_setup_state(CPUHP_AP_PERF_S390_CF_ONLINE,
+- "perf/s390/cf:online",
+- s390_pmu_online_cpu, s390_pmu_offline_cpu);
++
++ rc = cpuhp_setup_state(CPUHP_AP_PERF_S390_CF_ONLINE,
++ "perf/s390/cf:online",
++ s390_pmu_online_cpu, s390_pmu_offline_cpu);
++ if (!rc)
++ cpum_cf_initalized = true;
++
++ return rc;
+ }
+ early_initcall(cpumf_pmu_init);
diff --git a/series.conf b/series.conf
index 0d1c237338..d2248b907b 100644
--- a/series.conf
+++ b/series.conf
@@ -45473,6 +45473,7 @@
patches.suse/s390-cpum_cf-add-minimal-in-kernel-interface-for-counter-measurements
patches.suse/s390-cpu_mf-add-store-cpu-counter-multiple-instruction-support
patches.suse/s390-cpu_mf-replace-stcctm5-with-the-stcctm-function
+ patches.suse/s390-cpum_cf-introduce-kernel_cpumcf_avail-function
patches.fixes/0001-s390-vfio_ap-link-the-vfio_ap-devices-to-the-vfio_ap.patch
patches.drivers/clocksource-drivers-sun5i-Fail-gracefully-when-clock.patch
patches.drivers/clocksource-drivers-exynos_mct-Move-one-shot-check-f.patch