Commit 70e28aa0 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

s390/nmi: fix order of register validation

When validating register contents first validate control registers
since these control the availability of features later being
validated.
For example the control register 0 should be validated first, before
the additional floating point (AFP) registers are validated, since
control register 0 contains the AFP-register control bit.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 77606708
...@@ -116,6 +116,18 @@ static int notrace s390_validate_registers(union mci mci, int umode) ...@@ -116,6 +116,18 @@ static int notrace s390_validate_registers(union mci mci, int umode)
s390_handle_damage(); s390_handle_damage();
kill_task = 1; kill_task = 1;
} }
/* Validate control registers */
if (!mci.cr) {
/*
* Control registers have unknown contents.
* Can't recover and therefore stopping machine.
*/
s390_handle_damage();
} else {
asm volatile(
" lctlg 0,15,0(%0)"
: : "a" (&S390_lowcore.cregs_save_area) : "memory");
}
if (!mci.fp) { if (!mci.fp) {
/* /*
* Floating point registers can't be restored. If the * Floating point registers can't be restored. If the
...@@ -208,18 +220,6 @@ static int notrace s390_validate_registers(union mci mci, int umode) ...@@ -208,18 +220,6 @@ static int notrace s390_validate_registers(union mci mci, int umode)
*/ */
kill_task = 1; kill_task = 1;
} }
/* Validate control registers */
if (!mci.cr) {
/*
* Control registers have unknown contents.
* Can't recover and therefore stopping machine.
*/
s390_handle_damage();
} else {
asm volatile(
" lctlg 0,15,0(%0)"
: : "a" (&S390_lowcore.cregs_save_area) : "memory");
}
/* /*
* We don't even try to validate the TOD register, since we simply * We don't even try to validate the TOD register, since we simply
* can't write something sensible into that register. * can't write something sensible into that register.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment