All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <arun.sharma@intel.com>
To: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>,
	Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com, xen-ia64-devel@lists.xensource.com
Subject: [PATCH] runtime-xenelf-check.patch
Date: Wed, 11 May 2005 11:51:46 -0700	[thread overview]
Message-ID: <20050511185146.GA31354@intel.com> (raw)

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 <kevin.tian@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>

--- 1.19/xen/common/elf.c	2005-04-03 04:22:10 -07:00
+++ edited/xen/common/elf.c	2005-05-11 11:35:24 -07:00
@@ -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 =====
--- 1.23/xen/include/asm-ia64/config.h	2005-05-10 15:58:26 -07:00
+++ edited/xen/include/asm-ia64/config.h	2005-05-11 11:43:03 -07:00
@@ -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 =====
--- 1.51/xen/include/asm-x86/config.h	2005-05-09 10:50:07 -07:00
+++ edited/xen/include/asm-x86/config.h	2005-05-11 11:35:26 -07:00
@@ -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 =====
--- 1.175/xen/include/xen/sched.h	2005-05-11 07:12:02 -07:00
+++ edited/xen/include/xen/sched.h	2005-05-11 11:35:25 -07:00
@@ -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 */

                 reply	other threads:[~2005-05-11 18:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20050511185146.GA31354@intel.com \
    --to=arun.sharma@intel.com \
    --cc=Ian.Pratt@cl.cam.ac.uk \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.