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

Commit 8f5759ae authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux into next

Pull first set of s390 updates from Martin Schwidefsky:
 "The biggest change in this patchset is conversion from the bootmem
  bitmaps to the memblock code.  This conversion requires two common
  code patches to introduce the 'physmem' memblock list.

  We experimented with ticket spinlocks but in the end decided against
  them as they perform poorly on virtualized systems.  But the spinlock
  cleanup and some small improvements are included.

  The uaccess code got another optimization, the get_user/put_user calls
  are now inline again for kernel compiles targeted at z10 or newer
  machines.  This makes the text segment shorter and the code gets a
  little bit faster.

  And as always some bug fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (31 commits)
  s390/lowcore: replace lowcore irb array with a per-cpu variable
  s390/lowcore: reserve 96 bytes for IRB in lowcore
  s390/facilities: remove extract-cpu-time facility check
  s390: require mvcos facility for z10 and newer machines
  s390/boot: fix boot of compressed kernel built with gcc 4.9
  s390/cio: remove weird assignment during argument evaluation
  s390/time: cast tv_nsec to u64 prior to shift in update_vsyscall
  s390/oprofile: make return of 0 explicit
  s390/spinlock: refactor arch_spin_lock_wait[_flags]
  s390/rwlock: add missing local_irq_restore calls
  s390/spinlock,rwlock: always to a load-and-test first
  s390/cio: fix multiple structure definitions
  s390/spinlock: fix system hang with spin_retry <= 0
  s390/appldata: add slab.h for kzalloc/kfree
  s390/uaccess: provide inline variants of get_user/put_user
  s390/pci: add some new arch specific pci attributes
  s390/pci: use pdev->dev.groups for attribute creation
  s390/pci: use macro for attribute creation
  s390/pci: improve state check when processing hotplug events
  s390: split TIF bits into CIF, PIF and TIF bits
  ...
parents e5c4ecdc 63aef00b
Loading
Loading
Loading
Loading
+19 −54
Original line number Diff line number Diff line
s390 SCSI dump tool (zfcpdump)
The s390 SCSI dump tool (zfcpdump)

System z machines (z900 or higher) provide hardware support for creating system
dumps on SCSI disks. The dump process is initiated by booting a dump tool, which
has to create a dump of the current (probably crashed) Linux image. In order to
not overwrite memory of the crashed Linux with data of the dump tool, the
hardware saves some memory plus the register sets of the boot cpu before the
hardware saves some memory plus the register sets of the boot CPU before the
dump tool is loaded. There exists an SCLP hardware interface to obtain the saved
memory afterwards. Currently 32 MB are saved.

@@ -19,68 +19,33 @@ The kernel part of zfcpdump is implemented as a debugfs file under "zcore/mem",
which exports memory and registers of the crashed Linux in an s390
standalone dump format. It can be used in the same way as e.g. /dev/mem. The
dump format defines a 4K header followed by plain uncompressed memory. The
register sets are stored in the prefix pages of the respective cpus. To build a
register sets are stored in the prefix pages of the respective CPUs. To build a
dump enabled kernel with the zcore driver, the kernel config option
CONFIG_ZFCPDUMP has to be set. When reading from "zcore/mem", the part of
CONFIG_CRASH_DUMP has to be set. When reading from "zcore/mem", the part of
memory, which has been saved by hardware is read by the driver via the SCLP
hardware interface. The second part is just copied from the non overwritten real
memory.

The userspace application of zfcpdump can reside e.g. in an intitramfs or an
initrd. It reads from zcore/mem and writes the system dump to a file on a
SCSI disk.
Since kernel version 3.12 also the /proc/vmcore file can also be used to access
the dump.

To build a zfcpdump kernel use the following settings in your kernel
configuration:
 * CONFIG_ZFCPDUMP=y
 * Enable ZFCP driver
 * Enable SCSI driver
 * Enable ext2 and ext3 filesystems
 * Disable as many features as possible to keep the kernel small.
   E.g. network support is not needed at all.
To get a valid zfcpdump kernel configuration use "make zfcpdump_defconfig".

To use the zfcpdump userspace application in an initramfs you have to do the
following:
The s390 zipl tool looks for the zfcpdump kernel and optional initrd/initramfs
under the following locations:

 * Copy the zfcpdump executable somewhere into your Linux tree.
   E.g. to "arch/s390/boot/zfcpdump. If you do not want to include
   shared libraries, compile the tool with the "-static" gcc option.
 * If you want to include e2fsck, add it to your source tree, too. The zfcpdump
   application attempts to start /sbin/e2fsck from the ramdisk.
 * Use an initramfs config file like the following:
