runtime-xenelf-check.patch
PATCH 1/1 runtime-xenelf-check.patch
Permit both paravirtualized (i.e. with __xen_guest section) and fully virtualized kernels as domain 0. Currently this is decided at compile time, we'd like to make it a runtime check.
Signed-off-by Kevin Tian <[email protected]>
Signed-off-by Arun Sharma <[email protected]>
xen/common/elf.c +4 -7
@@ -11,12 +11,6 @@#include <xen/elf.h> #include <xen/sched.h> -#ifdef CONFIG_X86 -#define FORCE_XENELF_IMAGE 1 -#elif defined(__ia64__) -#define FORCE_XENELF_IMAGE 0 -#endif -static void loadelfsymtab (struct domain_setup_info *dsi,int doload);static inline int is_loadable_phdr (Elf_Phdr *phdr) {
@@ -88,9 +82,12 @@if ( guestinfo ==NULL ) {printk ("Not a Xen-ELF image: '__xen_guest' section not found.\n" ); -#if FORCE_XENELF_IMAGE + dsi->xen_elf_image =0 ; +#if CONFIG_FORCE_XENELF_IMAGE return -EINVAL ;#endif + }else { + dsi->xen_elf_image =1 ; }for ( h =0 ; h < ehdr->e_phnum; h++ )
===== xen/include/asm-ia64/config.h 1.23 vs edited =====
xen/include/asm-ia64/config.h +1 -0
@@ -9,6 +9,7 @@// defined in linux/arch/ia64/defconfig //#define CONFIG_IA64_GENERIC +#define CONFIG_FORCE_XENELF_IMAGE 0#define CONFIG_IA64_HP_SIM #define CONFIG_IA64_L1_CACHE_SHIFT 7// needed by include/asm-ia64/page.h
===== xen/include/asm-x86/config.h 1.51 vs edited =====
xen/include/asm-x86/config.h +1 -0
@@ -11,6 +11,7 @@#define CONFIG_X86 1#define CONFIG_SHADOW 1 +#define CONFIG_FORCE_XENELF_IMAGE 1#define CONFIG_SMP 1#define CONFIG_X86_LOCAL_APIC 1
===== xen/include/xen/sched.h 1.175 vs edited =====
xen/include/xen/sched.h +2 -0
@@ -163,6 +163,8 @@unsigned int load_symtab;unsigned long symtab_addr;unsigned long symtab_len; +/* Indicate whether it's xen specific image */ +unsigned int xen_elf_image; };#include <asm/uaccess.h> /* for KERNEL_DS */