提交 5f954c34 编写于 作者: H Heiko Carstens 提交者: Martin Schwidefsky

[S390] hibernation: fix lowcore handling

Our swsusp_arch_suspend() backend implementation disables prefixing
by setting the contents of the prefix register to 0.
However afterwards common code functions are called which might
access percpu data structures.
Since the lowcore contains e.g. the percpu base pointer this isn't
a good idea. So fix this by copying the hibernating cpu's lowcore to
absolute address zero.
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 4be3bd78
...@@ -210,7 +210,7 @@ static noinline __init void detect_machine_type(void) ...@@ -210,7 +210,7 @@ static noinline __init void detect_machine_type(void)
machine_flags |= MACHINE_FLAG_VM; machine_flags |= MACHINE_FLAG_VM;
} }
static void early_pgm_check_handler(void) static __init void early_pgm_check_handler(void)
{ {
unsigned long addr; unsigned long addr;
const struct exception_table_entry *fixup; const struct exception_table_entry *fixup;
...@@ -222,7 +222,7 @@ static void early_pgm_check_handler(void) ...@@ -222,7 +222,7 @@ static void early_pgm_check_handler(void)
S390_lowcore.program_old_psw.addr = fixup->fixup | PSW_ADDR_AMODE; S390_lowcore.program_old_psw.addr = fixup->fixup | PSW_ADDR_AMODE;
} }
void setup_lowcore_early(void) static noinline __init void setup_lowcore_early(void)
{ {
psw_t psw; psw_t psw;
......
...@@ -40,11 +40,11 @@ swsusp_arch_suspend: ...@@ -40,11 +40,11 @@ swsusp_arch_suspend:
/* Store prefix register on stack */ /* Store prefix register on stack */
stpx __SF_EMPTY(%r15) stpx __SF_EMPTY(%r15)
/* Setup base register for lowcore (absolute 0) */ /* Save prefix register contents for lowcore */
llgf %r1,__SF_EMPTY(%r15) llgf %r4,__SF_EMPTY(%r15)
/* Get pointer to save area */ /* Get pointer to save area */
aghi %r1,0x1000 lghi %r1,0x1000
/* Store registers */ /* Store registers */
mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */ mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */
...@@ -79,8 +79,11 @@ swsusp_arch_suspend: ...@@ -79,8 +79,11 @@ swsusp_arch_suspend:
xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15) xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15)
spx __SF_EMPTY(%r15) spx __SF_EMPTY(%r15)
/* Setup lowcore */ lghi %r2,0
brasl %r14,setup_lowcore_early lghi %r3,2*PAGE_SIZE
lghi %r5,2*PAGE_SIZE
1: mvcle %r2,%r4,0
jo 1b
/* Save image */ /* Save image */
brasl %r14,swsusp_save brasl %r14,swsusp_save
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册