* kernel:  <zfcpdump directory>/zfcpdump.image
* ramdisk: <zfcpdump directory>/zfcpdump.rd

   dir /dev 755 0 0
   nod /dev/console 644 0 0 c 5 1
   nod /dev/null 644 0 0 c 1 3
   nod /dev/sda1 644 0 0 b 8 1
   nod /dev/sda2 644 0 0 b 8 2
   nod /dev/sda3 644 0 0 b 8 3
   nod /dev/sda4 644 0 0 b 8 4
   nod /dev/sda5 644 0 0 b 8 5
   nod /dev/sda6 644 0 0 b 8 6
   nod /dev/sda7 644 0 0 b 8 7
   nod /dev/sda8 644 0 0 b 8 8
   nod /dev/sda9 644 0 0 b 8 9
   nod /dev/sda10 644 0 0 b 8 10
   nod /dev/sda11 644 0 0 b 8 11
   nod /dev/sda12 644 0 0 b 8 12
   nod /dev/sda13 644 0 0 b 8 13
   nod /dev/sda14 644 0 0 b 8 14
   nod /dev/sda15 644 0 0 b 8 15
   file /init arch/s390/boot/zfcpdump 755 0 0
   file /sbin/e2fsck arch/s390/boot/e2fsck 755 0 0
   dir /proc 755 0 0
   dir /sys 755 0 0
   dir /mnt 755 0 0
   dir /sbin 755 0 0
The zfcpdump directory is defined in the s390-tools package.

 * Issue "make image" to build the zfcpdump image with initramfs.
The user space application of zfcpdump can reside in an intitramfs or an
initrd. It can also be included in a built-in kernel initramfs. The application
reads from /proc/vmcore or zcore/mem and writes the system dump to a SCSI disk.

In a Linux distribution the zfcpdump enabled kernel image must be copied to
/usr/share/zfcpdump/zfcpdump.image, where the s390 zipl tool is looking for the
dump kernel when preparing a SCSI dump disk.

If you use a ramdisk copy it to "/usr/share/zfcpdump/zfcpdump.rd".
The s390-tools package version 1.24.0 and above builds an external zfcpdump
initramfs with a user space application that writes the dump to a SCSI
partition.

For more information on how to use zfcpdump refer to the s390 'Using the Dump
Tools book', which is available from
+4 −10
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@ config PCI_QUIRKS

config S390
	def_bool y
	select ARCH_DISCARD_MEMBLOCK
	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
	select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
	select ARCH_HAVE_NMI_SAFE_CMPXCHG
@@ -130,6 +129,7 @@ config S390
	select HAVE_KVM if 64BIT
	select HAVE_MEMBLOCK
	select HAVE_MEMBLOCK_NODE_MAP
	select HAVE_MEMBLOCK_PHYS_MAP
	select HAVE_MOD_ARCH_SPECIFIC
	select HAVE_OPROFILE
	select HAVE_PERF_EVENTS
@@ -139,6 +139,7 @@ config S390
	select HAVE_VIRT_CPU_ACCOUNTING
	select KTIME_SCALAR if 32BIT
	select MODULES_USE_ELF_RELA
	select NO_BOOTMEM
	select OLD_SIGACTION
	select OLD_SIGSUSPEND3
	select SYSCTL_EXCEPTION_TRACE
@@ -592,21 +593,14 @@ config CRASH_DUMP
	bool "kernel crash dumps"
	depends on 64BIT && SMP
	select KEXEC
	select ZFCPDUMP
	help
	  Generate crash dump after being started by kexec.
	  Crash dump kernels are loaded in the main kernel with kexec-tools
	  into a specially reserved region and then later executed after
	  a crash by kdump/kexec.
	  For more details see Documentation/kdump/kdump.txt

config ZFCPDUMP
	def_bool n
	prompt "zfcpdump support"
	depends on 64BIT && SMP
	help
	  Select this option if you want to build an zfcpdump enabled kernel.
	  Refer to <file:Documentation/s390/zfcpdump.txt> for more details on this.
	  This option also enables s390 zfcpdump.
	  See also <file:Documentation/s390/zfcpdump.txt>

endmenu

+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include <linux/kernel_stat.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
#include <linux/slab.h>
#include <asm/io.h>

#include "appldata.h"
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ targets += misc.o piggy.o sizes.h head$(BITS).o

KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
KBUILD_CFLAGS += $(cflags-y)
KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks
KBUILD_CFLAGS += $(call cc-option,-mpacked-stack)
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)

+1 −1
Original line number Diff line number Diff line
@@ -229,5 +229,5 @@ int ccw_device_siosl(struct ccw_device *);

extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *);

extern void *ccw_device_get_chp_desc(struct ccw_device *, int);
struct channel_path_desc *ccw_device_get_chp_desc(struct ccw_device *, int);
#endif /* _S390_CCWDEV_H_ */
Loading