~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/s390/kernel/kexec_image.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 /*
  3  * Image loader for kexec_file_load system call.
  4  *
  5  * Copyright IBM Corp. 2018
  6  *
  7  * Author(s): Philipp Rudo <prudo@linux.vnet.ibm.com>
  8  */
  9 
 10 #include <linux/errno.h>
 11 #include <linux/kernel.h>
 12 #include <linux/kexec.h>
 13 #include <asm/ipl.h>
 14 #include <asm/setup.h>
 15 
 16 static int kexec_file_add_kernel_image(struct kimage *image,
 17                                        struct s390_load_data *data)
 18 {
 19         struct kexec_buf buf;
 20 
 21         buf.image = image;
 22 
 23         buf.buffer = image->kernel_buf;
 24         buf.bufsz = image->kernel_buf_len;
 25 
 26         buf.mem = 0;
 27 #ifdef CONFIG_CRASH_DUMP
 28         if (image->type == KEXEC_TYPE_CRASH)
 29                 buf.mem += crashk_res.start;
 30 #endif
 31         buf.memsz = buf.bufsz;
 32 
 33         data->kernel_buf = image->kernel_buf;
 34         data->kernel_mem = buf.mem;
 35         data->parm = image->kernel_buf + PARMAREA;
 36         data->memsz += buf.memsz;
 37 
 38         ipl_report_add_component(data->report, &buf,
 39                                  IPL_RB_COMPONENT_FLAG_SIGNED |
 40                                  IPL_RB_COMPONENT_FLAG_VERIFIED,
 41                                  IPL_RB_CERT_UNKNOWN);
 42         return kexec_add_buffer(&buf);
 43 }
 44 
 45 static void *s390_image_load(struct kimage *image,
 46                              char *kernel, unsigned long kernel_len,
 47                              char *initrd, unsigned long initrd_len,
 48                              char *cmdline, unsigned long cmdline_len)
 49 {
 50         return kexec_file_add_components(image, kexec_file_add_kernel_image);
 51 }
 52 
 53 static int s390_image_probe(const char *buf, unsigned long len)
 54 {
 55         /* Can't reliably tell if an image is valid.  Therefore give the
 56          * user whatever he wants.
 57          */
 58         return 0;
 59 }
 60 
 61 const struct kexec_file_ops s390_kexec_image_ops = {
 62         .probe = s390_image_probe,
 63         .load = s390_image_load,
 64 #ifdef CONFIG_KEXEC_SIG
 65         .verify_sig = s390_verify_sig,
 66 #endif /* CONFIG_KEXEC_SIG */
 67 };
 68 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php