summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/nmi.c
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2023-12-01 14:09:31 +0100
committerAlexander Gordeev <agordeev@linux.ibm.com>2023-12-11 14:33:05 +0100
commit1c8b8cf28f18ef57d189a170eaf6e0d3d3794ec5 (patch)
tree35e6068862b863b90beae951b46aac9fcb2739b9 /arch/s390/kernel/nmi.c
parents390/nmi: consistently enable machine checks in trap_init() (diff)
downloadlinux-1c8b8cf28f18ef57d189a170eaf6e0d3d3794ec5.tar.xz
linux-1c8b8cf28f18ef57d189a170eaf6e0d3d3794ec5.zip
s390/nmi: implement and use local_mcck_save() / local_mcck_restore()
Instead of using local_mcck_disable() / local_mcck_enable() implement and use local_mcck_save() / local_mcck_restore() to disable machine checks, and restoring the previous state. The problem with using local_mcck_disable() / local_mcck_enable() is that there is an assumption that machine checks are always enabled. While this is currently the case the code still looks quite odd, readers need to double check if the code is correct. In order to increase readability save and then restore the old machine check mask bit, instead of assuming that it must have been enabled. Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/nmi.c')
-rw-r--r--arch/s390/kernel/nmi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c
index 0daf0f1cdfc9..60bcb451a4eb 100644
--- a/arch/s390/kernel/nmi.c
+++ b/arch/s390/kernel/nmi.c
@@ -159,16 +159,17 @@ NOKPROBE_SYMBOL(s390_handle_damage);
void s390_handle_mcck(void)
{
struct mcck_struct mcck;
+ unsigned long mflags;
/*
* Disable machine checks and get the current state of accumulated
* machine checks. Afterwards delete the old state and enable machine
* checks again.
*/
- local_mcck_disable();
+ local_mcck_save(mflags);
mcck = *this_cpu_ptr(&cpu_mcck);
memset(this_cpu_ptr(&cpu_mcck), 0, sizeof(mcck));
- local_mcck_enable();
+ local_mcck_restore(mflags);
if (mcck.channel_report)
crw_handle_channel_report();