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:47 +0200
commit2d05d9387ef82b3ef0103ba6852a86ace4ac5d9d (patch)
treec1a26f37ae5b51d57c487395347619a43718d3a1
parent0c4f10aff8671b543846edf13af9ea2e50fdf076 (diff)
s390/cpum_cf: Add minimal in-kernel interface for counter
measurements (jsc#SLE-6904 FATE#327581). suse-commit: a5ef41ae75cb5239946a468c0eb738bbf18f3b09
-rw-r--r--arch/s390/include/asm/cpu_mcf.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/s390/include/asm/cpu_mcf.h b/arch/s390/include/asm/cpu_mcf.h
index 2cd4f09ee268..12a4224560bc 100644
--- a/arch/s390/include/asm/cpu_mcf.h
+++ b/arch/s390/include/asm/cpu_mcf.h
@@ -63,4 +63,18 @@ int __kernel_cpumcf_begin(void);
unsigned long kernel_cpumcf_alert(int clear);
void __kernel_cpumcf_end(void);
+static inline int kernel_cpumcf_begin(void)
+{
+ if (!cpum_cf_avail())
+ return -ENODEV;
+
+ preempt_disable();
+ return __kernel_cpumcf_begin();
+}
+static inline void kernel_cpumcf_end(void)
+{
+ __kernel_cpumcf_end();
+ preempt_enable();
+}
+
#endif /* _ASM_S390_CPU_MCF_H */