public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
	mtk.manpages@gmail.com
Cc: mjg59@srcf.ucam.org, bhe@redhat.com, greg@kroah.com,
	bp@alien8.de, ebiederm@xmission.com, hpa@zytor.com,
	akpm@linux-foundation.org, linux-api@vger.kernel.org,
	dyoung@redhat.com, chaowang@redhat.com
Subject: Re: [PATCH 08/15] kexec: New syscall kexec_file_load() declaration
Date: Thu, 26 Jun 2014 16:43:03 -0400	[thread overview]
Message-ID: <20140626204303.GE11136@redhat.com> (raw)
In-Reply-To: <1403814824-7587-9-git-send-email-vgoyal@redhat.com>

On Thu, Jun 26, 2014 at 04:33:37PM -0400, Vivek Goyal wrote:
> This is the new syscall kexec_file_load() declaration/interface. I have
> reserved the syscall number only for x86_64 so far. Other architectures
> (including i386) can reserve syscall number when they enable the support
> for this new syscall.
> 
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> CC: linux-api@vger.kernel.org

Hi Michael,

As per feedback last time, I enhanced the existing man page to include
details of this new syscall. Here is the patch.

Thanks
Vivek


Subject: kexec_file_load() syscall man page

We already have man page for kexec_load() syscall. This patch adds details
of kexec_file_load() to same man page.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 man2/kexec_file_load.2 |    1 
 man2/kexec_load.2      |   55 +++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 50 insertions(+), 6 deletions(-)

Index: man-pages/man2/kexec_file_load.2
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ man-pages/man2/kexec_file_load.2	2014-06-25 17:39:12.056441803 -0400
@@ -0,0 +1 @@
+.so man2/kexec_load.2
Index: man-pages/man2/kexec_load.2
===================================================================
--- man-pages.orig/man2/kexec_load.2	2014-06-25 17:36:09.237453355 -0400
+++ man-pages/man2/kexec_load.2	2014-06-26 11:11:49.599810213 -0400
@@ -25,17 +25,26 @@
 .\"
 .TH KEXEC_LOAD 2 2012-07-13 "Linux" "Linux Programmer's Manual"
 .SH NAME
-kexec_load \- load a new kernel for later execution
+kexec_load, kexec_file_load \- load a new kernel for later execution
 .SH SYNOPSIS
 .B #include <linux/kexec.h>
 .br
+
 .BI "long kexec_load(unsigned long " entry ", unsigned long " nr_segments ","
 .br
 .BI "                struct kexec_segment *" segments \
 ", unsigned long " flags ");"
+.br
+
+.BI "int kexec_file_load(int " kernel_fd ", int " initrd_fd ","
+.br
+.BI "                    unsigned long " cmdline_len  \
+", const char *" cmdline ","
+.br
+.BI "                    unsigned long " flags ");"
 
 .IR Note :
-There is no glibc wrapper for this system call; see NOTES.
+There are no glibc wrappers for these system calls; see NOTES.
 .SH DESCRIPTION
 The
 .BR kexec_load ()
