]> xenbits.xensource.com Git - xen.git/commitdiff
x86/boot: Introduce bootstrap_unmap()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Oct 2024 15:55:55 +0000 (16:55 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 24 Oct 2024 16:57:59 +0000 (17:57 +0100)
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>
Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>
xen/arch/x86/cpu/microcode/core.c
xen/arch/x86/include/asm/setup.h
xen/arch/x86/pv/dom0_build.c
xen/arch/x86/setup.c
xen/xsm/xsm_core.c
xen/xsm/xsm_policy.c

index 2a4c65744fe002f9edd529d83f94e47f861b47c6..8d916d891e6e5ddc6fa0e16e48a2087f06d04611 100644 (file)
@@ -201,7 +201,7 @@ static void __init microcode_scan_module(struct boot_info *bi)
             ucode_blob.data = cd.data;
             break;
         }
-        bootstrap_map(NULL);
+        bootstrap_unmap();
     }
 }
 
@@ -766,13 +766,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;
     }
 
index 811855e57478bd3b0add76d9dee78c8c76d1c0a4..8b7843104ff7412d1cc7b7b3b39d629da89de39e 100644 (file)
@@ -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);
 
index ee9ecdc2abbf5b88ec24cd7f2db726b0ec7d81bb..cdae17b2765473e529f8b441c8a202310d07e690 100644 (file)
@@ -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 )
     {
index 8c10fe51dfad37c6860ce25985c8ae0ecd87cc08..8e32d6c49c546d2a738cbce6cb35b307fc9e1076 100644 (file)
@@ -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. */
index 6e3fac68c057a1b093b40427ae5ba694f6b04a7f..f255fb63bf6fe6a36285f798719d9d6ee0efaa0e 100644 (file)
@@ -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;
 }
index 6f799dd28f5b98444375048473b5bd7e83850ab4..35f36c6f2359a87374c110f0bf4940b3c56bbcc9 100644 (file)
@@ -63,7 +63,7 @@ int __init xsm_multiboot_policy_init(
 
         }
 
-        bootstrap_map(NULL);
+        bootstrap_unmap();
     }
 
     return rc;