s390/nmi: implement and use local_mcck_save() / local_mcck_restore()
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 1 Dec 2023 13:09:31 +0000 (14:09 +0100)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Mon, 11 Dec 2023 13:33:05 +0000 (14:33 +0100)
commit1c8b8cf28f18ef57d189a170eaf6e0d3d3794ec5
tree35e6068862b863b90beae951b46aac9fcb2739b9
parent84e599e3adc78800f8517f22f65b7a181cbb824b
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>
arch/s390/include/asm/processor.h
arch/s390/kernel/nmi.c
arch/s390/lib/test_unwind.c