-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[S390] s390: hibernation support for s390
This patch introduces the hibernation backend support to the s390 architecture. Now it is possible to suspend a mainframe Linux guest using the following command: echo disk > /sys/power/state Signed-off-by: Hans-Joachim Picht <hans@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
- Loading branch information
Hans-Joachim Picht
authored and
Martin Schwidefsky
committed
Jun 16, 2009
1 parent
c369527
commit 155af2f
Showing
12 changed files
with
375 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef __ASM_S390_SUSPEND_H | ||
#define __ASM_S390_SUSPEND_H | ||
|
||
static inline int arch_prepare_suspend(void) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# | ||
# Makefile for s390 PM support | ||
# | ||
|
||
obj-$(CONFIG_HIBERNATION) += suspend.o | ||
obj-$(CONFIG_HIBERNATION) += swsusp.o | ||
obj-$(CONFIG_HIBERNATION) += swsusp_64.o | ||
obj-$(CONFIG_HIBERNATION) += swsusp_asm64.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Suspend support specific for s390. | ||
* | ||
* Copyright IBM Corp. 2009 | ||
* | ||
* Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com> | ||
*/ | ||
|
||
#include <linux/mm.h> | ||
#include <linux/suspend.h> | ||
#include <linux/reboot.h> | ||
#include <linux/pfn.h> | ||
#include <asm/sections.h> | ||
#include <asm/ipl.h> | ||
|
||
/* | ||
* References to section boundaries | ||
*/ | ||
extern const void __nosave_begin, __nosave_end; | ||
|
||
/* | ||
* check if given pfn is in the 'nosave' or in the read only NSS section | ||
*/ | ||
int pfn_is_nosave(unsigned long pfn) | ||
{ | ||
unsigned long nosave_begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT; | ||
unsigned long nosave_end_pfn = PAGE_ALIGN(__pa(&__nosave_end)) | ||
>> PAGE_SHIFT; | ||
unsigned long eshared_pfn = PFN_DOWN(__pa(&_eshared)) - 1; | ||
unsigned long stext_pfn = PFN_DOWN(__pa(&_stext)); | ||
|
||
if (pfn >= nosave_begin_pfn && pfn < nosave_end_pfn) | ||
return 1; | ||
if (pfn >= stext_pfn && pfn <= eshared_pfn) { | ||
if (ipl_info.type == IPL_TYPE_NSS) | ||
return 1; | ||
} else if ((tprot(pfn * PAGE_SIZE) && pfn > 0)) | ||
return 1; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Support for suspend and resume on s390 | ||
* | ||
* Copyright IBM Corp. 2009 | ||
* | ||
* Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com> | ||
* | ||
*/ | ||
|
||
|
||
/* | ||
* 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 | ||
*/ | ||
} | ||
|
||
/* | ||
* restore the contents of CPU registers | ||
*/ | ||
void restore_processor_state(void) | ||
{ | ||
/* implentation contained in the | ||
* swsusp_arch_resume function | ||
*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Support for suspend and resume on s390 | ||
* | ||
* Copyright IBM Corp. 2009 | ||
* | ||
* Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com> | ||
* | ||
*/ | ||
|
||
#include <asm/system.h> | ||
#include <linux/interrupt.h> | ||
|
||
void do_after_copyback(void) | ||
{ | ||
mb(); | ||
} | ||
|
Oops, something went wrong.