diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-08-25 15:40:29 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-08-25 15:40:29 -0700 |
commit | e8a2eb47e6ca03d4a4f98f0beef73720c5dddc0c (patch) | |
tree | 31c4d7718111abddfaaa8d3fb14ab4a7e2554cd9 /arch/s390/power/swsusp.c | |
parent | 8b5a10fc6fd02289ea03480f93382b1a99006142 (diff) | |
parent | c62e43202e7cf50ca24bce58b255df7bf5de69d0 (diff) |
Merge commit 'origin/x86/urgent' into x86/asm
Diffstat (limited to 'arch/s390/power/swsusp.c')
-rw-r--r-- | arch/s390/power/swsusp.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/arch/s390/power/swsusp.c b/arch/s390/power/swsusp.c index e6a4fe9f5f24..bd1f5c6b0b8c 100644 --- a/arch/s390/power/swsusp.c +++ b/arch/s390/power/swsusp.c @@ -7,24 +7,36 @@ * */ +#include <asm/system.h> -/* - * save CPU registers before creating a hibernation image and before - * restoring the memory state from it - */ void save_processor_state(void) { - /* implentation contained in the - * swsusp_arch_suspend function + /* swsusp_arch_suspend() actually saves all cpu register contents. + * Machine checks must be disabled since swsusp_arch_suspend() stores + * register contents to their lowcore save areas. That's the same + * place where register contents on machine checks would be saved. + * To avoid register corruption disable machine checks. + * We must also disable machine checks in the new psw mask for + * program checks, since swsusp_arch_suspend() may generate program + * checks. Disabling machine checks for all other new psw masks is + * just paranoia. */ + local_mcck_disable(); + /* Disable lowcore protection */ + __ctl_clear_bit(0,28); + S390_lowcore.external_new_psw.mask &= ~PSW_MASK_MCHECK; + S390_lowcore.svc_new_psw.mask &= ~PSW_MASK_MCHECK; + S390_lowcore.io_new_psw.mask &= ~PSW_MASK_MCHECK; + S390_lowcore.program_new_psw.mask &= ~PSW_MASK_MCHECK; } -/* - * restore the contents of CPU registers - */ void restore_processor_state(void) { - /* implentation contained in the - * swsusp_arch_resume function - */ + S390_lowcore.external_new_psw.mask |= PSW_MASK_MCHECK; + S390_lowcore.svc_new_psw.mask |= PSW_MASK_MCHECK; + S390_lowcore.io_new_psw.mask |= PSW_MASK_MCHECK; + S390_lowcore.program_new_psw.mask |= PSW_MASK_MCHECK; + /* Enable lowcore protection */ + __ctl_set_bit(0,28); + local_mcck_enable(); } |