xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86-64/EFI: allow chaining of config files
Date: Tue, 11 Sep 2012 14:34:05 +0100	[thread overview]
Message-ID: <CC74FC5D.4B717%keir@xen.org> (raw)
In-Reply-To: <504F4148020000780009A919@nat28.tlf.novell.com>

On 11/09/2012 12:48, "Jan Beulich" <JBeulich@suse.com> wrote:

> Namely when making use the CONFIG_XEN_COMPAT_* options in the legacy
> Linux kernels, newer kernels may not be compatible with older
> hypervisors, so trying to boot such a combination makes little sense.
> Booting older kernels on newer hypervisors, however, has to always
> work.
> 
> With the way xen.efi looks for its configuration file, allowing
> individual configuration files to refer only to compatible kernels,
> and referring from an older- to a newer-hypervisor one (the kernels
> of which will, as said, necessarily be compatible with the older
> hypervisor) allows to greatly reduce redundancy at least in
> development environments where one frequently wants multiple
> hypervisors and kernles to be installed in parallel.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/docs/misc/efi.markdown
> +++ b/docs/misc/efi.markdown
> @@ -75,6 +75,13 @@ Specifies an XSM module to load.
>  
>  Specifies a CPU microcode blob to load.
>  
> +###`chain=<filename>`
> +
> +Specifies an alternate configuration file to use in case the specified
> section
> +(and in particular its `kernel=` setting) can't be found in the default (or
> +specified) configuration file. This is only meaningful in the [global]
> section
> +and really not meant to be used together with the `-cfg=` command line
> option.
> +
>  Filenames must be specified relative to the location of the EFI binary.
>  
>  Extra options to be passed to Xen can also be specified on the command line,
> --- a/xen/arch/x86/efi/boot.c
> +++ b/xen/arch/x86/efi/boot.c
> @@ -809,7 +809,26 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
>      else
>          section.s = get_value(&cfg, "global", "default");
>  
> -    name.s = get_value(&cfg, section.s, "kernel");
> +    for ( ; ; )
> +    {
> +        name.s = get_value(&cfg, section.s, "kernel");
> +        if ( name.s )
> +            break;
> +        name.s = get_value(&cfg, "global", "chain");
> +        if ( !name.s )
> +            break;
> +        efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
> +        cfg.addr = 0;
> +        if ( !read_file(dir_handle, s2w(&name), &cfg) )
> +        {
> +            PrintStr(L"Chained configuration file '");
> +            PrintStr(name.w);
> +            efi_bs->FreePool(name.w);
> +            blexit(L"'not found\r\n");
> +        }
> +        pre_parse(&cfg);
> +        efi_bs->FreePool(name.w);
> +    }
>      if ( !name.s )
>          blexit(L"No Dom0 kernel image specified\r\n");
>      split_value(name.s);
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

      reply	other threads:[~2012-09-11 13:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11 11:48 [PATCH] x86-64/EFI: allow chaining of config files Jan Beulich
2012-09-11 13:34 ` Keir Fraser [this message]

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=CC74FC5D.4B717%keir@xen.org \
    --to=keir@xen.org \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xen.org \
    /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;
as well as URLs for NNTP newsgroup(s).