2017-11-14 18:38:03 +01:00
|
|
|
// SPDX-License-Identifier: GPL-1.0+
|
2007-04-27 16:01:49 +02:00
|
|
|
/*
|
|
|
|
* zcore module to export memory content and register sets for creating system
|
2020-09-29 20:24:55 +02:00
|
|
|
* dumps on SCSI/NVMe disks (zfcp/nvme dump).
|
2007-04-27 16:01:49 +02:00
|
|
|
*
|
2023-07-18 07:55:02 +03:00
|
|
|
* For more information please refer to Documentation/arch/s390/zfcpdump.rst
|
2007-04-27 16:01:49 +02:00
|
|
|
*
|
2012-07-20 11:15:04 +02:00
|
|
|
* Copyright IBM Corp. 2003, 2008
|
2007-04-27 16:01:49 +02:00
|
|
|
* Author(s): Michael Holzheu
|
|
|
|
*/
|
|
|
|
|
2008-12-25 13:39:51 +01:00
|
|
|
#define KMSG_COMPONENT "zdump"
|
|
|
|
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
|
|
|
|
|
2007-04-27 16:01:49 +02:00
|
|
|
#include <linux/init.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 17:04:11 +09:00
|
|
|
#include <linux/slab.h>
|
2007-04-27 16:01:49 +02:00
|
|
|
#include <linux/debugfs.h>
|
2021-06-30 18:54:59 -07:00
|
|
|
#include <linux/panic_notifier.h>
|
2021-02-25 14:28:52 +01:00
|
|
|
#include <linux/reboot.h>
|
2022-07-19 07:16:36 +02:00
|
|
|
#include <linux/uio.h>
|
2014-01-29 18:16:01 +01:00
|
|
|
|
2010-02-26 22:37:43 +01:00
|
|
|
#include <asm/asm-offsets.h>
|
2007-04-27 16:01:49 +02:00
|
|
|
#include <asm/ipl.h>
|
|
|
|
#include <asm/sclp.h>
|
|
|
|
#include <asm/setup.h>
|
2016-12-24 11:46:01 -08:00
|
|
|
#include <linux/uaccess.h>
|
2007-04-27 16:01:49 +02:00
|
|
|
#include <asm/debug.h>
|
|
|
|
#include <asm/processor.h>
|
|
|
|
#include <asm/irqflags.h>
|
2009-03-26 15:24:45 +01:00
|
|
|
#include <asm/checksum.h>
|
2015-10-15 11:14:19 +02:00
|
|
|
#include <asm/os_info.h>
|
2022-07-24 15:02:16 +02:00
|
|
|
#include <asm/maccess.h>
|
2007-05-10 15:45:46 +02:00
|
|
|
#include "sclp.h"
|
2007-04-27 16:01:49 +02:00
|
|
|
|
|
|
|
#define TRACE(x...) debug_sprintf_event(zcore_dbf, 1, x)
|
|
|
|
|
|
|
|
enum arch_id {
|
|
|
|
ARCH_S390 = 0,
|
|
|
|
ARCH_S390X = 1,
|
|
|
|
};
|
|
|
|
|
2009-03-26 15:23:43 +01:00
|
|
|
struct ipib_info {
|
|
|
|
unsigned long ipib;
|
|
|
|
u32 checksum;
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
2007-04-27 16:01:49 +02:00
|
|
|
static struct debug_info *zcore_dbf;
|
|
|
|
static int hsa_available;
|
|
|
|
static struct dentry *zcore_dir;
|
2009-03-26 15:23:43 +01:00
|
|
|
static struct dentry *zcore_reipl_file;
|
2013-01-21 18:37:41 +01:00
|
|
|
static struct dentry *zcore_hsa_file;
|
2019-03-14 13:50:32 +01:00
|
|
|
static struct ipl_parameter_block *zcore_ipl_block;
|
2023-05-09 17:38:15 +02:00
|
|
|
static unsigned long os_info_flags;
|
2007-04-27 16:01:49 +02:00
|
|
|
|
2022-07-19 07:16:33 +02:00
|
|
|
static DEFINE_MUTEX(hsa_buf_mutex);
|
2015-10-12 10:51:54 +02:00
|
|
|
static char hsa_buf[PAGE_SIZE] __aligned(PAGE_SIZE);
|
|
|
|
|
2007-04-27 16:01:49 +02:00
|
|
|
/*
|
2022-07-19 07:16:36 +02:00
|
|
|
* Copy memory from HSA to iterator (not reentrant):
|
2007-04-27 16:01:49 +02:00
|
|
|
*
|
2022-07-19 07:16:36 +02:00
|
|
|
* @iter: Iterator where memory should be copied to
|
2007-04-27 16:01:49 +02:00
|
|
|
* @src: Start address within HSA where data should be copied
|
|
|
|
* @count: Size of buffer, which should be copied
|
|
|
|
*/
|
2022-07-19 07:16:36 +02:00
|
|
|
size_t memcpy_hsa_iter(struct iov_iter *iter, unsigned long src, size_t count)
|
2007-04-27 16:01:49 +02:00
|
|
|
{
|
2022-07-19 07:16:36 +02:00
|
|
|
size_t bytes, copied, res = 0;
|
|
|
|
unsigned long offset;
|
2007-04-27 16:01:49 +02:00
|
|
|
|
2013-01-21 18:37:41 +01:00
|
|
|
if (!hsa_available)
|
2022-07-19 07:16:36 +02:00
|
|
|
return 0;
|
2007-04-27 16:01:49 +02:00
|
|
|
|
2022-07-19 07:16:33 +02:00
|
|
|
mutex_lock(&hsa_buf_mutex);
|
2015-10-12 10:51:54 +02:00
|
|
|
while (count) {
|
|
|
|
if (sclp_sdias_copy(hsa_buf, src / PAGE_SIZE + 2, 1)) {
|
2007-04-27 16:01:49 +02:00
|
|
|
TRACE("sclp_sdias_copy() failed\n");
|
2022-07-19 07:16:36 +02:00
|
|
|
break;
|
2007-04-27 16:01:49 +02:00
|
|
|
}
|
2015-10-12 10:51:54 +02:00
|
|
|
offset = src % PAGE_SIZE;
|
|
|
|
bytes = min(PAGE_SIZE - offset, count);
|
2022-07-19 07:16:36 +02:00
|
|
|
copied = copy_to_iter(hsa_buf + offset, bytes, iter);
|
|
|
|
count -= copied;
|
|
|
|
src += copied;
|
|
|
|
res += copied;
|
|
|
|
if (copied < bytes)
|
|
|
|
break;
|
2015-10-12 10:51:54 +02:00
|
|
|
}
|
2022-07-19 07:16:33 +02:00
|
|
|
mutex_unlock(&hsa_buf_mutex);
|
2022-07-19 07:16:36 +02:00
|
|
|
return res;
|
2007-04-27 16:01:49 +02:00
|
|
|
}
|
|
|
|
|
2015-10-12 10:43:37 +02:00
|
|
|
/*
|
|
|
|
* Copy memory from HSA to kernel memory (not reentrant):
|
|
|
|
*
|
|
|
|
* @dest: Kernel or user buffer where memory should be copied to
|
|
|
|
* @src: Start address within HSA where data should be copied
|
|
|
|
* @count: Size of buffer, which should be copied
|
|
|
|
*/
|
2022-07-19 07:16:36 +02:00
|
|
|
static inline int memcpy_hsa_kernel(void *dst, unsigned long src, size_t count)
|
2007-04-27 16:01:49 +02:00
|
|
|
{
|
2022-07-19 07:16:36 +02:00
|
|
|
struct iov_iter iter;
|
|
|
|
struct kvec kvec;
|
|
|
|
|
|
|
|
kvec.iov_base = dst;
|
|
|
|
kvec.iov_len = count;
|
2022-09-15 20:25:47 -04:00
|
|
|
iov_iter_kvec(&iter, ITER_DEST, &kvec, 1, count);
|
2022-07-19 07:16:36 +02:00
|
|
|
if (memcpy_hsa_iter(&iter, src, count) < count)
|
|
|
|
return -EIO;
|
2015-10-12 10:51:54 +02:00
|
|
|
return 0;
|
2007-04-27 16:01:49 +02:00
|
|
|
}
|
|
|
|
|
2015-10-28 09:47:58 +01:00
|
|
|
static int __init init_cpu_info(void)
|
2007-04-27 16:01:49 +02:00
|
|
|
{
|
2015-10-29 10:59:15 +01:00
|
|
|
struct save_area *sa;
|
2007-04-27 16:01:49 +02:00
|
|
|
|
|
|
|
/* get info for boot cpu from lowcore, stored in the HSA */
|
2015-10-29 10:59:15 +01:00
|
|
|
sa = save_area_boot_cpu();
|
|
|
|
if (!sa)
|
2007-04-27 16:01:49 +02:00
|
|
|
return -ENOMEM;
|
2015-10-29 10:59:15 +01:00
|
|
|
if (memcpy_hsa_kernel(hsa_buf, __LC_FPREGS_SAVE_AREA, 512) < 0) {
|
2008-07-14 09:59:38 +02:00
|
|
|
TRACE("could not copy from HSA\n");
|
2007-04-27 16:01:49 +02:00
|
|
|
return -EIO;
|
|
|
|
}
|
2015-10-29 10:59:15 +01:00
|
|
|
save_area_add_regs(sa, hsa_buf); /* vx registers are saved in smp.c */
|
2007-04-27 16:01:49 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-01-21 18:37:41 +01:00
|
|
|
/*
|
|
|
|
* Release the HSA
|
|
|
|
*/
|
|
|
|
static void release_hsa(void)
|
|
|
|
{
|
|
|
|
diag308(DIAG308_REL_HSA, NULL);
|
|
|
|
hsa_available = 0;
|
|
|
|
}
|
|
|
|
|
2009-03-26 15:23:43 +01:00
|
|
|
static ssize_t zcore_reipl_write(struct file *filp, const char __user *buf,
|
|
|
|
size_t count, loff_t *ppos)
|
|
|
|
{
|
2019-03-14 13:50:32 +01:00
|
|
|
if (zcore_ipl_block) {
|
|
|
|
diag308(DIAG308_SET, zcore_ipl_block);
|
2023-05-09 17:38:15 +02:00
|
|
|
if (os_info_flags & OS_INFO_FLAG_REIPL_CLEAR)
|
|
|
|
diag308(DIAG308_LOAD_CLEAR, NULL);
|
|
|
|
/* Use special diag308 subcode for CCW normal ipl */
|
|
|
|
if (zcore_ipl_block->pb0_hdr.pbt == IPL_PBT_CCW)
|
|
|
|
diag308(DIAG308_LOAD_NORMAL_DUMP, NULL);
|
|
|
|
else
|
|
|
|
diag308(DIAG308_LOAD_NORMAL, NULL);
|
2009-03-26 15:23:43 +01:00
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int zcore_reipl_open(struct inode *inode, struct file *filp)
|
|
|
|
{
|
2019-03-26 23:51:19 +03:00
|
|
|
return stream_open(inode, filp);
|
2009-03-26 15:23:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int zcore_reipl_release(struct inode *inode, struct file *filp)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct file_operations zcore_reipl_fops = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.write = zcore_reipl_write,
|
|
|
|
.open = zcore_reipl_open,
|
|
|
|
.release = zcore_reipl_release,
|
|
|
|
};
|
|
|
|
|
2013-01-21 18:37:41 +01:00
|
|
|
static ssize_t zcore_hsa_read(struct file *filp, char __user *buf,
|
|
|
|
size_t count, loff_t *ppos)
|
|
|
|
{
|
|
|
|
static char str[18];
|
|
|
|
|
|
|
|
if (hsa_available)
|
2015-05-06 13:18:59 +02:00
|
|
|
snprintf(str, sizeof(str), "%lx\n", sclp.hsa_size);
|
2013-01-21 18:37:41 +01:00
|
|
|
else
|
|
|
|
snprintf(str, sizeof(str), "0\n");
|
|
|
|
return simple_read_from_buffer(buf, count, ppos, str, strlen(str));
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t zcore_hsa_write(struct file *filp, const char __user *buf,
|
|
|
|
size_t count, loff_t *ppos)
|
|
|
|
{
|
|
|
|
char value;
|
|
|
|
|
|
|
|
if (*ppos != 0)
|
|
|
|
return -EPIPE;
|
|
|
|
if (copy_from_user(&value, buf, 1))
|
|
|
|
return -EFAULT;
|
|
|
|
if (value != '0')
|
|
|
|
return -EINVAL;
|
|
|
|
release_hsa();
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct file_operations zcore_hsa_fops = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.write = zcore_hsa_write,
|
|
|
|
.read = zcore_hsa_read,
|
|
|
|
.open = nonseekable_open,
|
|
|
|
};
|
|
|
|
|
2007-04-27 16:01:49 +02:00
|
|
|
static int __init check_sdias(void)
|
|
|
|
{
|
2015-05-06 13:18:59 +02:00
|
|
|
if (!sclp.hsa_size) {
|
2008-07-14 09:59:38 +02:00
|
|
|
TRACE("Could not determine HSA size\n");
|
2013-11-13 10:38:27 +01:00
|
|
|
return -ENODEV;
|
2007-04-27 16:01:49 +02:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-03-26 15:23:43 +01:00
|
|
|
/*
|
|
|
|
* Provide IPL parameter information block from either HSA or memory
|
|
|
|
* for future reipl
|
|
|
|
*/
|
|
|
|
static int __init zcore_reipl_init(void)
|
|
|
|
{
|
2023-05-09 17:38:15 +02:00
|
|
|
struct os_info_entry *entry;
|
2009-03-26 15:23:43 +01:00
|
|
|
struct ipib_info ipib_info;
|
2023-05-09 17:38:15 +02:00
|
|
|
unsigned long os_info_addr;
|
|
|
|
struct os_info *os_info;
|
2009-03-26 15:23:43 +01:00
|
|
|
int rc;
|
|
|
|
|
|
|
|
rc = memcpy_hsa_kernel(&ipib_info, __LC_DUMP_REIPL, sizeof(ipib_info));
|
|
|
|
if (rc)
|
|
|
|
return rc;
|
|
|
|
if (ipib_info.ipib == 0)
|
|
|
|
return 0;
|
2019-03-14 13:50:32 +01:00
|
|
|
zcore_ipl_block = (void *) __get_free_page(GFP_KERNEL);
|
|
|
|
if (!zcore_ipl_block)
|
2009-03-26 15:23:43 +01:00
|
|
|
return -ENOMEM;
|
2015-05-06 13:18:59 +02:00
|
|
|
if (ipib_info.ipib < sclp.hsa_size)
|
2019-03-14 13:50:32 +01:00
|
|
|
rc = memcpy_hsa_kernel(zcore_ipl_block, ipib_info.ipib,
|
|
|
|
PAGE_SIZE);
|
2009-03-26 15:23:43 +01:00
|
|
|
else
|
2022-01-29 09:24:50 +01:00
|
|
|
rc = memcpy_real(zcore_ipl_block, ipib_info.ipib, PAGE_SIZE);
|
2019-03-14 13:50:32 +01:00
|
|
|
if (rc || (__force u32)csum_partial(zcore_ipl_block, zcore_ipl_block->hdr.len, 0) !=
|
2009-03-26 15:24:45 +01:00
|
|
|
ipib_info.checksum) {
|
2009-03-26 15:23:43 +01:00
|
|
|
TRACE("Checksum does not match\n");
|
2019-03-14 13:50:32 +01:00
|
|
|
free_page((unsigned long) zcore_ipl_block);
|
|
|
|
zcore_ipl_block = NULL;
|
2009-03-26 15:23:43 +01:00
|
|
|
}
|
2023-05-09 17:38:15 +02:00
|
|
|
/*
|
|
|
|
* Read the bit-flags field from os_info flags entry.
|
|
|
|
* Return zero even for os_info read or entry checksum errors in order
|
|
|
|
* to continue dump processing, considering that os_info could be
|
|
|
|
* corrupted on the panicked system.
|
|
|
|
*/
|
|
|
|
os_info = (void *)__get_free_page(GFP_KERNEL);
|
|
|
|
if (!os_info)
|
|
|
|
return -ENOMEM;
|
|
|
|
rc = memcpy_hsa_kernel(&os_info_addr, __LC_OS_INFO, sizeof(os_info_addr));
|
|
|
|
if (rc)
|
|
|
|
goto out;
|
|
|
|
if (os_info_addr < sclp.hsa_size)
|
|
|
|
rc = memcpy_hsa_kernel(os_info, os_info_addr, PAGE_SIZE);
|
|
|
|
else
|
|
|
|
rc = memcpy_real(os_info, os_info_addr, PAGE_SIZE);
|
|
|
|
if (rc || os_info_csum(os_info) != os_info->csum)
|
|
|
|
goto out;
|
|
|
|
entry = &os_info->entry[OS_INFO_FLAGS_ENTRY];
|
|
|
|
if (entry->addr && entry->size) {
|
|
|
|
if (entry->addr < sclp.hsa_size)
|
|
|
|
rc = memcpy_hsa_kernel(&os_info_flags, entry->addr, sizeof(os_info_flags));
|
|
|
|
else
|
|
|
|
rc = memcpy_real(&os_info_flags, entry->addr, sizeof(os_info_flags));
|
|
|
|
if (rc || (__force u32)csum_partial(&os_info_flags, entry->size, 0) != entry->csum)
|
|
|
|
os_info_flags = 0;
|
|
|
|
}
|
|
|
|
out:
|
|
|
|
free_page((unsigned long)os_info);
|
2009-03-26 15:23:43 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-02-25 14:28:52 +01:00
|
|
|
static int zcore_reboot_and_on_panic_handler(struct notifier_block *self,
|
|
|
|
unsigned long event,
|
|
|
|
void *data)
|
|
|
|
{
|
|
|
|
if (hsa_available)
|
|
|
|
release_hsa();
|
|
|
|
|
|
|
|
return NOTIFY_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct notifier_block zcore_reboot_notifier = {
|
|
|
|
.notifier_call = zcore_reboot_and_on_panic_handler,
|
|
|
|
/* we need to be notified before reipl and kdump */
|
|
|
|
.priority = INT_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct notifier_block zcore_on_panic_notifier = {
|
|
|
|
.notifier_call = zcore_reboot_and_on_panic_handler,
|
|
|
|
/* we need to be notified before reipl and kdump */
|
|
|
|
.priority = INT_MAX,
|
|
|
|
};
|
|
|
|
|
2007-04-27 16:01:49 +02:00
|
|
|
static int __init zcore_init(void)
|
|
|
|
{
|
|
|
|
unsigned char arch;
|
|
|
|
int rc;
|
|
|
|
|
2020-09-29 20:24:55 +02:00
|
|
|
if (!is_ipl_type_dump())
|
2007-04-27 16:01:49 +02:00
|
|
|
return -ENODATA;
|
2021-06-15 14:25:41 +02:00
|
|
|
if (oldmem_data.start)
|
2011-11-14 11:19:05 +01:00
|
|
|
return -ENODATA;
|
2007-04-27 16:01:49 +02:00
|
|
|
|
|
|
|
zcore_dbf = debug_register("zcore", 4, 1, 4 * sizeof(long));
|
|
|
|
debug_register_view(zcore_dbf, &debug_sprintf_view);
|
|
|
|
debug_set_level(zcore_dbf, 6);
|
|
|
|
|
2020-09-29 20:24:55 +02:00
|
|
|
if (ipl_info.type == IPL_TYPE_FCP_DUMP) {
|
|
|
|
TRACE("type: fcp\n");
|
|
|
|
TRACE("devno: %x\n", ipl_info.data.fcp.dev_id.devno);
|
|
|
|
TRACE("wwpn: %llx\n", (unsigned long long) ipl_info.data.fcp.wwpn);
|
|
|
|
TRACE("lun: %llx\n", (unsigned long long) ipl_info.data.fcp.lun);
|
|
|
|
} else if (ipl_info.type == IPL_TYPE_NVME_DUMP) {
|
|
|
|
TRACE("type: nvme\n");
|
|
|
|
TRACE("fid: %x\n", ipl_info.data.nvme.fid);
|
|
|
|
TRACE("nsid: %x\n", ipl_info.data.nvme.nsid);
|
2022-10-05 10:17:41 +02:00
|
|
|
} else if (ipl_info.type == IPL_TYPE_ECKD_DUMP) {
|
|
|
|
TRACE("type: eckd\n");
|
|
|
|
TRACE("devno: %x\n", ipl_info.data.eckd.dev_id.devno);
|
|
|
|
TRACE("ssid: %x\n", ipl_info.data.eckd.dev_id.ssid);
|
2020-09-29 20:24:55 +02:00
|
|
|
}
|
2007-04-27 16:01:49 +02:00
|
|
|
|
2007-05-10 15:45:46 +02:00
|
|
|
rc = sclp_sdias_init();
|
2007-04-27 16:01:49 +02:00
|
|
|
if (rc)
|
|
|
|
goto fail;
|
|
|
|
|
|
|
|
rc = check_sdias();
|
2008-07-14 09:59:38 +02:00
|
|
|
if (rc)
|
2007-04-27 16:01:49 +02:00
|
|
|
goto fail;
|
2013-01-21 18:37:41 +01:00
|
|
|
hsa_available = 1;
|
2007-04-27 16:01:49 +02:00
|
|
|
|
|
|
|
rc = memcpy_hsa_kernel(&arch, __LC_AR_MODE_ID, 1);
|
2008-07-14 09:59:38 +02:00
|
|
|
if (rc)
|
2007-04-27 16:01:49 +02:00
|
|
|
goto fail;
|
|
|
|
|
2010-02-26 22:37:32 +01:00
|
|
|
if (arch == ARCH_S390) {
|
|
|
|
pr_alert("The 64-bit dump tool cannot be used for a "
|
|
|
|
"32-bit system\n");
|
|
|
|
rc = -EINVAL;
|
|
|
|
goto fail;
|
|
|
|
}
|
2007-04-27 16:01:49 +02:00
|
|
|
|
2016-11-14 18:51:41 +01:00
|
|
|
pr_alert("The dump process started for a 64-bit operating system\n");
|
2015-10-28 09:47:58 +01:00
|
|
|
rc = init_cpu_info();
|
2008-07-14 09:59:38 +02:00
|
|
|
if (rc)
|
2007-04-27 16:01:49 +02:00
|
|
|
goto fail;
|
|
|
|
|
2009-03-26 15:23:43 +01:00
|
|
|
rc = zcore_reipl_init();
|
|
|
|
if (rc)
|
|
|
|
goto fail;
|
|
|
|
|
2007-04-27 16:01:49 +02:00
|
|
|
zcore_dir = debugfs_create_dir("zcore" , NULL);
|
2009-03-26 15:23:43 +01:00
|
|
|
zcore_reipl_file = debugfs_create_file("reipl", S_IRUSR, zcore_dir,
|
|
|
|
NULL, &zcore_reipl_fops);
|
2013-01-21 18:37:41 +01:00
|
|
|
zcore_hsa_file = debugfs_create_file("hsa", S_IRUSR|S_IWUSR, zcore_dir,
|
|
|
|
NULL, &zcore_hsa_fops);
|
2007-04-27 16:01:49 +02:00
|
|
|
|
2021-02-25 14:28:52 +01:00
|
|
|
register_reboot_notifier(&zcore_reboot_notifier);
|
|
|
|
atomic_notifier_chain_register(&panic_notifier_list, &zcore_on_panic_notifier);
|
|
|
|
|
2021-02-26 11:21:05 +01:00
|
|
|
return 0;
|
2007-04-27 16:01:49 +02:00
|
|
|
fail:
|
|
|
|
diag308(DIAG308_REL_HSA, NULL);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
subsys_initcall(zcore_init);
|