[PATCH 3/5] x86/boot: Introduce bootstrap_map_bm() to map boot_module's

Andrew Cooper posted 5 patches 4 weeks ago
[PATCH 3/5] x86/boot: Introduce bootstrap_map_bm() to map boot_module's
Posted by Andrew Cooper 4 weeks ago
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>

Convert converting the call to bzimage_headroom(), as well as using
bi->mod[0].  It will be used externally by later changes.

No functional change.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
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:
 * Refectored/extracted from later in the series.
---
 xen/arch/x86/include/asm/setup.h | 2 ++
 xen/arch/x86/setup.c             | 9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index 8b7843104ff7..4874ee8936fc 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -38,6 +38,8 @@ extern struct boot_info xen_boot_info;
 unsigned long initial_images_nrpages(nodeid_t node);
 void discard_initial_images(void);
 
+struct boot_module;
+void *bootstrap_map_bm(const struct boot_module *bm);
 void *bootstrap_map(const module_t *mod);
 void bootstrap_unmap(void);
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 8e32d6c49c54..ee03725af380 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -475,6 +475,11 @@ void *__init bootstrap_map(const module_t *mod)
                               pfn_to_paddr(mod->mod_start) + mod->mod_end);
 }
 
+void *__init bootstrap_map_bm(const struct boot_module *bm)
+{
+    return bootstrap_map(bm->mod);
+}
+
 void __init bootstrap_unmap(void)
 {
     bootstrap_map_addr(0, 0);
@@ -1403,7 +1408,9 @@ void asmlinkage __init noreturn __start_xen(void)
         mod[bi->nr_modules].mod_end = __2M_rwdata_end - _stext;
     }
 
-    modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
+    modules_headroom =
+        bzimage_headroom(bootstrap_map_bm(&bi->mods[0]),
+                         bi->mods[0].mod->mod_end);
     bootstrap_unmap();
 
 #ifndef highmem_start
-- 
2.39.5


Re: [PATCH 3/5] x86/boot: Introduce bootstrap_map_bm() to map boot_module's
Posted by Daniel P. Smith 4 weeks ago
On 10/24/24 10:26, Andrew Cooper wrote:
> From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
> 
> Convert converting the call to bzimage_headroom(), as well as using
> bi->mod[0].  It will be used externally by later changes.
> 
> No functional change.
> 
> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> 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>

Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>