2 * Suspend support specific for s390.
4 * Copyright IBM Corp. 2009
6 * Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com>
10 #include <asm/system.h>
13 * References to section boundaries
15 extern const void __nosave_begin
, __nosave_end
;
17 int pfn_is_nosave(unsigned long pfn
)
19 unsigned long nosave_begin_pfn
= PFN_DOWN(__pa(&__nosave_begin
));
20 unsigned long nosave_end_pfn
= PFN_DOWN(__pa(&__nosave_end
));
22 /* Always save lowcore pages (LC protection might be enabled). */
25 if (pfn
>= nosave_begin_pfn
&& pfn
< nosave_end_pfn
)
27 /* Skip memory holes and read-only pages (NSS, DCSS, ...). */
28 if (tprot(PFN_PHYS(pfn
)))
33 void save_processor_state(void)
35 /* swsusp_arch_suspend() actually saves all cpu register contents.
36 * Machine checks must be disabled since swsusp_arch_suspend() stores
37 * register contents to their lowcore save areas. That's the same
38 * place where register contents on machine checks would be saved.
39 * To avoid register corruption disable machine checks.
40 * We must also disable machine checks in the new psw mask for
41 * program checks, since swsusp_arch_suspend() may generate program
42 * checks. Disabling machine checks for all other new psw masks is
46 /* Disable lowcore protection */
47 __ctl_clear_bit(0,28);
48 S390_lowcore
.external_new_psw
.mask
&= ~PSW_MASK_MCHECK
;
49 S390_lowcore
.svc_new_psw
.mask
&= ~PSW_MASK_MCHECK
;
50 S390_lowcore
.io_new_psw
.mask
&= ~PSW_MASK_MCHECK
;
51 S390_lowcore
.program_new_psw
.mask
&= ~PSW_MASK_MCHECK
;
54 void restore_processor_state(void)
56 S390_lowcore
.external_new_psw
.mask
|= PSW_MASK_MCHECK
;
57 S390_lowcore
.svc_new_psw
.mask
|= PSW_MASK_MCHECK
;
58 S390_lowcore
.io_new_psw
.mask
|= PSW_MASK_MCHECK
;
59 S390_lowcore
.program_new_psw
.mask
|= PSW_MASK_MCHECK
;
60 /* Enable lowcore protection */