@@ -111,11 +120,42 @@ struct kexec_segment {
 The kernel image defined by
 .I segments
 is copied from the calling process into previously reserved memory.
+.SS kexec_file_load()
+The
+.BR kexec_file_load ()
+system call is similar to
+.BR kexec_load(),
+but it takes a different set of arguments. It reads kernel to be loaded from
+file descriptor
+.IR kernel_fd
+and initrd to be loaded from file descriptor
+.IR initrd_fd .
+It also takes length of kernel command line in
+.IR cmdline_len
+and pointer to command line in
+.IR cmdline .
+
+The
+.IR flags
+argument is a mask which allows control over system call operation. The
+following values can be specified in
+.IR flags
+
+.TP
+.BR KEXEC_FILE_UNLOAD
+Unload currently loaded kernel.
+.TP
+.BR KEXEC_FILE_ON_CRASH
+Load kernel in memory region reserved for crash kernel. This kernel is
+booted into if currently running kernel crashes.
+.TP
+.BR KEXEC_FILE_NO_INITRAMFS
+Loading initrd/initramfs is optional. Specify this flag if no initramfs
+is being loaded. If this flag is set, kernel will ignore the value passed
+in
+.IR initrd_fd
 .SH RETURN VALUE
-On success,
-.BR kexec_load ()
-returns 0.
-On error, \-1 is returned and
+On success, these system calls returns 0.  On error, \-1 is returned and
 .I errno
 is set to indicate the error.
 .SH ERRORS
@@ -135,6 +175,9 @@ is too large
 The caller does not have the
 .BR CAP_SYS_BOOT
 capability.
+.TP
+.B ENOEXEC
+kernel_fd does not refer to an open file. Or kernel can't load this file.
 .SH VERSIONS
 The
 .BR kexec_load ()


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2014-06-26 20:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 20:33 [PATCH 00/15][V4] kexec: A new system call to allow in kernel loading Vivek Goyal
2014-06-26 20:33 ` [PATCH 01/15] bin2c: Move bin2c in scripts/basic Vivek Goyal
2014-06-26 20:33 ` [PATCH 02/15] kernel: Build bin2c based on config option CONFIG_BUILD_BIN2C Vivek Goyal
2014-06-26 20:33 ` [PATCH 03/15] kexec: rename unusebale_pages to unusable_pages Vivek Goyal
2014-06-26 20:33 ` [PATCH 04/15] kexec: Move segment verification code in a separate function Vivek Goyal
2014-06-26 20:33 ` [PATCH 05/15] kexec: Use common function for kimage_normal_alloc() and kimage_crash_alloc() Vivek Goyal
2014-06-26 20:33 ` [PATCH 06/15] resource: Provide new functions to walk through resources Vivek Goyal
2014-06-26 20:33 ` [PATCH 07/15] kexec: Make kexec_segment user buffer pointer a union Vivek Goyal
2014-06-26 20:33 ` [PATCH 08/15] kexec: New syscall kexec_file_load() declaration Vivek Goyal
2014-06-26 20:43   ` Vivek Goyal [this message]
2014-06-26 21:03     ` Andy Lutomirski
2014-06-27 11:50       ` Vivek Goyal
2014-06-27 12:20         ` Michael Kerrisk (man-pages)
2014-06-26 20:33 ` [PATCH 09/15] kexec: Implementation of new syscall kexec_file_load Vivek Goyal
2014-06-26 20:58   ` Andrew Morton
2014-06-27 16:31     ` Vivek Goyal
2014-07-01 20:25       ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 10/15] purgatory/sha256: Provide implementation of sha256 in purgaotory context Vivek Goyal
2014-06-26 20:33 ` [PATCH 11/15] purgatory: Core purgatory functionality Vivek Goyal
2014-08-11 17:40   ` Shaun Ruffell
2014-08-11 17:51     ` H. Peter Anvin
2014-08-11 18:02       ` Vivek Goyal
2014-08-11 18:08         ` H. Peter Anvin
2014-08-11 18:15           ` Vivek Goyal
2014-08-11 20:23           ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 12/15] kexec: Load and Relocate purgatory at kernel load time Vivek Goyal
2014-06-26 20:33 ` [PATCH 13/15] kexec-bzImage64: Support for loading bzImage using 64bit entry Vivek Goyal
2014-06-26 20:33 ` [PATCH 14/15] kexec: Support for kexec on panic using new system call Vivek Goyal
2014-06-26 20:33 ` [PATCH 15/15] kexec: Support kexec/kdump on EFI systems Vivek Goyal
2014-07-01 19:46   ` Matt Fleming
2014-07-01 20:14     ` Andrew Morton
2014-07-01 20:21       ` Vivek Goyal
2014-07-01 21:23       ` Matt Fleming
2014-07-01 20:09   ` [PATCH 17/15] kexec-bzimage: Change EFI helper function names Vivek Goyal
2014-06-26 20:39 ` [PATCH 00/15][V4] kexec: A new system call to allow in kernel loading Vivek Goyal
2014-06-26 20:58 ` Andrew Morton
2014-06-26 21:21   ` Borislav Petkov
2014-06-27 11:33   ` Vivek Goyal
2014-06-27 16:34 ` [PATCH 16/15] kexec: Fix freeing up for image loader data loading Vivek Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140626204303.GE11136@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=bp@alien8.de \
    --cc=chaowang@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=greg@kroah.com \
    --cc=hpa@zytor.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox