Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 155af2f9 authored by Hans-Joachim Picht's avatar Hans-Joachim Picht Committed by Martin Schwidefsky
Browse files

[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: default avatarHans-Joachim Picht <hans@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent c369527f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -348,6 +348,9 @@ config ARCH_ENABLE_MEMORY_HOTPLUG
config ARCH_ENABLE_MEMORY_HOTREMOVE
	def_bool y

config ARCH_HIBERNATION_POSSIBLE
       def_bool y if 64BIT

source "mm/Kconfig"

comment "I/O subsystem configuration"
@@ -592,6 +595,12 @@ config SECCOMP

endmenu

menu "Power Management"

source "kernel/power/Kconfig"

endmenu

source "net/Kconfig"

config PCMCIA
+3 −1
Original line number Diff line number Diff line
@@ -88,7 +88,9 @@ LDFLAGS_vmlinux := -e start
head-y		:= arch/s390/kernel/head.o arch/s390/kernel/init_task.o

core-y		+= arch/s390/mm/ arch/s390/kernel/ arch/s390/crypto/ \
		   arch/s390/appldata/ arch/s390/hypfs/ arch/s390/kvm/
		   arch/s390/appldata/ arch/s390/hypfs/ arch/s390/kvm/ \
		   arch/s390/power/

libs-y		+= arch/s390/lib/
drivers-y	+= drivers/s390/
drivers-$(CONFIG_MATHEMU) += arch/s390/math-emu/
+10 −0
Original line number Diff line number Diff line
#ifndef __ASM_S390_SUSPEND_H
#define __ASM_S390_SUSPEND_H

static inline int arch_prepare_suspend(void)
{
	return 0;
}

#endif
+16 −6
Original line number Diff line number Diff line
/*
 *  include/asm-s390/system.h
 * Copyright IBM Corp. 1999, 2009
 *
 *  S390 version
 *    Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
 *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
 *
 *  Derived from "include/asm-i386/system.h"
 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
 */

#ifndef __ASM_SYSTEM_H
@@ -469,6 +465,20 @@ extern psw_t sysc_restore_trace_psw;
extern psw_t io_restore_trace_psw;
#endif

static inline int tprot(unsigned long addr)
{
	int rc = -EFAULT;

	asm volatile(
		"	tprot	0(%1),0\n"
		"0:	ipm	%0\n"
		"	srl	%0,28\n"
		"1:\n"
		EX_TABLE(0b,1b)
		: "+d" (rc) : "a" (addr) : "cc");
	return rc;
}

#endif /* __KERNEL__ */

#endif
+3 −3
Original line number Diff line number Diff line
/*
 *  arch/s390/kernel/early.c
 *
 *    Copyright IBM Corp. 2007
 *    Copyright IBM Corp. 2007, 2009
 *    Author(s): Hongjie Yang <hongjie@us.ibm.com>,
 *		 Heiko Carstens <heiko.carstens@de.ibm.com>
 */
@@ -210,7 +210,7 @@ static noinline __init void detect_machine_type(void)
		machine_flags |= MACHINE_FLAG_VM;
}

static __init void early_pgm_check_handler(void)
static void early_pgm_check_handler(void)
{
	unsigned long addr;
	const struct exception_table_entry *fixup;
@@ -222,7 +222,7 @@ static __init void early_pgm_check_handler(void)
	S390_lowcore.program_old_psw.addr = fixup->fixup | PSW_ADDR_AMODE;
}

static noinline __init void setup_lowcore_early(void)
void setup_lowcore_early(void)
{
	psw_t psw;

Loading