zcore.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. /*
  2. * zcore module to export memory content and register sets for creating system
  3. * dumps on SCSI disks (zfcpdump). The "zcore/mem" debugfs file shows the same
  4. * dump format as s390 standalone dumps.
  5. *
  6. * For more information please refer to Documentation/s390/zfcpdump.txt
  7. *
  8. * Copyright IBM Corp. 2003,2007
  9. * Author(s): Michael Holzheu
  10. */
  11. #include <linux/init.h>
  12. #include <linux/miscdevice.h>
  13. #include <linux/utsname.h>
  14. #include <linux/debugfs.h>
  15. #include <asm/ipl.h>
  16. #include <asm/sclp.h>
  17. #include <asm/setup.h>
  18. #include <asm/sigp.h>
  19. #include <asm/uaccess.h>
  20. #include <asm/debug.h>
  21. #include <asm/processor.h>
  22. #include <asm/irqflags.h>
  23. #include "sclp.h"
  24. #define TRACE(x...) debug_sprintf_event(zcore_dbf, 1, x)
  25. #define MSG(x...) printk( KERN_ALERT x )
  26. #define ERROR_MSG(x...) printk ( KERN_ALERT "DUMP: " x )
  27. #define TO_USER 0
  28. #define TO_KERNEL 1
  29. enum arch_id {
  30. ARCH_S390 = 0,
  31. ARCH_S390X = 1,
  32. };
  33. /* dump system info */
  34. struct sys_info {
  35. enum arch_id arch;
  36. unsigned long sa_base;
  37. u32 sa_size;
  38. int cpu_map[NR_CPUS];
  39. unsigned long mem_size;
  40. union save_area lc_mask;
  41. };
  42. static struct sys_info sys_info;
  43. static struct debug_info *zcore_dbf;
  44. static int hsa_available;
  45. static struct dentry *zcore_dir;
  46. static struct dentry *zcore_file;
  47. /*
  48. * Copy memory from HSA to kernel or user memory (not reentrant):
  49. *
  50. * @dest: Kernel or user buffer where memory should be copied to
  51. * @src: Start address within HSA where data should be copied
  52. * @count: Size of buffer, which should be copied
  53. * @mode: Either TO_KERNEL or TO_USER
  54. */
  55. static int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode)
  56. {
  57. int offs, blk_num;
  58. static char buf[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
  59. if (count == 0)
  60. return 0;
  61. /* copy first block */
  62. offs = 0;
  63. if ((src % PAGE_SIZE) != 0) {
  64. blk_num = src / PAGE_SIZE + 2;
  65. if (sclp_sdias_copy(buf, blk_num, 1)) {
  66. TRACE("sclp_sdias_copy() failed\n");
  67. return -EIO;
  68. }
  69. offs = min((PAGE_SIZE - (src % PAGE_SIZE)), count);
  70. if (mode == TO_USER) {
  71. if (copy_to_user((__force __user void*) dest,
  72. buf + (src % PAGE_SIZE), offs))
  73. return -EFAULT;
  74. } else
  75. memcpy(dest, buf + (src % PAGE_SIZE), offs);
  76. }
  77. if (offs == count)
  78. goto out;
  79. /* copy middle */
  80. for (; (offs + PAGE_SIZE) <= count; offs += PAGE_SIZE) {
  81. blk_num = (src + offs) / PAGE_SIZE + 2;
  82. if (sclp_sdias_copy(buf, blk_num, 1)) {
  83. TRACE("sclp_sdias_copy() failed\n");
  84. return -EIO;
  85. }
  86. if (mode == TO_USER) {
  87. if (copy_to_user((__force __user void*) dest + offs,
  88. buf, PAGE_SIZE))
  89. return -EFAULT;
  90. } else
  91. memcpy(dest + offs, buf, PAGE_SIZE);
  92. }
  93. if (offs == count)
  94. goto out;
  95. /* copy last block */
  96. blk_num = (src + offs) / PAGE_SIZE + 2;
  97. if (sclp_sdias_copy(buf, blk_num, 1)) {
  98. TRACE("sclp_sdias_copy() failed\n");
  99. return -EIO;
  100. }
  101. if (mode == TO_USER) {
  102. if (copy_to_user((__force __user void*) dest + offs, buf,
  103. PAGE_SIZE))
  104. return -EFAULT;
  105. } else
  106. memcpy(dest + offs, buf, count - offs);
  107. out:
  108. return 0;
  109. }
  110. static int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count)
  111. {
  112. return memcpy_hsa((void __force *) dest, src, count, TO_USER);
  113. }
  114. static int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count)
  115. {
  116. return memcpy_hsa(dest, src, count, TO_KERNEL);
  117. }
  118. static int memcpy_real(void *dest, unsigned long src, size_t count)
  119. {
  120. unsigned long flags;
  121. int rc = -EFAULT;
  122. register unsigned long _dest asm("2") = (unsigned long) dest;
  123. register unsigned long _len1 asm("3") = (unsigned long) count;
  124. register unsigned long _src asm("4") = src;
  125. register unsigned long _len2 asm("5") = (unsigned long) count;
  126. if (count == 0)
  127. return 0;
  128. flags = __raw_local_irq_stnsm(0xf8); /* switch to real mode */
  129. asm volatile (
  130. "0: mvcle %1,%2,0x0\n"
  131. "1: jo 0b\n"
  132. " lhi %0,0x0\n"
  133. "2:\n"
  134. EX_TABLE(1b,2b)
  135. : "+d" (rc)
  136. : "d" (_dest), "d" (_src), "d" (_len1), "d" (_len2)
  137. : "cc", "memory");
  138. __raw_local_irq_ssm(flags);
  139. return rc;
  140. }
  141. static int memcpy_real_user(__user void *dest, unsigned long src, size_t count)
  142. {
  143. static char buf[4096];
  144. int offs = 0, size;
  145. while (offs < count) {
  146. size = min(sizeof(buf), count - offs);
  147. if (memcpy_real(buf, src + offs, size))
  148. return -EFAULT;
  149. if (copy_to_user(dest + offs, buf, size))
  150. return -EFAULT;
  151. offs += size;
  152. }
  153. return 0;
  154. }
  155. #ifdef __s390x__
  156. /*
  157. * Convert s390x (64 bit) cpu info to s390 (32 bit) cpu info
  158. */
  159. static void __init s390x_to_s390_regs(union save_area *out, union save_area *in,
  160. int cpu)
  161. {
  162. int i;
  163. for (i = 0; i < 16; i++) {
  164. out->s390.gp_regs[i] = in->s390x.gp_regs[i] & 0x00000000ffffffff;
  165. out->s390.acc_regs[i] = in->s390x.acc_regs[i];
  166. out->s390.ctrl_regs[i] =
  167. in->s390x.ctrl_regs[i] & 0x00000000ffffffff;
  168. }
  169. /* locore for 31 bit has only space for fpregs 0,2,4,6 */
  170. out->s390.fp_regs[0] = in->s390x.fp_regs[0];
  171. out->s390.fp_regs[1] = in->s390x.fp_regs[2];
  172. out->s390.fp_regs[2] = in->s390x.fp_regs[4];
  173. out->s390.fp_regs[3] = in->s390x.fp_regs[6];
  174. memcpy(&(out->s390.psw[0]), &(in->s390x.psw[0]), 4);
  175. out->s390.psw[1] |= 0x8; /* set bit 12 */
  176. memcpy(&(out->s390.psw[4]),&(in->s390x.psw[12]), 4);
  177. out->s390.psw[4] |= 0x80; /* set (31bit) addressing bit */
  178. out->s390.pref_reg = in->s390x.pref_reg;
  179. out->s390.timer = in->s390x.timer;
  180. out->s390.clk_cmp = in->s390x.clk_cmp;
  181. }
  182. static void __init s390x_to_s390_save_areas(void)
  183. {
  184. int i = 1;
  185. static union save_area tmp;
  186. while (zfcpdump_save_areas[i]) {
  187. s390x_to_s390_regs(&tmp, zfcpdump_save_areas[i], i);
  188. memcpy(zfcpdump_save_areas[i], &tmp, sizeof(tmp));
  189. i++;
  190. }
  191. }
  192. #endif /* __s390x__ */
  193. static int __init init_cpu_info(enum arch_id arch)
  194. {
  195. union save_area *sa;
  196. /* get info for boot cpu from lowcore, stored in the HSA */
  197. sa = kmalloc(sizeof(*sa), GFP_KERNEL);
  198. if (!sa) {
  199. ERROR_MSG("kmalloc failed: %s: %i\n",__FUNCTION__, __LINE__);
  200. return -ENOMEM;
  201. }
  202. if (memcpy_hsa_kernel(sa, sys_info.sa_base, sys_info.sa_size) < 0) {
  203. ERROR_MSG("could not copy from HSA\n");
  204. kfree(sa);
  205. return -EIO;
  206. }
  207. zfcpdump_save_areas[0] = sa;
  208. #ifdef __s390x__
  209. /* convert s390x regs to s390, if we are dumping an s390 Linux */
  210. if (arch == ARCH_S390)
  211. s390x_to_s390_save_areas();
  212. #endif
  213. return 0;
  214. }
  215. static DEFINE_MUTEX(zcore_mutex);
  216. #define DUMP_VERSION 0x3
  217. #define DUMP_MAGIC 0xa8190173618f23fdULL
  218. #define DUMP_ARCH_S390X 2
  219. #define DUMP_ARCH_S390 1
  220. #define HEADER_SIZE 4096
  221. /* dump header dumped according to s390 crash dump format */
  222. struct zcore_header {
  223. u64 magic;
  224. u32 version;
  225. u32 header_size;
  226. u32 dump_level;
  227. u32 page_size;
  228. u64 mem_size;
  229. u64 mem_start;
  230. u64 mem_end;
  231. u32 num_pages;
  232. u32 pad1;
  233. u64 tod;
  234. cpuid_t cpu_id;
  235. u32 arch_id;
  236. u32 build_arch;
  237. char pad2[4016];
  238. } __attribute__((packed,__aligned__(16)));
  239. static struct zcore_header zcore_header = {
  240. .magic = DUMP_MAGIC,
  241. .version = DUMP_VERSION,
  242. .header_size = 4096,
  243. .dump_level = 0,
  244. .page_size = PAGE_SIZE,
  245. .mem_start = 0,
  246. #ifdef __s390x__
  247. .build_arch = DUMP_ARCH_S390X,
  248. #else
  249. .build_arch = DUMP_ARCH_S390,
  250. #endif
  251. };
  252. /*
  253. * Copy lowcore info to buffer. Use map in order to copy only register parts.
  254. *
  255. * @buf: User buffer
  256. * @sa: Pointer to save area
  257. * @sa_off: Offset in save area to copy
  258. * @len: Number of bytes to copy
  259. */
  260. static int copy_lc(void __user *buf, void *sa, int sa_off, int len)
  261. {
  262. int i;
  263. char *lc_mask = (char*)&sys_info.lc_mask;
  264. for (i = 0; i < len; i++) {
  265. if (!lc_mask[i + sa_off])
  266. continue;
  267. if (copy_to_user(buf + i, sa + sa_off + i, 1))
  268. return -EFAULT;
  269. }
  270. return 0;
  271. }
  272. /*
  273. * Copy lowcores info to memory, if necessary
  274. *
  275. * @buf: User buffer
  276. * @addr: Start address of buffer in dump memory
  277. * @count: Size of buffer
  278. */
  279. static int zcore_add_lc(char __user *buf, unsigned long start, size_t count)
  280. {
  281. unsigned long end;
  282. int i = 0;
  283. if (count == 0)
  284. return 0;
  285. end = start + count;
  286. while (zfcpdump_save_areas[i]) {
  287. unsigned long cp_start, cp_end; /* copy range */
  288. unsigned long sa_start, sa_end; /* save area range */
  289. unsigned long prefix;
  290. unsigned long sa_off, len, buf_off;
  291. if (sys_info.arch == ARCH_S390)
  292. prefix = zfcpdump_save_areas[i]->s390.pref_reg;
  293. else
  294. prefix = zfcpdump_save_areas[i]->s390x.pref_reg;
  295. sa_start = prefix + sys_info.sa_base;
  296. sa_end = prefix + sys_info.sa_base + sys_info.sa_size;
  297. if ((end < sa_start) || (start > sa_end))
  298. goto next;
  299. cp_start = max(start, sa_start);
  300. cp_end = min(end, sa_end);
  301. buf_off = cp_start - start;
  302. sa_off = cp_start - sa_start;
  303. len = cp_end - cp_start;
  304. TRACE("copy_lc for: %lx\n", start);
  305. if (copy_lc(buf + buf_off, zfcpdump_save_areas[i], sa_off, len))
  306. return -EFAULT;
  307. next:
  308. i++;
  309. }
  310. return 0;
  311. }
  312. /*
  313. * Read routine for zcore character device
  314. * First 4K are dump header
  315. * Next 32MB are HSA Memory
  316. * Rest is read from absolute Memory
  317. */
  318. static ssize_t zcore_read(struct file *file, char __user *buf, size_t count,
  319. loff_t *ppos)
  320. {
  321. unsigned long mem_start; /* Start address in memory */
  322. size_t mem_offs; /* Offset in dump memory */
  323. size_t hdr_count; /* Size of header part of output buffer */
  324. size_t size;
  325. int rc;
  326. mutex_lock(&zcore_mutex);
  327. if (*ppos > (sys_info.mem_size + HEADER_SIZE)) {
  328. rc = -EINVAL;
  329. goto fail;
  330. }
  331. count = min(count, (size_t) (sys_info.mem_size + HEADER_SIZE - *ppos));
  332. /* Copy dump header */
  333. if (*ppos < HEADER_SIZE) {
  334. size = min(count, (size_t) (HEADER_SIZE - *ppos));
  335. if (copy_to_user(buf, &zcore_header + *ppos, size)) {
  336. rc = -EFAULT;
  337. goto fail;
  338. }
  339. hdr_count = size;
  340. mem_start = 0;
  341. } else {
  342. hdr_count = 0;
  343. mem_start = *ppos - HEADER_SIZE;
  344. }
  345. mem_offs = 0;
  346. /* Copy from HSA data */
  347. if (*ppos < (ZFCPDUMP_HSA_SIZE + HEADER_SIZE)) {
  348. size = min((count - hdr_count), (size_t) (ZFCPDUMP_HSA_SIZE
  349. - mem_start));
  350. rc = memcpy_hsa_user(buf + hdr_count, mem_start, size);
  351. if (rc)
  352. goto fail;
  353. mem_offs += size;
  354. }
  355. /* Copy from real mem */
  356. size = count - mem_offs - hdr_count;
  357. rc = memcpy_real_user(buf + hdr_count + mem_offs, mem_start + mem_offs,
  358. size);
  359. if (rc)
  360. goto fail;
  361. /*
  362. * Since s390 dump analysis tools like lcrash or crash
  363. * expect register sets in the prefix pages of the cpus,
  364. * we copy them into the read buffer, if necessary.
  365. * buf + hdr_count: Start of memory part of output buffer
  366. * mem_start: Start memory address to copy from
  367. * count - hdr_count: Size of memory area to copy
  368. */
  369. if (zcore_add_lc(buf + hdr_count, mem_start, count - hdr_count)) {
  370. rc = -EFAULT;
  371. goto fail;
  372. }
  373. *ppos += count;
  374. fail:
  375. mutex_unlock(&zcore_mutex);
  376. return (rc < 0) ? rc : count;
  377. }
  378. static int zcore_open(struct inode *inode, struct file *filp)
  379. {
  380. if (!hsa_available)
  381. return -ENODATA;
  382. else
  383. return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
  384. }
  385. static int zcore_release(struct inode *inode, struct file *filep)
  386. {
  387. diag308(DIAG308_REL_HSA, NULL);
  388. hsa_available = 0;
  389. return 0;
  390. }
  391. static loff_t zcore_lseek(struct file *file, loff_t offset, int orig)
  392. {
  393. loff_t rc;
  394. mutex_lock(&zcore_mutex);
  395. switch (orig) {
  396. case 0:
  397. file->f_pos = offset;
  398. rc = file->f_pos;
  399. break;
  400. case 1:
  401. file->f_pos += offset;
  402. rc = file->f_pos;
  403. break;
  404. default:
  405. rc = -EINVAL;
  406. }
  407. mutex_unlock(&zcore_mutex);
  408. return rc;
  409. }
  410. static struct file_operations zcore_fops = {
  411. .owner = THIS_MODULE,
  412. .llseek = zcore_lseek,
  413. .read = zcore_read,
  414. .open = zcore_open,
  415. .release = zcore_release,
  416. };
  417. static void __init set_s390_lc_mask(union save_area *map)
  418. {
  419. memset(&map->s390.ext_save, 0xff, sizeof(map->s390.ext_save));
  420. memset(&map->s390.timer, 0xff, sizeof(map->s390.timer));
  421. memset(&map->s390.clk_cmp, 0xff, sizeof(map->s390.clk_cmp));
  422. memset(&map->s390.psw, 0xff, sizeof(map->s390.psw));
  423. memset(&map->s390.pref_reg, 0xff, sizeof(map->s390.pref_reg));
  424. memset(&map->s390.acc_regs, 0xff, sizeof(map->s390.acc_regs));
  425. memset(&map->s390.fp_regs, 0xff, sizeof(map->s390.fp_regs));
  426. memset(&map->s390.gp_regs, 0xff, sizeof(map->s390.gp_regs));
  427. memset(&map->s390.ctrl_regs, 0xff, sizeof(map->s390.ctrl_regs));
  428. }
  429. static void __init set_s390x_lc_mask(union save_area *map)
  430. {
  431. memset(&map->s390x.fp_regs, 0xff, sizeof(map->s390x.fp_regs));
  432. memset(&map->s390x.gp_regs, 0xff, sizeof(map->s390x.gp_regs));
  433. memset(&map->s390x.psw, 0xff, sizeof(map->s390x.psw));
  434. memset(&map->s390x.pref_reg, 0xff, sizeof(map->s390x.pref_reg));
  435. memset(&map->s390x.fp_ctrl_reg, 0xff, sizeof(map->s390x.fp_ctrl_reg));
  436. memset(&map->s390x.tod_reg, 0xff, sizeof(map->s390x.tod_reg));
  437. memset(&map->s390x.timer, 0xff, sizeof(map->s390x.timer));
  438. memset(&map->s390x.clk_cmp, 0xff, sizeof(map->s390x.clk_cmp));
  439. memset(&map->s390x.acc_regs, 0xff, sizeof(map->s390x.acc_regs));
  440. memset(&map->s390x.ctrl_regs, 0xff, sizeof(map->s390x.ctrl_regs));
  441. }
  442. /*
  443. * Initialize dump globals for a given architecture
  444. */
  445. static int __init sys_info_init(enum arch_id arch)
  446. {
  447. switch (arch) {
  448. case ARCH_S390X:
  449. MSG("DETECTED 'S390X (64 bit) OS'\n");
  450. sys_info.sa_base = SAVE_AREA_BASE_S390X;
  451. sys_info.sa_size = sizeof(struct save_area_s390x);
  452. set_s390x_lc_mask(&sys_info.lc_mask);
  453. break;
  454. case ARCH_S390:
  455. MSG("DETECTED 'S390 (32 bit) OS'\n");
  456. sys_info.sa_base = SAVE_AREA_BASE_S390;
  457. sys_info.sa_size = sizeof(struct save_area_s390);
  458. set_s390_lc_mask(&sys_info.lc_mask);
  459. break;
  460. default:
  461. ERROR_MSG("unknown architecture 0x%x.\n",arch);
  462. return -EINVAL;
  463. }
  464. sys_info.arch = arch;
  465. if (init_cpu_info(arch)) {
  466. ERROR_MSG("get cpu info failed\n");
  467. return -ENOMEM;
  468. }
  469. sys_info.mem_size = real_memory_size;
  470. return 0;
  471. }
  472. static int __init check_sdias(void)
  473. {
  474. int rc, act_hsa_size;
  475. rc = sclp_sdias_blk_count();
  476. if (rc < 0) {
  477. ERROR_MSG("Could not determine HSA size\n");
  478. return rc;
  479. }
  480. act_hsa_size = (rc - 1) * PAGE_SIZE;
  481. if (act_hsa_size < ZFCPDUMP_HSA_SIZE) {
  482. ERROR_MSG("HSA size too small: %i\n", act_hsa_size);
  483. return -EINVAL;
  484. }
  485. return 0;
  486. }
  487. static void __init zcore_header_init(int arch, struct zcore_header *hdr)
  488. {
  489. if (arch == ARCH_S390X)
  490. hdr->arch_id = DUMP_ARCH_S390X;
  491. else
  492. hdr->arch_id = DUMP_ARCH_S390;
  493. hdr->mem_size = sys_info.mem_size;
  494. hdr->mem_end = sys_info.mem_size;
  495. hdr->num_pages = sys_info.mem_size / PAGE_SIZE;
  496. hdr->tod = get_clock();
  497. get_cpu_id(&hdr->cpu_id);
  498. }
  499. static int __init zcore_init(void)
  500. {
  501. unsigned char arch;
  502. int rc;
  503. if (ipl_info.type != IPL_TYPE_FCP_DUMP)
  504. return -ENODATA;
  505. zcore_dbf = debug_register("zcore", 4, 1, 4 * sizeof(long));
  506. debug_register_view(zcore_dbf, &debug_sprintf_view);
  507. debug_set_level(zcore_dbf, 6);
  508. TRACE("devno: %x\n", ipl_info.data.fcp.dev_id.devno);
  509. TRACE("wwpn: %llx\n", (unsigned long long) ipl_info.data.fcp.wwpn);
  510. TRACE("lun: %llx\n", (unsigned long long) ipl_info.data.fcp.lun);
  511. rc = sclp_sdias_init();
  512. if (rc)
  513. goto fail;
  514. rc = check_sdias();
  515. if (rc) {
  516. ERROR_MSG("Dump initialization failed\n");
  517. goto fail;
  518. }
  519. rc = memcpy_hsa_kernel(&arch, __LC_AR_MODE_ID, 1);
  520. if (rc) {
  521. ERROR_MSG("sdial memcpy for arch id failed\n");
  522. goto fail;
  523. }
  524. #ifndef __s390x__
  525. if (arch == ARCH_S390X) {
  526. ERROR_MSG("32 bit dumper can't dump 64 bit system!\n");
  527. rc = -EINVAL;
  528. goto fail;
  529. }
  530. #endif
  531. rc = sys_info_init(arch);
  532. if (rc) {
  533. ERROR_MSG("arch init failed\n");
  534. goto fail;
  535. }
  536. zcore_header_init(arch, &zcore_header);
  537. zcore_dir = debugfs_create_dir("zcore" , NULL);
  538. if (!zcore_dir) {
  539. rc = -ENOMEM;
  540. goto fail;
  541. }
  542. zcore_file = debugfs_create_file("mem", S_IRUSR, zcore_dir, NULL,
  543. &zcore_fops);
  544. if (!zcore_file) {
  545. debugfs_remove(zcore_dir);
  546. rc = -ENOMEM;
  547. goto fail;
  548. }
  549. hsa_available = 1;
  550. return 0;
  551. fail:
  552. diag308(DIAG308_REL_HSA, NULL);
  553. return rc;
  554. }
  555. static void __exit zcore_exit(void)
  556. {
  557. debug_unregister(zcore_dbf);
  558. sclp_sdias_exit();
  559. diag308(DIAG308_REL_HSA, NULL);
  560. }
  561. MODULE_AUTHOR("Copyright IBM Corp. 2003,2007");
  562. MODULE_DESCRIPTION("zcore module for zfcpdump support");
  563. MODULE_LICENSE("GPL");
  564. subsys_initcall(zcore_init);
  565. module_exit(zcore_exit);