direct-io.hg

changeset 13328:204a4a040a42

Use strstr() to look for "bimodal" string in ELF notes, to allow guests to use
"yes,bimodal", so they are correctly identified as PAE on older hypervisors.

Signed-off-by: John Levon <john.levon@sun.com>
author john.levon@sun.com
date Mon Jan 08 12:54:41 2007 -0800 (2007-01-08)
parents 558960865583
children c8bfa8d94cf6
files tools/libxc/xc_load_elf.c xen/common/elf.c
line diff
     1.1 --- a/tools/libxc/xc_load_elf.c	Thu Jan 11 10:10:16 2007 +0000
     1.2 +++ b/tools/libxc/xc_load_elf.c	Mon Jan 08 12:54:41 2007 -0800
     1.3 @@ -406,17 +406,19 @@ static int parseelfimage(const char *ima
     1.4      }
     1.5  
     1.6      /*
     1.7 -     * A "bimodal" ELF note indicates the kernel will adjust to the
     1.8 -     * current paging mode, including handling extended cr3 syntax.
     1.9 -     * If we have ELF notes then PAE=yes implies that we must support
    1.10 -     * the extended cr3 syntax. Otherwise we need to find the
    1.11 -     * [extended-cr3] syntax in the __xen_guest string.
    1.12 +     * A "bimodal" ELF note indicates the kernel will adjust to the current
    1.13 +     * paging mode, including handling extended cr3 syntax.  If we have ELF
    1.14 +     * notes then PAE=yes implies that we must support the extended cr3 syntax.
    1.15 +     * Otherwise we need to find the [extended-cr3] syntax in the __xen_guest
    1.16 +     * string. We use strstr() to look for "bimodal" to allow guests to use
    1.17 +     * "yes,bimodal" or "no,bimodal" for compatibility reasons.
    1.18       */
    1.19 +
    1.20      dsi->pae_kernel = PAEKERN_no;
    1.21      if ( dsi->__elfnote_section )
    1.22      {
    1.23          p = xen_elfnote_string(dsi, XEN_ELFNOTE_PAE_MODE);
    1.24 -        if ( p != NULL && strncmp(p, "bimodal", 7) == 0 )
    1.25 +        if ( p != NULL && strstr(p, "bimodal") != NULL )
    1.26              dsi->pae_kernel = PAEKERN_bimodal;
    1.27          else if ( p != NULL && strncmp(p, "yes", 3) == 0 )
    1.28              dsi->pae_kernel = PAEKERN_extended_cr3;
     2.1 --- a/xen/common/elf.c	Thu Jan 11 10:10:16 2007 +0000
     2.2 +++ b/xen/common/elf.c	Mon Jan 08 12:54:41 2007 -0800
     2.3 @@ -300,7 +300,7 @@ int parseelfimage(struct domain_setup_in
     2.4      if ( dsi->__elfnote_section )
     2.5      {
     2.6          p = xen_elfnote_string(dsi, XEN_ELFNOTE_PAE_MODE);
     2.7 -        if ( p != NULL && strncmp(p, "bimodal", 7) == 0 )
     2.8 +        if ( p != NULL && strstr(p, "bimodal") != NULL )
     2.9              dsi->pae_kernel = PAEKERN_bimodal;
    2.10          else if ( p != NULL && strncmp(p, "yes", 3) == 0 )
    2.11              dsi->pae_kernel = PAEKERN_extended_cr3;