@@ -198,7 +198,7 @@ static void __init microcode_scan_module(struct boot_info *bi)
ucode_blob.data = cd.data;
break;
}
- bootstrap_map(NULL);
+ bootstrap_unmap();
}
}
@@ -763,13 +763,13 @@ static int __init cf_check microcode_init(void)
*/
if ( ucode_blob.size )
{
- bootstrap_map(NULL);
+ bootstrap_unmap();
ucode_blob.size = 0;
ucode_blob.data = NULL;
}
else if ( ucode_mod.mod_end )
{
- bootstrap_map(NULL);
+ bootstrap_unmap();
ucode_mod.mod_end = 0;
}
@@ -37,7 +37,9 @@ extern struct boot_info xen_boot_info;
unsigned long initial_images_nrpages(nodeid_t node);
void discard_initial_images(void);
+
void *bootstrap_map(const module_t *mod);
+void bootstrap_unmap(void);
int remove_xen_ranges(struct rangeset *r);
@@ -830,7 +830,7 @@ static int __init dom0_construct(struct domain *d,
printk("Failed to load the kernel binary\n");
goto out;
}
- bootstrap_map(NULL);
+ bootstrap_unmap();
if ( UNSET_ADDR != parms.virt_hypercall )
{
@@ -471,13 +471,15 @@ static void *__init bootstrap_map_addr(paddr_t start, paddr_t end)
void *__init bootstrap_map(const module_t *mod)
{
- if ( !mod )
- return bootstrap_map_addr(0, 0);
-
return bootstrap_map_addr(pfn_to_paddr(mod->mod_start),
pfn_to_paddr(mod->mod_start) + mod->mod_end);
}
+void __init bootstrap_unmap(void)
+{
+ bootstrap_map_addr(0, 0);
+}
+
static void __init move_memory(
uint64_t dst, uint64_t src, unsigned int size)
{
@@ -1402,7 +1404,7 @@ void asmlinkage __init noreturn __start_xen(void)
}
modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
- bootstrap_map(NULL);
+ bootstrap_unmap();
#ifndef highmem_start
/* Don't allow split below 4Gb. */
@@ -153,14 +153,14 @@ int __init xsm_multiboot_init(struct boot_info *bi)
ret = xsm_multiboot_policy_init(bi, &policy_buffer, &policy_size);
if ( ret )
{
- bootstrap_map(NULL);
+ bootstrap_unmap();
printk(XENLOG_ERR "Error %d initializing XSM policy\n", ret);
return -EINVAL;
}
}
ret = xsm_core_init(policy_buffer, policy_size);
- bootstrap_map(NULL);
+ bootstrap_unmap();
return 0;
}
@@ -63,7 +63,7 @@ int __init xsm_multiboot_policy_init(
}
- bootstrap_map(NULL);
+ bootstrap_unmap();
}
return rc;
We're about to introduce alternative mapping functions, and passing NULL was always a slightly weird way to express unmap. Make an explicit unmap function, to avoid having two different valid ways of unmapping. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> --- CC: Jan Beulich <JBeulich@suse.com> CC: Roger Pau Monné <roger.pau@citrix.com> CC: Daniel P. Smith <dpsmith@apertussolutions.com> v7.5: * New --- xen/arch/x86/cpu/microcode/core.c | 6 +++--- xen/arch/x86/include/asm/setup.h | 2 ++ xen/arch/x86/pv/dom0_build.c | 2 +- xen/arch/x86/setup.c | 10 ++++++---- xen/xsm/xsm_core.c | 4 ++-- xen/xsm/xsm_policy.c | 2 +- 6 files changed, 15 insertions(+), 11 deletions(-)