diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2023-12-01 16:09:31 +0300 |
---|---|---|
committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2023-12-11 16:33:05 +0300 |
commit | 1c8b8cf28f18ef57d189a170eaf6e0d3d3794ec5 (patch) | |
tree | 35e6068862b863b90beae951b46aac9fcb2739b9 /arch/s390/lib/test_unwind.c | |
parent | 84e599e3adc78800f8517f22f65b7a181cbb824b (diff) | |
download | linux-1c8b8cf28f18ef57d189a170eaf6e0d3d3794ec5.tar.xz |
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/lib/test_unwind.c')
-rw-r--r-- | arch/s390/lib/test_unwind.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/lib/test_unwind.c b/arch/s390/lib/test_unwind.c index 7231bf97b93a..2848e3fb2ff5 100644 --- a/arch/s390/lib/test_unwind.c +++ b/arch/s390/lib/test_unwind.c @@ -350,15 +350,15 @@ static noinline int unwindme_func3(struct unwindme *u) /* This function must appear in the backtrace. */ static noinline int unwindme_func2(struct unwindme *u) { - unsigned long flags; + unsigned long flags, mflags; int rc; if (u->flags & UWM_SWITCH_STACK) { local_irq_save(flags); - local_mcck_disable(); + local_mcck_save(mflags); rc = call_on_stack(1, S390_lowcore.nodat_stack, int, unwindme_func3, struct unwindme *, u); - local_mcck_enable(); + local_mcck_restore(mflags); local_irq_restore(flags); return rc; } else { |