aboutsummaryrefslogtreecommitdiffstats
path: root/xen/xsm
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2010-11-09 11:49:49 +0000
committerKeir Fraser <keir@xen.org>2010-11-09 11:49:49 +0000
commit5a771800114c437fb857b44b3ed74f60e87979c2 (patch)
treea9a1089b753cdfb65757b08c6406d1721d989ad3 /xen/xsm
parente04aea7477c379e904e7520bdfa2f42284427a97 (diff)
downloadxen-5a771800114c437fb857b44b3ed74f60e87979c2.tar.gz
xen-5a771800114c437fb857b44b3ed74f60e87979c2.tar.bz2
xen-5a771800114c437fb857b44b3ed74f60e87979c2.zip
x86: do away with the boot time low-memory 1:1 mapping
By doing so, we're no longer restricted to be able to place all boot loader modules into the low 1Gb/4Gb (32-/64-bit) of memory, nor is there a dependency anymore on where the boot loader places the modules. We're also no longer restricted to copy the modules into a place below 4Gb, nor to put them all together into a single piece of memory. Further it allows even the 32-bit Dom0 kernel to be loaded anywhere in physical memory (except if it doesn't support PAE-above-4G). Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/xsm')
-rw-r--r--xen/xsm/xsm_core.c7
-rw-r--r--xen/xsm/xsm_policy.c19
2 files changed, 12 insertions, 14 deletions
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index e55f25b5d9..b3d5a5b4f0 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -47,7 +47,7 @@ static void __init do_xsm_initcalls(void)
}
int __init xsm_init(unsigned int *initrdidx, const multiboot_info_t *mbi,
- unsigned long initial_images_start)
+ void *(*bootstrap_map)(const module_t *))
{
int ret = 0;
@@ -55,9 +55,10 @@ int __init xsm_init(unsigned int *initrdidx, const multiboot_info_t *mbi,
if ( XSM_MAGIC )
{
- ret = xsm_policy_init(initrdidx, mbi, initial_images_start);
+ ret = xsm_policy_init(initrdidx, mbi, bootstrap_map);
if ( ret )
{
+ bootstrap_map(NULL);
printk("%s: Error initializing policy.\n", __FUNCTION__);
return -EINVAL;
}
@@ -65,6 +66,7 @@ int __init xsm_init(unsigned int *initrdidx, const multiboot_info_t *mbi,
if ( verify(&dummy_xsm_ops) )
{
+ bootstrap_map(NULL);
printk("%s could not verify "
"dummy_xsm_ops structure.\n", __FUNCTION__);
return -EIO;
@@ -72,6 +74,7 @@ int __init xsm_init(unsigned int *initrdidx, const multiboot_info_t *mbi,
xsm_ops = &dummy_xsm_ops;
do_xsm_initcalls();
+ bootstrap_map(NULL);
return 0;
}
diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
index 2919c1a699..4336afdef6 100644
--- a/xen/xsm/xsm_policy.c
+++ b/xen/xsm/xsm_policy.c
@@ -22,11 +22,11 @@
#include <xsm/xsm.h>
#include <xen/multiboot.h>
-char *policy_buffer = NULL;
-u32 policy_size = 0;
+char *__initdata policy_buffer = NULL;
+u32 __initdata policy_size = 0;
int xsm_policy_init(unsigned int *initrdidx, const multiboot_info_t *mbi,
- unsigned long initial_images_start)
+ void *(*bootstrap_map)(const module_t *))
{
int i;
module_t *mod = (module_t *)__va(mbi->mods_addr);
@@ -40,15 +40,8 @@ int xsm_policy_init(unsigned int *initrdidx, const multiboot_info_t *mbi,
*/
for ( i = mbi->mods_count-1; i >= 1; i-- )
{
- start = initial_images_start + (mod[i].mod_start-mod[0].mod_start);
-#if defined(__i386__)
- _policy_start = (u32 *)start;
-#elif defined(__x86_64__)
- _policy_start = maddr_to_virt(start);
-#else
- _policy_start = NULL;
-#endif
- _policy_len = mod[i].mod_end - mod[i].mod_start;
+ _policy_start = bootstrap_map(mod + i);
+ _policy_len = mod[i].mod_end;
if ( (xsm_magic_t)(*_policy_start) == XSM_MAGIC )
{
@@ -63,6 +56,8 @@ int xsm_policy_init(unsigned int *initrdidx, const multiboot_info_t *mbi,
break;
}
+
+ bootstrap_map(NULL);
}
return rc;