From: john.levon@sun.com Date: Mon, 8 Jan 2007 20:54:41 +0000 (-0800) Subject: Use strstr() to look for "bimodal" string in ELF notes, to allow guests to use X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15405^2~50 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5c8a39cf80c48d7048f03ed77d7a552d0c1dcc0e;p=xen.git 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 --- diff --git a/tools/libxc/xc_load_elf.c b/tools/libxc/xc_load_elf.c index cabc164cca..4d7d9823a5 100644 --- a/tools/libxc/xc_load_elf.c +++ b/tools/libxc/xc_load_elf.c @@ -406,17 +406,19 @@ static int parseelfimage(const char *image, } /* - * A "bimodal" ELF note indicates the kernel will adjust to the - * current paging mode, including handling extended cr3 syntax. - * If we have ELF notes then PAE=yes implies that we must support - * the extended cr3 syntax. Otherwise we need to find the - * [extended-cr3] syntax in the __xen_guest string. + * A "bimodal" ELF note indicates the kernel will adjust to the current + * paging mode, including handling extended cr3 syntax. If we have ELF + * notes then PAE=yes implies that we must support the extended cr3 syntax. + * Otherwise we need to find the [extended-cr3] syntax in the __xen_guest + * string. We use strstr() to look for "bimodal" to allow guests to use + * "yes,bimodal" or "no,bimodal" for compatibility reasons. */ + dsi->pae_kernel = PAEKERN_no; if ( dsi->__elfnote_section ) { p = xen_elfnote_string(dsi, XEN_ELFNOTE_PAE_MODE); - if ( p != NULL && strncmp(p, "bimodal", 7) == 0 ) + if ( p != NULL && strstr(p, "bimodal") != NULL ) dsi->pae_kernel = PAEKERN_bimodal; else if ( p != NULL && strncmp(p, "yes", 3) == 0 ) dsi->pae_kernel = PAEKERN_extended_cr3; diff --git a/xen/common/elf.c b/xen/common/elf.c index 6a55053e74..8414f5e933 100644 --- a/xen/common/elf.c +++ b/xen/common/elf.c @@ -300,7 +300,7 @@ int parseelfimage(struct domain_setup_info *dsi) if ( dsi->__elfnote_section ) { p = xen_elfnote_string(dsi, XEN_ELFNOTE_PAE_MODE); - if ( p != NULL && strncmp(p, "bimodal", 7) == 0 ) + if ( p != NULL && strstr(p, "bimodal") != NULL ) dsi->pae_kernel = PAEKERN_bimodal; else if ( p != NULL && strncmp(p, "yes", 3) == 0 ) dsi->pae_kernel = PAEKERN_extended_cr3;