[SRU][F][PATCH 2/2] s390/cpumf: Support for CPU Measurement Sampling Facility LS bit
Krzysztof Kozlowski
krzysztof.kozlowski at canonical.com
Wed Feb 16 11:43:36 UTC 2022
From: Thomas Richter <tmricht at linux.ibm.com>
BugLink: https://bugs.launchpad.net/bugs/1960182
Adds support for the CPU Measurement Sampling Facility limit sampling
bit in the sampling device driver.
Limited samples have no valueable information are not collected.
Signed-off-by: Thomas Richter <tmricht at linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk at linux.ibm.com>
Signed-off-by: Heiko Carstens <hca at linux.ibm.com>
(cherry picked from commit 745f5d20e7936931f924410f32d8b0e599b5990e)
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski at canonical.com>
---
arch/s390/include/asm/cpu_mf.h | 4 +++-
arch/s390/kernel/perf_cpum_sf.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h
index 819803a97c2b..4dfebb8705e4 100644
--- a/arch/s390/include/asm/cpu_mf.h
+++ b/arch/s390/include/asm/cpu_mf.h
@@ -109,7 +109,9 @@ struct hws_basic_entry {
unsigned int AS:2; /* 29-30 PSW address-space control */
unsigned int I:1; /* 31 entry valid or invalid */
unsigned int CL:2; /* 32-33 Configuration Level */
- unsigned int:14;
+ unsigned int H:1; /* 34 Host Indicator */
+ unsigned int LS:1; /* 35 Limited Sampling */
+ unsigned int:12;
unsigned int prim_asn:16; /* primary ASN */
unsigned long long ia; /* Instruction Address */
unsigned long long gpp; /* Guest Program Parameter */
diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
index b83bddf35e06..15f055947b66 100644
--- a/arch/s390/kernel/perf_cpum_sf.c
+++ b/arch/s390/kernel/perf_cpum_sf.c
@@ -1182,7 +1182,7 @@ static void hw_collect_samples(struct perf_event *event, unsigned long *sdbt,
sample = (struct hws_basic_entry *) *sdbt;
while ((unsigned long *) sample < (unsigned long *) te) {
/* Check for an empty sample */
- if (!sample->def)
+ if (!sample->def || sample->LS)
break;
/* Update perf event period */
--
2.32.0
More information about the kernel-team
mailing list