2010-10-31 06:00:21 +00:00
|
|
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
|
|
|
.\"
|
2010-11-04 06:06:58 +00:00
|
|
|
.\" Copyright (C) 2010 Intel Corporation
|
|
|
|
.\" Author: Andi Kleen
|
2010-10-31 06:00:21 +00:00
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
|
|
|
.\"
|
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
|
|
|
.\"
|
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
2010-11-04 06:05:12 +00:00
|
|
|
.TH KEXEC_LOAD 2 2010-11-04 "Linux" "Linux Programmer's Manual"
|
2010-10-31 05:56:47 +00:00
|
|
|
.SH NAME
|
2010-10-31 06:06:49 +00:00
|
|
|
kexec_load \- load a new kernel for later execution
|
2010-10-31 05:56:47 +00:00
|
|
|
.SH SYNOPSIS
|
2010-11-04 06:16:30 +00:00
|
|
|
.B #include <linux/kexec.h>
|
2010-10-31 05:56:47 +00:00
|
|
|
.br
|
|
|
|
.BI "long kexec_load(unsigned long " entry ", unsigned long " nr_segments ","
|
|
|
|
.br
|
2010-10-31 06:06:49 +00:00
|
|
|
.BI " struct kexec_segment *" segments \
|
|
|
|
", unsigned long " flags ");"
|
2010-10-31 05:56:47 +00:00
|
|
|
.SH DESCRIPTION
|
2010-10-31 06:06:49 +00:00
|
|
|
The
|
|
|
|
.BR kexec_load ()
|
|
|
|
system call loads a new kernel that can be executed later by
|
2010-11-04 06:40:06 +00:00
|
|
|
.BR reboot (2).
|
2010-10-31 06:06:49 +00:00
|
|
|
.PP
|
|
|
|
The
|
2010-10-31 05:56:47 +00:00
|
|
|
.I flags
|
2010-10-31 06:06:49 +00:00
|
|
|
argument is a mask whose high-order bits control the operation of the call.
|
|
|
|
The following values can be specified in
|
|
|
|
.IR flags :
|
|
|
|
.TP
|
2010-11-04 05:47:18 +00:00
|
|
|
.BR KEXEC_ON_CRASH " (since Linux 2.6.13)"
|
2010-10-31 06:06:49 +00:00
|
|
|
Execute the new kernel automatically on a system crash.
|
|
|
|
.\" FIXME figure out how this is really used
|
|
|
|
.TP
|
2010-11-04 06:05:12 +00:00
|
|
|
.BR KEXEC_PRESERVE_CONTEXT " (since Linux 2.7.27)"
|
2010-10-31 06:06:49 +00:00
|
|
|
Preserve the system hardware and
|
|
|
|
software states before executing the new kernel.
|
|
|
|
This could be used for system suspend.
|
|
|
|
This flag is only available if the kernel was configured with
|
|
|
|
.BR CONFIG_KEXEC_JUMP ,
|
|
|
|
and is only effective if
|
|
|
|
.I nr_segments
|
|
|
|
is greater than 0.
|
|
|
|
.PP
|
|
|
|
The low-order bits of
|
2010-10-31 05:56:47 +00:00
|
|
|
.I flags
|
2010-10-31 06:06:49 +00:00
|
|
|
contain the architecture of the to-be-executed kernel.
|
|
|
|
Specify (OR) the constant
|
|
|
|
.B KEXEC_ARCH_DEFAULT
|
|
|
|
to use the current architecture,
|
|
|
|
or one of the following architecture constants
|
|
|
|
.BR KEXEC_ARCH_386 ,
|
|
|
|
.BR KEXEC_ARCH_X86_64 ,
|
|
|
|
.BR KEXEC_ARCH_PPC ,
|
|
|
|
.BR KEXEC_ARCH_PPC64 ,
|
|
|
|
.BR KEXEC_ARCH_IA_64 ,
|
|
|
|
.BR KEXEC_ARCH_ARM ,
|
|
|
|
.BR KEXEC_ARCH_S390 ,
|
|
|
|
.BR KEXEC_ARCH_SH ,
|
|
|
|
.BR KEXEC_ARCH_MIPS ,
|
|
|
|
and
|
|
|
|
.BR KEXEC_ARCH_MIPS_LE .
|
2010-10-31 05:56:47 +00:00
|
|
|
The architecture must be executable on the CPU of the system.
|
|
|
|
|
2010-10-31 06:06:49 +00:00
|
|
|
The
|
|
|
|
.I entry
|
2010-10-31 06:16:03 +00:00
|
|
|
argument is the physical entry address in the kernel image.
|
2010-10-31 06:06:49 +00:00
|
|
|
The
|
2010-10-31 05:56:47 +00:00
|
|
|
.I nr_segments
|
2010-10-31 06:06:49 +00:00
|
|
|
argument is the number of segments pointed to by the
|
2010-10-31 05:56:47 +00:00
|
|
|
.I segments
|
2010-10-31 06:06:49 +00:00
|
|
|
pointer.
|
|
|
|
The
|
|
|
|
.I segments
|
|
|
|
argument is an array of
|
|
|
|
.I kexec_segment
|
2010-10-31 05:56:47 +00:00
|
|
|
structures which define the kernel layout:
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
|
|
|
|
struct kexec_segment {
|
2010-10-31 06:06:49 +00:00
|
|
|
void *buf; /* Buffer in user space */
|
|
|
|
size_t bufsz; /* Buffer length in user space */
|
2010-10-31 06:16:03 +00:00
|
|
|
void *mem; /* Physical address of kernel */
|
|
|
|
size_t memsz; /* Physical address length */
|
2010-10-31 05:56:47 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
.PP
|
2010-10-31 06:06:49 +00:00
|
|
|
.\" FIXME elaborate on the following:
|
2010-10-31 05:56:47 +00:00
|
|
|
The kernel image defined by
|
|
|
|
.I segments
|
|
|
|
is copied from the calling process into previously reserved memory.
|
2010-10-31 06:06:49 +00:00
|
|
|
.SH RETURN VALUE
|
|
|
|
On success,
|
|
|
|
.BR kexec_load ()
|
|
|
|
returns 0.
|
fallocate.2, kexec_load.2, poll.2, spu_run.2, atan2.3, cbrt.3, clock_getcpuclockid.3, end.3, frexp.3, getgrouplist.3, getifaddrs.3, matherr.3, modf.3, pow.3, pthread_getattr_np.3, pthread_getcpuclockid.3, sched_getcpu.3, tgamma.3, mouse.4, proc.5, feature_test_macros.7, spufs.7: Global fix: properly escape minus sign
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2011-09-10 01:57:53 +00:00
|
|
|
On error, \-1 is returned and
|
2010-10-31 06:06:49 +00:00
|
|
|
.I errno
|
|
|
|
is set to indicate the error.
|
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
|
|
|
.B EBUSY
|
|
|
|
Another crash kernel is already being loaded
|
|
|
|
or a crash kernel is already in use.
|
|
|
|
.TP
|
|
|
|
.B EINVAL
|
|
|
|
.I flags
|
2010-11-04 06:40:06 +00:00
|
|
|
is invalid; or
|
|
|
|
.IR nr_segments
|
|
|
|
is too large
|
2010-10-31 06:06:49 +00:00
|
|
|
.\" KEXEC_SEGMENT_MAX == 16
|
|
|
|
.TP
|
|
|
|
.B EPERM
|
|
|
|
The caller does not have the
|
|
|
|
.BR CAP_SYS_BOOT
|
|
|
|
capability.
|
2010-10-31 06:14:08 +00:00
|
|
|
.SH VERSIONS
|
|
|
|
The
|
|
|
|
.BR kexec_load ()
|
2010-11-04 06:11:11 +00:00
|
|
|
system call first appeared in Linux 2.6.13.
|
2010-10-31 06:13:11 +00:00
|
|
|
.SH CONFORMING TO
|
|
|
|
This system call is Linux-specific.
|
2010-10-31 05:56:47 +00:00
|
|
|
.SH NOTES
|
2010-10-31 06:06:49 +00:00
|
|
|
Currently, there is no glibc support for
|
|
|
|
.BR kexec_load ().
|
|
|
|
Call it using
|
|
|
|
.BR syscall (2).
|
2010-10-31 05:56:47 +00:00
|
|
|
.PP
|
2010-10-31 06:06:49 +00:00
|
|
|
The required constants are in the kernel source file
|
|
|
|
.IR linux/kexec.h ,
|
|
|
|
which is not currently exported to glibc.
|
|
|
|
.\" FIXME Andi submitted a patch for this.
|
|
|
|
.\" Check if it got accepted later.
|
|
|
|
Therefore, these constants must be defined manually.
|
2010-10-31 06:37:36 +00:00
|
|
|
|
|
|
|
This system call is only available if the kernel was configured with
|
|
|
|
.BR CONFIG_KEXEC .
|
2010-10-31 05:56:47 +00:00
|
|
|
.SH SEE ALSO
|
clock_nanosleep.2, getpriority.2, kexec_load.2, nanosleep.2, nice.2, sched_setaffinity.2, timer_create.2, timer_delete.2, timer_settime.2, utime.2, btowc.3, futimes.3, log.3, pthread_attr_setguardsize.3, pthread_kill_other_threads_np.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setschedparam.3, pthread_setschedprio.3, pthread_tryjoin_np.3, strcoll.3, strcpy.3, string.3, strxfrm.3, networks.5, aio.7, sigevent.7, udplite.7: SEE ALSO: Place entries in correct order
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-11-01 05:34:26 +00:00
|
|
|
.BR reboot (2),
|
|
|
|
.BR syscall (2)
|