[PATCH 4/8] kexec: add infrastructure for handling kexec images

Daniel Kiper daniel.kiper at oracle.com
Fri Mar 8 06:37:08 EST 2013


On Thu, Feb 21, 2013 at 05:48:10PM +0000, David Vrabel wrote:
> From: David Vrabel <david.vrabel at citrix.com>
>
> Add the code needed to handle and load kexec images into Xen memory or
> into the crash region.  This is needed for the new KEXEC_CMD_load and
> KEXEC_CMD_unload hypercall sub-ops.
>
> Much of this code is derived from the Linux kernel.
>
> Signed-off-by: David Vrabel <david.vrabel at citrix.com>

[...]

> diff --git a/xen/common/kimage.c b/xen/common/kimage.c

[...]

> +static int kimage_load_segment(struct kexec_image *image, xen_kexec_segment_t *segment)
> +{
> +    int result = -ENOMEM;

Somewhere should be a check that arhitecture of loaded image
is compatible with arhitecture on which we currently running.

> +    switch ( image->type )
> +    {
> +    case KEXEC_TYPE_DEFAULT:
> +        result = kimage_load_normal_segment(image, segment);
> +        break;
> +    case KEXEC_TYPE_CRASH:
> +        result = kimage_load_crash_segment(image, segment);
> +        break;
> +    }
> +
> +    return result;
> +}

Daniel



More information about the kexec mailing list